DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/4] bnxt fixes
@ 2021-06-09  3:13 Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 1/4] net/bnxt: cleanup code Kalesh A P
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kalesh A P @ 2021-06-09  3:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

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

This set contains few bnxt fixes and code cleanup changes.

Kalesh AP (4):
  net/bnxt: cleanup code
  net/bnxt: fix typo in log message
  net/bnxt: fix enabling autoneg on Whitney+
  net/bnxt: invoke device removal event on recovery failure

 drivers/net/bnxt/bnxt_ethdev.c | 11 ++++++++---
 drivers/net/bnxt/bnxt_hwrm.c   | 22 ++++++++++------------
 2 files changed, 18 insertions(+), 15 deletions(-)

-- 
2.10.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 1/4] net/bnxt: cleanup code
  2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
@ 2021-06-09  3:13 ` Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix typo in log message Kalesh A P
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kalesh A P @ 2021-06-09  3:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

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

This is a cleanup commit and no functional change.

1. use macros instead of hard coded values
2. remove unnecessary comments

Fixes: 5cd0e2889c43 ("net/bnxt: support NIC Partitioning")
Fixes: 2ba07b7dbd9d ("net/bnxt: set the hash key size")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 +--
 drivers/net/bnxt/bnxt_hwrm.c   | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 30aa0ef..f38fe6a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -959,7 +959,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	dev_info->max_rx_queues = max_rx_rings;
 	dev_info->max_tx_queues = max_rx_rings;
 	dev_info->reta_size = bnxt_rss_hash_tbl_size(bp);
-	dev_info->hash_key_size = 40;
+	dev_info->hash_key_size = HW_HASH_KEY_SIZE;
 	max_vnics = bp->max_vnics;
 
 	/* MTU specifics */
@@ -2064,7 +2064,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
 	if (rc)
 		return rc;
 
-	/* Retrieve from the default VNIC */
 	if (!vnic)
 		return -EINVAL;
 	if (!vnic->rss_table)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 31f1d31..5d34081 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3307,7 +3307,6 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	return rc;
 }
 
-/* JIRA 22088 */
 int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
 {
 	struct hwrm_func_qcfg_input req = {0};
@@ -3324,8 +3323,7 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
 
 	HWRM_CHECK_RESULT();
 
-	/* Hard Coded.. 0xfff VLAN ID mask */
-	bp->vlan = rte_le_to_cpu_16(resp->vlan) & 0xfff;
+	bp->vlan = rte_le_to_cpu_16(resp->vlan) & ETH_VLAN_ID_MAX;
 
 	svif_info = rte_le_to_cpu_16(resp->svif_info);
 	if (svif_info & HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID)
-- 
2.10.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 2/4] net/bnxt: fix typo in log message
  2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 1/4] net/bnxt: cleanup code Kalesh A P
@ 2021-06-09  3:13 ` Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 3/4] net/bnxt: fix enabling autoneg on Whitney+ Kalesh A P
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kalesh A P @ 2021-06-09  3:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

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

In bnxt_rss_hash_update_op, check for valid RSS hashkey length is
made against size HW_HASH_KEY_SIZE(40). But the failure log says
"Invalid hashkey length, should be 16 bytes".

Fixes: 91aee9711ee3 ("net/bnxt: validate RSS hash key length")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f38fe6a..e069559 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2145,7 +2145,8 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
 
 	if (rss_conf->rss_key_len != HW_HASH_KEY_SIZE) {
 		PMD_DRV_LOG(ERR,
-			    "Invalid hashkey length, should be 16 bytes\n");
+			    "Invalid hashkey length, should be %d bytes\n",
+			    HW_HASH_KEY_SIZE);
 		return -EINVAL;
 	}
 	memcpy(vnic->rss_hash_key, rss_conf->rss_key, rss_conf->rss_key_len);
-- 
2.10.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 3/4] net/bnxt: fix enabling autoneg on Whitney+
  2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 1/4] net/bnxt: cleanup code Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix typo in log message Kalesh A P
@ 2021-06-09  3:13 ` Kalesh A P
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 4/4] net/bnxt: invoke device removal event on recovery failure Kalesh A P
  2021-06-16 22:38 ` [dpdk-dev] [PATCH 0/4] bnxt fixes Ajit Khaparde
  4 siblings, 0 replies; 6+ messages in thread
From: Kalesh A P @ 2021-06-09  3:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

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

Driver should enable autoneg on a port if FW supports it.
Because of a wrong check, driver is not enabling autoneg
on a port after setting forced speed on Whitney+.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5d34081..451a65d 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1489,6 +1489,7 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
 
 	link_info->support_speeds = rte_le_to_cpu_16(resp->support_speeds);
 	link_info->auto_link_speed = rte_le_to_cpu_16(resp->auto_link_speed);
+	link_info->auto_link_speed_mask = rte_le_to_cpu_16(resp->auto_link_speed_mask);
 	link_info->preemphasis = rte_le_to_cpu_32(resp->preemphasis);
 	link_info->force_link_speed = rte_le_to_cpu_16(resp->force_link_speed);
 	link_info->phy_ver[0] = resp->phy_maj;
