[dpdk-stable] [PATCH 17.11 5/5] net/qede: fix unicast MAC address handling in VF
Rasesh Mody
rasesh.mody at cavium.com
Fri Aug 3 03:00:32 CEST 2018
From: Shahed Shaikh <shahed.shaikh at cavium.com>
[ upstream commit c7641841af2aaf05bca987a5a0eff5a7fe96caeb ]
We did not register unicast mac configuration handlers
for VF causing failure in bonding of VFs.
Also, mac_addr_set operation requires mac_remove followed
by mac_add.
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Signed-off-by: Shahed Shaikh <shahed.shaikh at cavium.com>
---
drivers/net/qede/qede_ethdev.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 73947fc..89f6ce0 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -859,7 +859,11 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
struct ecore_filter_ucast ucast;
int re;
+ if (!is_valid_assigned_ether_addr(mac_addr))
+ return -EINVAL;
+
qede_set_ucast_cmn_params(&ucast);
+ ucast.opcode = ECORE_FILTER_ADD;
ucast.type = ECORE_FILTER_MAC;
ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac);
re = (int)qede_mac_int_ops(eth_dev, &ucast, 1);
@@ -881,6 +885,9 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
return;
}
+ if (!is_valid_assigned_ether_addr(ð_dev->data->mac_addrs[index]))
+ return;
+
qede_set_ucast_cmn_params(&ucast);
ucast.opcode = ECORE_FILTER_REMOVE;
ucast.type = ECORE_FILTER_MAC;
@@ -906,6 +913,7 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev)
return;
}
+ qede_mac_addr_remove(eth_dev, 0);
qede_mac_addr_add(eth_dev, mac_addr, 0, 0);
}
@@ -2824,6 +2832,9 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev,
.mtu_set = qede_set_mtu,
.udp_tunnel_port_add = qede_udp_dst_port_add,
.udp_tunnel_port_del = qede_udp_dst_port_del,
+ .mac_addr_add = qede_mac_addr_add,
+ .mac_addr_remove = qede_mac_addr_remove,
+ .mac_addr_set = qede_mac_addr_set,
};
static void qede_update_pf_params(struct ecore_dev *edev)
@@ -3004,7 +3015,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
ECORE_LEADING_HWFN(edev),
vf_mac,
&is_mac_forced);
- if (is_mac_exist && is_mac_forced) {
+ if (is_mac_exist) {
DP_INFO(edev, "VF macaddr received from PF\n");
ether_addr_copy((struct ether_addr *)&vf_mac,
ð_dev->data->mac_addrs[0]);
--
1.7.10.3
More information about the stable
mailing list