From: Guinan Sun Date: Wed, 11 Mar 2020 09:06:51 +0000 (+0000) Subject: net/ixgbe: fix setting VF MAC address X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=a6131c7a9589fb452f00c4a7c8f1197108691f6f net/ixgbe: fix setting VF MAC address 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 the set_rar operation without adding a mac address to prevent affecting the reception of data. Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove") Cc: stable@dpdk.org Signed-off-by: Guinan Sun Acked-by: Xiaolong Ye --- diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index afae21f81f..67b5bef44f 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -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; }