DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 01/11] net/qede: fix default MAC address handling
@ 2017-04-25  7:28 Rasesh Mody
  2017-04-25  7:28 ` [dpdk-dev] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Harish Patil, Dept-EngDPDKDev, stable

From: Harish Patil <harish.patil@qlogic.com>

- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

Fixes: 2ea6f76aff40 ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |   30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index fbad2a6..b31a7df 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -551,8 +551,6 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
-	struct ecore_filter_ucast ucast;
-	int rc;
 
 	if (IS_VF(edev) && !ecore_vf_check_mac(ECORE_LEADING_HWFN(edev),
 					       mac_addr->addr_bytes)) {
@@ -562,29 +560,7 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 		return;
 	}
 
-	/* First remove the primary mac */
-	qede_set_ucast_cmn_params(&ucast);
-	ucast.opcode = ECORE_FILTER_REMOVE;
-	ucast.type = ECORE_FILTER_MAC;
-	ether_addr_copy(&qdev->primary_mac,
-			(struct ether_addr *)&ucast.mac);
-	rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL);
-	if (rc != 0) {
-		DP_ERR(edev, "Unable to remove current macaddr"
-			     " Reverting to previous default mac\n");
-		ether_addr_copy(&qdev->primary_mac,
-				&eth_dev->data->mac_addrs[0]);
-		return;
-	}
-
-	/* Add new MAC */
-	ucast.opcode = ECORE_FILTER_ADD;
-	ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac);
-	rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL);
-	if (rc != 0)
-		DP_ERR(edev, "Unable to add new default mac\n");
-	else
-		ether_addr_copy(mac_addr, &qdev->primary_mac);
+	qede_mac_addr_add(eth_dev, mac_addr, 0, 0);
 }
 
 static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool action)
@@ -925,10 +901,6 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	SLIST_INIT(&qdev->vlan_list_head);
 
-	/* Add primary mac for PF */
-	if (IS_PF(edev))
-		qede_mac_addr_set(eth_dev, &qdev->primary_mac);
-
 	/* Enable VLAN offloads by default */
 	qede_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK  |
 				       ETH_VLAN_FILTER_MASK |
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-05-07  5:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25  7:28 [dpdk-dev] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 03/11] net/qede: fix LRO handling issue Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 04/11] net/qede: fix coverity detected defects Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 05/11] net/qede: use new stripped VLAN mbuf flags Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 06/11] net/qede: remove IPV4/IPV6 as valid ntuple flows Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 07/11] net/qede: fix FW version string display for SRIOV Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 08/11] net/qede/base: fix coverity issues Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 09/11] net/qede/base: fix macro ecore mfw set field Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 10/11] net/qede/base: fix find zero bit macro Rasesh Mody
2017-04-25  7:28 ` [dpdk-dev] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
2017-05-02  6:15   ` [dpdk-dev] [dpdk-stable] " Yuanhan Liu
2017-05-04  0:14     ` Mody, Rasesh
2017-05-04  2:11       ` Yuanhan Liu
2017-05-07  5:15         ` Mody, Rasesh
2017-04-26  8:15 ` [dpdk-dev] [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Ferruh Yigit

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).