patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: stable@dpdk.org
Cc: Shahed Shaikh <shahed.shaikh@cavium.com>,
	yskoh@mellanox.com, Dept-EngDPDKDev@cavium.com
Subject: [dpdk-stable] [PATCH 17.11 5/5] net/qede: fix unicast MAC address handling in VF
Date: Thu,  2 Aug 2018 18:00:32 -0700	[thread overview]
Message-ID: <1533258032-11551-5-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1533258032-11551-1-git-send-email-rasesh.mody@cavium.com>

From: Shahed Shaikh <shahed.shaikh@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@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(&eth_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,
 						&eth_dev->data->mac_addrs[0]);
-- 
1.7.10.3

  parent reply	other threads:[~2018-08-03  1:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03  1:00 [dpdk-stable] [PATCH 17.11 1/5] net/qede: fix for devargs Rasesh Mody
2018-08-03  1:00 ` [dpdk-stable] [PATCH 17.11 2/5] net/qede: fix default extended VLAN offload config Rasesh Mody
2018-08-03  1:00 ` [dpdk-stable] [PATCH 17.11 3/5] doc: update qede management firmware guide Rasesh Mody
2018-08-03  1:00 ` [dpdk-stable] [PATCH 17.11 4/5] net/qede: fix incorrect link status update Rasesh Mody
2018-08-03  1:00 ` Rasesh Mody [this message]
2018-08-03 17:33 ` [dpdk-stable] [PATCH 17.11 1/5] net/qede: fix for devargs Yongseok Koh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533258032-11551-5-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=shahed.shaikh@cavium.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).