@@ -1543,6 +1544,12 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp)
 
 	HWRM_UNLOCK();
 
+	/* Older firmware does not have supported_auto_speeds, so assume
+	 * that all supported speeds can be autonegotiated.
+	 */
+	if (link_info->auto_link_speed_mask && !link_info->support_auto_speeds)
+		link_info->support_auto_speeds = link_info->support_speeds;
+
 	return 0;
 }
 
@@ -3243,15 +3250,8 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds,
 					  bp->link_info->link_signal_mode);
 	link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
-	/* Autoneg can be done only when the FW allows.
-	 * When user configures fixed speed of 40G and later changes to
-	 * any other speed, auto_link_speed/force_link_speed is still set
-	 * to 40G until link comes up at new speed.
-	 */
-	if (autoneg == 1 &&
-	    !(!BNXT_CHIP_P5(bp) &&
-	      (bp->link_info->auto_link_speed ||
-	       bp->link_info->force_link_speed))) {
+	/* Autoneg can be done only when the FW allows. */
+	if (autoneg == 1 && bp->link_info->support_auto_speeds) {
 		link_req.phy_flags |=
 				HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG;
 		link_req.auto_link_speed_mask =
-- 
2.10.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH 4/4] net/bnxt: invoke device removal event on recovery failure
  2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
                   ` (2 preceding siblings ...)
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 3/4] net/bnxt: fix enabling autoneg on Whitney+ Kalesh A P
@ 2021-06-09  3:13 ` Kalesh A P
  2021-06-16 22:38 ` [dpdk-dev] [PATCH 0/4] bnxt fixes Ajit Khaparde
  4 siblings, 0 replies; 6+ messages in thread
From: Kalesh A P @ 2021-06-09  3:13 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

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

When the driver receives RESET_NOTIFY async event from FW or detects
a FW fatal error condition, it tries to recover from the error.
When the driver fails to recover from the error condition, fixed to
send device removal event to the application.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e069559..5e8d369 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4340,6 +4340,10 @@ static void bnxt_dev_recover(void *arg)
 err:
 	bp->flags |= BNXT_FLAG_FATAL_ERROR;
 	bnxt_uninit_resources(bp, false);
+	if (bp->eth_dev->data->dev_conf.intr_conf.rmv)
+		rte_eth_dev_callback_process(bp->eth_dev,
+					     RTE_ETH_EVENT_INTR_RMV,
+					     NULL);
 	pthread_mutex_unlock(&bp->err_recovery_lock);
 	PMD_DRV_LOG(ERR, "Failed to recover from FW reset\n");
 }
@@ -6395,6 +6399,7 @@ static int bnxt_pci_remove(struct rte_pci_device *pci_dev)
 static struct rte_pci_driver bnxt_rte_pmd = {
 	.id_table = bnxt_pci_id_map,
 	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
+			RTE_PCI_DRV_INTR_RMV |
 			RTE_PCI_DRV_PROBE_AGAIN, /* Needed in case of VF-REPs
 						  * and OVS-DPDK
 						  */
-- 
2.10.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH 0/4] bnxt fixes
  2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
                   ` (3 preceding siblings ...)
  2021-06-09  3:13 ` [dpdk-dev] [PATCH 4/4] net/bnxt: invoke device removal event on recovery failure Kalesh A P
@ 2021-06-16 22:38 ` Ajit Khaparde
  4 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2021-06-16 22:38 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dpdk-dev, Ferruh Yigit

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

On Tue, Jun 8, 2021 at 7:52 PM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> This set contains few bnxt fixes and code cleanup changes.

Patchset applied to dpdk-next-net-brcm for-next-net branch.

>
> Kalesh AP (4):
>   net/bnxt: cleanup code
>   net/bnxt: fix typo in log message
>   net/bnxt: fix enabling autoneg on Whitney+
>   net/bnxt: invoke device removal event on recovery failure
>
>  drivers/net/bnxt/bnxt_ethdev.c | 11 ++++++++---
>  drivers/net/bnxt/bnxt_hwrm.c   | 22 ++++++++++------------
>  2 files changed, 18 insertions(+), 15 deletions(-)
>
> --
> 2.10.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-16 22:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  3:13 [dpdk-dev] [PATCH 0/4] bnxt fixes Kalesh A P
2021-06-09  3:13 ` [dpdk-dev] [PATCH 1/4] net/bnxt: cleanup code Kalesh A P
2021-06-09  3:13 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix typo in log message Kalesh A P
2021-06-09  3:13 ` [dpdk-dev] [PATCH 3/4] net/bnxt: fix enabling autoneg on Whitney+ Kalesh A P
2021-06-09  3:13 ` [dpdk-dev] [PATCH 4/4] net/bnxt: invoke device removal event on recovery failure Kalesh A P
2021-06-16 22:38 ` [dpdk-dev] [PATCH 0/4] bnxt fixes Ajit Khaparde

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git