patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: stable@dpdk.org
Cc: luca.boccassi@gmail.com, ajit.khaparde@broadcom.com
Subject: [dpdk-stable] [PATCH 19.11 1/2] net/bnxt: fix MAC address setting when port is stopped
Date: Wed, 11 Mar 2020 09:26:58 +0530	[thread overview]
Message-ID: <20200311035659.24583-2-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200311035659.24583-1-kalesh-anakkur.purayil@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

[upstream commit 1009a632c851f687b7f6ccf64875552afbac5c46 ]

Driver destroys the VNIC when the port is brought down.
Port HW filter setting such as default MAC address and
unicast MAC filters will be applied when port is started.

Fixed to return success silently for these callbacks
when port is stopped.

Fixes: 39b88344e364 ("net/bnxt: fix enable/disable VLAN filtering")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 802045d..c0b965b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1083,6 +1083,10 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 	}
 
+	/* Filter settings will get applied when port is started */
+	if (!eth_dev->data->dev_started)
+		return 0;
+
 	rc = bnxt_add_mac_filter(bp, vnic, mac_addr, index, pool);
 
 	return rc;
@@ -2076,6 +2080,10 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev,
 	if (rte_is_zero_ether_addr(addr))
 		return -EINVAL;
 
+	/* Filter settings will get applied when port is started */
+	if (!dev->data->dev_started)
+		return 0;
+
 	/* Check if the requested MAC is already added */
 	if (memcmp(addr, bp->mac_addr, RTE_ETHER_ADDR_LEN) == 0)
 		return 0;
-- 
2.10.1


  reply	other threads:[~2020-03-11  3:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  3:56 [dpdk-stable] [PATCH 19.11 0/2] bnxt fixes for 19.11 Kalesh A P
2020-03-11  3:56 ` Kalesh A P [this message]
2020-03-11  3:56 ` [dpdk-stable] [PATCH 19.11 2/2] net/bnxt: fix recovery alarm race condition in port close Kalesh A P
2020-03-11 10:42 ` [dpdk-stable] [PATCH 19.11 0/2] bnxt fixes for 19.11 Luca Boccassi

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=20200311035659.24583-2-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=luca.boccassi@gmail.com \
    --cc=stable@dpdk.org \
    /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).