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 2/3] net/bnxt: handle HW filter setting when port is stopped
Date: Fri, 28 Feb 2020 13:43:58 +0530	[thread overview]
Message-ID: <20200228081359.7578-3-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200228081359.7578-1-kalesh-anakkur.purayil@broadcom.com>

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

[ upstream commit 1c25103326f9e94c9adade33da09ac772a1e59a2 ]

Driver destroy the VNIC when the port is brought down.
Port HW filter setting such as promiscuos, allmulti and
VLAN filtering will be applied when port is started.

Fixed to return success silently for these callbacks
when port is stopped. Also fixed to clear "bp->dev_stopped"
before invoking bnxt_vlan_offload_set_op() in bnxt_dev_start_op().

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e6515ff..c21a05a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -862,6 +862,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev);
 
 	bnxt_link_update(eth_dev, 1, ETH_LINK_UP);
+	bp->dev_stopped = 0;
 
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
 		vlan_mask |= ETH_VLAN_FILTER_MASK;
@@ -875,7 +876,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);
 
 	eth_dev->data->dev_started = 1;
-	bp->dev_stopped = 0;
 	pthread_mutex_lock(&bp->def_cp_lock);
 	bnxt_schedule_fw_health_check(bp);
 	pthread_mutex_unlock(&bp->def_cp_lock);
@@ -886,6 +886,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	bnxt_shutdown_nic(bp);
 	bnxt_free_tx_mbufs(bp);
 	bnxt_free_rx_mbufs(bp);
+	bp->dev_stopped = 1;
 	return rc;
 }
 
@@ -1153,6 +1154,10 @@ static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)
 	if (rc)
 		return rc;
 
+	/* Filter settings will get applied when port is started */
+	if (bp->dev_stopped == 1)
+		return 0;
+
 	if (bp->vnic_info == NULL)
 		return 0;
 
@@ -1178,6 +1183,10 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)
 	if (rc)
 		return rc;
 
+	/* Filter settings will get applied when port is started */
+	if (bp->dev_stopped == 1)
+		return 0;
+
 	if (bp->vnic_info == NULL)
 		return 0;
 
@@ -1203,6 +1212,10 @@ static int bnxt_allmulticast_enable_op(struct rte_eth_dev *eth_dev)
 	if (rc)
 		return rc;
 
+	/* Filter settings will get applied when port is started */
+	if (bp->dev_stopped == 1)
+		return 0;
+
 	if (bp->vnic_info == NULL)
 		return 0;
 
@@ -1228,6 +1241,10 @@ static int bnxt_allmulticast_disable_op(struct rte_eth_dev *eth_dev)
 	if (rc)
 		return rc;
 
+	/* Filter settings will get applied when port is started */
+	if (bp->dev_stopped == 1)
+		return 0;
+
 	if (bp->vnic_info == NULL)
 		return 0;
 
@@ -1956,6 +1973,10 @@ bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask)
 	if (rc)
 		return rc;
 
+	/* Filter settings will get applied when port is started */
+	if (bp->dev_stopped == 1)
+		return 0;
+
 	if (mask & ETH_VLAN_FILTER_MASK) {
 		/* Enable or disable VLAN filtering */
 		rc = bnxt_config_vlan_hw_filter(bp, rx_offloads);
-- 
2.10.1


  parent reply	other threads:[~2020-02-28  7:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  8:13 [dpdk-stable] [PATCH 19.11 0/3] bnxt fixes for 19.11 stable Kalesh A P
2020-02-28  8:13 ` [dpdk-stable] [PATCH 19.11 1/3] net/bnxt: fix return code handling in VLAN config Kalesh A P
2020-02-28  8:13 ` Kalesh A P [this message]
2020-02-28  8:13 ` [dpdk-stable] [PATCH 19.11 3/3] net/bnxt: remove a redundant variable Kalesh A P
2020-02-28 11:12 ` [dpdk-stable] [PATCH 19.11 0/3] bnxt fixes for 19.11 stable 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=20200228081359.7578-3-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).