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 0119EA2F18 for ; Thu, 3 Oct 2019 01:27:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E39871BFBA; Thu, 3 Oct 2019 01:26:24 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (unknown [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 6F8551BF8E for ; Thu, 3 Oct 2019 01:26:10 +0200 (CEST) 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 C692630C28C; Wed, 2 Oct 2019 16:24:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com C692630C28C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1570058695; bh=pKWI8tMnBMa3QLVnCxij9tS066nPdbQrxpKuf4Q3A8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vjFuncR2ScVHjz5ppA/EFuituraIQkisoyewJwCxM3SeLIP4cJteoq49hR+ez4OTq wZBsXrcm7kNhezmy7wkHueKHb/iZ1iP5zhLwDJQSN5q8Vhk2viV9HPq0Fh08JvvvnO 4BKH1PMMdgEa5LbAf5RlljFyZjM5HVb+Bsxs07Mo= Received: from localhost.localdomain (unknown [10.230.30.225]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 4142514008B; Wed, 2 Oct 2019 16:26:08 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , Somnath Kotur Date: Wed, 2 Oct 2019 16:25:50 -0700 Message-Id: <20191002232601.22715-10-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20191002232601.22715-1-ajit.khaparde@broadcom.com> References: <20191002232601.22715-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 09/20] net/bnxt: fix an issue in setting default MAC address 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 was incorrectly programming the MAC with the already configured one instead of the newly requested MAC by user. Also, fix to restore the old mac address back to the default vnic filter if the mac update operation fails. Fixes: 68f589f2c728e ("net/bnxt: fix setting primary MAC address") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 7cd3213558..2c9eaaa2ef 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1904,7 +1904,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, if (filter->mac_index != 0) continue; - memcpy(filter->l2_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN); + memcpy(filter->l2_addr, addr, RTE_ETHER_ADDR_LEN); memset(filter->l2_addr_mask, 0xff, RTE_ETHER_ADDR_LEN); filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX | HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST; @@ -1913,8 +1913,11 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK; rc = bnxt_hwrm_set_l2_filter(bp, vnic->fw_vnic_id, filter); - if (rc) + if (rc) { + memcpy(filter->l2_addr, bp->mac_addr, + RTE_ETHER_ADDR_LEN); return rc; + } memcpy(bp->mac_addr, addr, RTE_ETHER_ADDR_LEN); PMD_DRV_LOG(DEBUG, "Set MAC addr\n"); -- 2.20.1 (Apple Git-117)