From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 6/6] net/bnxt: fix speed setting on BCM957508-N2100 adapters
Date: Fri, 28 Aug 2020 10:31:12 +0530 [thread overview]
Message-ID: <20200828050112.19482-7-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20200828050112.19482-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
On BCM957508-N2100 adapters, FW will not allow any user other
than BMC to shutdown the port. As a result, bnxt_get_hwrm_link_config()
always returns link up.
Because of this, driver will not update the new port configurations
such as speed, autoneg during a port start.
Fixed the condition to invoke bnxt_set_hwrm_link_config() in
bnxt_init_chip().
Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt.h | 4 ++++
drivers/net/bnxt/bnxt_ethdev.c | 44 ++++++++++++++++++++++++++++--------------
2 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index f4b2a3f..a38fe8c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -81,6 +81,10 @@
#define BROADCOM_DEV_ID_58808 0x16f0
#define BROADCOM_DEV_ID_58802_VF 0xd800
+#define BROADCOM_DEV_957508_N2100 0x5208
+#define IS_BNXT_DEV_957508_N2100(bp) \
+ ((bp)->pdev->id.subsystem_device_id == BROADCOM_DEV_957508_N2100)
+
#define BNXT_MAX_MTU 9574
#define VLAN_TAG_SIZE 4
#define BNXT_NUM_VLANS 2
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 510a0d9..0a038d4 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -605,9 +605,35 @@ static int bnxt_init_ctx_mem(struct bnxt *bp)
return rc;
}
-static int bnxt_init_chip(struct bnxt *bp)
+static int bnxt_update_phy_setting(struct bnxt *bp)
{
struct rte_eth_link new;
+ int rc;
+
+ rc = bnxt_get_hwrm_link_config(bp, &new);
+ if (rc) {
+ PMD_DRV_LOG(ERR, "Failed to get link settings\n");
+ return rc;
+ }
+
+ /*
+ * On BCM957508-N2100 adapters, FW will not allow any user other
+ * than BMC to shutdown the port. bnxt_get_hwrm_link_config() call
+ * always returns link up. Force phy update always in that case.
+ */
+ if (!new.link_status || IS_BNXT_DEV_957508_N2100(bp)) {
+ rc = bnxt_set_hwrm_link_config(bp, true);
+ if (rc) {
+ PMD_DRV_LOG(ERR, "Failed to update PHY settings\n");
+ return rc;
+ }
+ }
+
+ return rc;
+}
+
+static int bnxt_init_chip(struct bnxt *bp)
+{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(bp->eth_dev);
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
uint32_t intr_vector = 0;
@@ -737,21 +763,9 @@ static int bnxt_init_chip(struct bnxt *bp)
goto err_free;
#endif
- rc = bnxt_get_hwrm_link_config(bp, &new);
- if (rc) {
- PMD_DRV_LOG(ERR, "HWRM Get link config failure rc: %x\n", rc);
+ rc = bnxt_update_phy_setting(bp);
+ if (rc)
goto err_free;
- }
-
- if (!bp->link_info->link_up) {
- rc = bnxt_set_hwrm_link_config(bp, true);
- if (rc) {
- PMD_DRV_LOG(ERR,
- "HWRM link config failure rc: %x\n", rc);
- goto err_free;
- }
- }
- bnxt_print_link_info(bp->eth_dev);
bp->mark_table = rte_zmalloc("bnxt_mark_table", BNXT_MARK_TABLE_SZ, 0);
if (!bp->mark_table)
--
2.10.1
next prev parent reply other threads:[~2020-08-28 4:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-28 5:01 [dpdk-dev] [PATCH 0/6] bnxt bug fixes Kalesh A P
2020-08-28 5:01 ` [dpdk-dev] [PATCH 1/6] net/bnxt: fix endianness while setting L4 destination port Kalesh A P
2020-08-28 5:01 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix LRO configuration Kalesh A P
2020-08-28 5:01 ` [dpdk-dev] [PATCH 3/6] net/bnxt: fix to initialize structure variable Kalesh A P
2020-08-28 5:01 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix a possible segfault in vector mode Tx path Kalesh A P
2020-08-28 5:01 ` [dpdk-dev] [PATCH 5/6] net/bnxt: fix L2 filter alloc Kalesh A P
2020-08-28 5:01 ` Kalesh A P [this message]
2020-09-02 19:15 ` [dpdk-dev] [PATCH 0/6] bnxt bug fixes Ajit Khaparde
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=20200828050112.19482-7-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
/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).