net/ixgbe: fix setting VF MAC address
PATCH 1/1 net/ixgbe: fix setting VF MAC address
This problem occurs because clear_rar is executed at the wrong time,
so PF cannot receive data normally.
This patch is used to modify the calling logic of clear_rar.
--- drivers/net/ixgbe/ixgbe_pf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_pf.c +4 -2
@@ -783,8 +783,10 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) hw->mac.ops.set_rar (hw, vf_info[vf].mac_count, new_mac, vf,IXGBE_RAH_AV ); }else { - hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); - vf_info[vf].mac_count =0 ; +if (vf_info[vf].mac_count) { + hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); + vf_info[vf].mac_count =0 ; + } }return 0 ; }
Signature · 1 line
2.17.1
Hi, Guinan
Quoted 2 lines · Guinan Sun
This problem occurs because
clear_raris executed at the wrong time, so PF cannot receive data normally.
Could you elaborate what problem you've encountered, and how this patch solves it?
Thanks,
Xiaolong
Quoted 30 lines
This patch is used to modify the calling logic of
clear_rar.Fixes 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")Signed-off-by Guinan Sun <[email protected]>---
drivers/net/ixgbe/ixgbe_pf.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ixgbe/ixgbe_pf.c +4
-2@@ -783,8 +783,10 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) hw->mac.ops.set_rar (hw, vf_info[vf].mac_count, new_mac, vf,IXGBE_RAH_AV ); }else { - hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); - vf_info[vf].mac_count =0 ; +if (vf_info[vf].mac_count) { + hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); + vf_info[vf].mac_count =0 ; + } }return 0 ; }Signature · 1 line
2.17.1
PATCH v2 1/1 net/ixgbe: fix setting VF MAC address
In reply to Guinan SunThe reason why PF cannot receive data normally is that vf performed the clear_rar operation through dev close without adding a mac address.
This will cause the association between the index and rx address set by VMDq to be cancelled,thus affecting the data reception of PF.
The correction method is to add a check action, and do not perform the set_rar operation without adding a mac address to prevent affecting the reception of data.
---
v2 changes:
* Modify commit log
--- drivers/net/ixgbe/ixgbe_pf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_pf.c +4 -2
@@ -783,8 +783,10 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) hw->mac.ops.set_rar (hw, vf_info[vf].mac_count, new_mac, vf,IXGBE_RAH_AV ); }else { - hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); - vf_info[vf].mac_count =0 ; +if (vf_info[vf].mac_count) { + hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); + vf_info[vf].mac_count =0 ; + } }return 0 ; }
Signature · 1 line
2.17.1
Quoted 41 lines · Guinan Sun
The reason why PF cannot receive data normally is that vf performed the clear_rar operation through dev close without adding a mac address.
This will cause the association between the index and rx address set by VMDq to be cancelled,thus affecting the data reception of PF.
The correction method is to add a check action, and do not perform theset_raroperation without adding a mac address to prevent affecting the reception of data.Fixes 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")Signed-off-by Guinan Sun <[email protected]>---
v2 changes:
* Modify commit log
---drivers/net/ixgbe/ixgbe_pf.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ixgbe/ixgbe_pf.c +4
-2@@ -783,8 +783,10 @@ ixgbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) hw->mac.ops.set_rar (hw, vf_info[vf].mac_count, new_mac, vf,IXGBE_RAH_AV ); }else { - hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); - vf_info[vf].mac_count =0 ; +if (vf_info[vf].mac_count) { + hw->mac.ops.clear_rar (hw, vf_info[vf].mac_count); + vf_info[vf].mac_count =0 ; + } }return 0 ; }Signature · 1 line
2.17.1
Applied to dpdk-next-net-intel, Thanks.