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 F3FEBA055A; Thu, 27 Feb 2020 09:02:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D64B61BFC7; Thu, 27 Feb 2020 09:02:07 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id F35571BF76 for ; Thu, 27 Feb 2020 09:02:06 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id EFDFE28D92B; Thu, 27 Feb 2020 00:02:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com EFDFE28D92B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1582790526; bh=IzaAzhyqiWRbBTX4+oCjcK9uiJB2MDoFm1MjpRFGJjw=; h=From:To:Cc:Subject:Date:From; b=soSWGBmXo4hGYrp3flHbb65q1FPoWtUFuncyXsB9A993AwAru6/1PrZ2+tKvVWW6m 2F1vPMqyhg0JOyP1KaXFYifoB7Nal/3srf880a2f35aAZ+i+igw91H5gq+NMMxgXD6 cnyC5WFRDNHZgtvFm0iGt/tSChw/62nvVQXcVeA0= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Thu, 27 Feb 2020 13:48:51 +0530 Message-Id: <20200227081851.2938-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix to handle default mac address 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 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") Cc: stable@dpdk.org Reported-by: Stephen Hemminger Signed-off-by: Kalesh AP Reviewed-by: Ajit Kumar Khaparde Reviewed-by: Somnath Kotur --- 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 18aa313..3c50c2e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1103,6 +1103,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; @@ -2094,6 +2098,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