From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE7C5A04FD; Tue, 14 Jan 2020 06:17:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 73CA41C43A; Tue, 14 Jan 2020 06:16:46 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id DD7971C2AE for ; Tue, 14 Jan 2020 06:16:33 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 4C5F830C55E; Mon, 13 Jan 2020 21:10:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 4C5F830C55E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578978622; bh=VBjCAyTYqCoXGekX6yKfIZYFc5a0qRgz+GoWH4BSW+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JzDSVur6siXHAxGlI3990s1PSZXXZ7TjyKD8yJdWOHDBbZyIEDEU5kMBxoH0BWvqJ 6adYYs6lFIM6o4dpnPqOjXpUOMX+dFe6P6iow9tzR7d3q9uoJa244UI/KMJSsus129 YCt0YAXHUV6bBikuSS+1j82Weu357SwZ1zYlrjXw= Received: from localhost.localdomain (unknown [10.230.30.124]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 6E56D14008C; Mon, 13 Jan 2020 21:16:32 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , Venkat Duvvuru Date: Mon, 13 Jan 2020 21:14:31 -0800 Message-Id: <20200114051435.46093-7-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) In-Reply-To: <20200114051435.46093-1-ajit.khaparde@broadcom.com> References: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> <20200114051435.46093-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 06/10] net/bnxt: handle HW filter setting when port is stopped X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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 Reviewed-by: Venkat Duvvuru --- 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 0b2c29bc8..436ecbb84 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -870,6 +870,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; @@ -884,7 +885,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) bp->flags |= BNXT_FLAG_INIT_DONE; 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); @@ -895,6 +895,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; } @@ -1168,6 +1169,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; @@ -1193,6 +1198,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; @@ -1218,6 +1227,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; @@ -1243,6 +1256,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; @@ -1963,6 +1980,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.21.0 (Apple Git-122.2)