patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: stable@dpdk.org
Cc: ktraynor@redhat.com
Subject: [dpdk-stable] [PATCH 18.11 01/19] net/bnxt: fix setting default MAC address
Date: Wed, 18 Dec 2019 11:53:53 +0530	[thread overview]
Message-ID: <20191218062411.13079-2-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20191218062411.13079-1-somnath.kotur@broadcom.com>

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

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: 68f589f2c728 ("net/bnxt: fix setting primary MAC address")

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 30a9aa4..1da0b12 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1548,7 +1548,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr)
 		if (filter->mac_index != 0)
 			continue;
 
-		memcpy(filter->l2_addr, bp->mac_addr, ETHER_ADDR_LEN);
+		memcpy(filter->l2_addr, addr, ETHER_ADDR_LEN);
 		memset(filter->l2_addr_mask, 0xff, ETHER_ADDR_LEN);
 		filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX;
 		filter->enables |=
@@ -1556,8 +1556,10 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr)
 			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, ETHER_ADDR_LEN);
 			return rc;
+		}
 
 		memcpy(bp->mac_addr, addr, ETHER_ADDR_LEN);
 		PMD_DRV_LOG(DEBUG, "Set MAC addr\n");
-- 
2.10.1


  reply	other threads:[~2019-12-18  6:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  6:23 [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Somnath Kotur
2019-12-18  6:23 ` Somnath Kotur [this message]
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 02/19] net/bnxt: fix error checking of FW commands Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 03/19] net/bnxt: fix check of address mapping Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 04/19] net/bnxt: fix stats errors handling Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 05/19] net/bnxt: move macro definitions to header file Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 06/19] net/bnxt: fix extended port counter statistics Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 07/19] net/bnxt: fix VF probe when MAC address is zero Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 08/19] net/bnxt: fix coding style Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 09/19] net/bnxt: fix async link handling and update Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 10/19] net/bnxt: fix flow flush handling Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 11/19] net/bnxt: update trusted VF status only when it changes Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 12/19] net/bnxt: fix doorbell register offset for Tx ring Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 13/19] net/bnxt: get default HWRM command timeout from FW Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 14/19] net/bnxt: fix MAC/VLAN filter allocation Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 15/19] net/bnxt: fix forwarding with higher mbuf size Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 16/19] net/bnxt: fix crash after removing and adding slaves Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 17/19] net/bnxt: fix Rx queue count Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 18/19] net/bnxt: fix deferred start of Tx queues Somnath Kotur
2019-12-18 10:21   ` Kevin Traynor
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 19/19] net/bnxt: fix rx queue start/stop Somnath Kotur
2019-12-18 11:22 ` [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Kevin Traynor

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=20191218062411.13079-2-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=ktraynor@redhat.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).