DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/4] bnxt patchset
@ 2018-02-07  1:16 Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 1/4] net/bnxt: update bnxt feature list Ajit Khaparde
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ajit Khaparde @ 2018-02-07  1:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Patchset against dpdk-next-net.
Please apply.

Ajit Khaparde (4):
  net/bnxt: update bnxt feature list
  net/bnxt: fix link speed setting with autoneg off
  net/bnxt: add 100G speed config capability
  net/bnxt: fix an incorrect return in mac_addr_add

 doc/guides/nics/features/bnxt.ini |  6 ++++++
 drivers/net/bnxt/bnxt.h           |  1 +
 drivers/net/bnxt/bnxt_ethdev.c    |  2 +-
 drivers/net/bnxt/bnxt_hwrm.c      | 30 +++++++++++++++++++++++++++---
 4 files changed, 35 insertions(+), 4 deletions(-)

-- 
2.14.3 (Apple Git-98)

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

* [dpdk-dev] [PATCH 1/4] net/bnxt: update bnxt feature list
  2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
@ 2018-02-07  1:16 ` Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix link speed setting with autoneg off Ajit Khaparde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2018-02-07  1:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Updating bnxt.ini file.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/nics/features/bnxt.ini | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/guides/nics/features/bnxt.ini b/doc/guides/nics/features/bnxt.ini
index 9ddce0d4a..a534e3063 100644
--- a/doc/guides/nics/features/bnxt.ini
+++ b/doc/guides/nics/features/bnxt.ini
@@ -4,7 +4,9 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
+Link status event    = Y
 Rx interrupt         = Y
 Queue start/stop     = Y
 MTU update           = Y
@@ -23,8 +25,10 @@ SR-IOV               = Y
 VLAN filter          = Y
 Ethertype filter     = Y
 N-tuple filter       = Y
+Flow director        = Y
 Flow control         = Y
 Flow API             = Y
+CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Inner L3 checksum    = Y
@@ -41,4 +45,6 @@ EEPROM dump          = Y
 LED                  = Y
 Linux UIO            = Y
 Linux VFIO           = Y
+ARMv8                = Y
+x86-32               = Y
 x86-64               = Y
-- 
2.14.3 (Apple Git-98)

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

* [dpdk-dev] [PATCH 2/4] net/bnxt: fix link speed setting with autoneg off
  2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 1/4] net/bnxt: update bnxt feature list Ajit Khaparde
@ 2018-02-07  1:16 ` Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 3/4] net/bnxt: add 100G speed config capability Ajit Khaparde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2018-02-07  1:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

When Autoneg is turned off especially on remote side,
link does not come up. This patch fixes that.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 6776c64a5..b5a0badfc 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -163,6 +163,7 @@ struct bnxt_link_info {
 	uint16_t		link_speed;
 	uint16_t		support_speeds;
 	uint16_t		auto_link_speed;
+	uint16_t		force_link_speed;
 	uint16_t		auto_link_speed_mask;
 	uint32_t		preemphasis;
 	uint8_t			phy_type;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 4987cf0a9..5450a0253 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -894,12 +894,22 @@ 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->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;
 	link_info->phy_ver[1] = resp->phy_min;
 	link_info->phy_ver[2] = resp->phy_bld;
 
 	HWRM_UNLOCK();
 
+	PMD_DRV_LOG(DEBUG, "Link Speed %d\n", link_info->link_speed);
+	PMD_DRV_LOG(DEBUG, "Auto Mode %d\n", link_info->auto_mode);
+	PMD_DRV_LOG(DEBUG, "Support Speeds %x\n", link_info->support_speeds);
+	PMD_DRV_LOG(DEBUG, "Auto Link Speed %x\n", link_info->auto_link_speed);
+	PMD_DRV_LOG(DEBUG, "Auto Link Speed Mask %x\n",
+		    link_info->auto_link_speed_mask);
+	PMD_DRV_LOG(DEBUG, "Forced Link Speed %x\n",
+		    link_info->force_link_speed);
+
 	return rc;
 }
 
@@ -2220,7 +2230,9 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	autoneg = bnxt_check_eth_link_autoneg(dev_conf->link_speeds);
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds);
 	link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
-	if (autoneg == 1) {
+	/* Autoneg can be done only when the FW allows */
+	if (autoneg == 1 && !(bp->link_info.auto_link_speed ||
+				bp->link_info.force_link_speed)) {
 		link_req.phy_flags |=
 				HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG;
 		link_req.auto_link_speed_mask =
@@ -2238,7 +2250,13 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 		}
 
 		link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE;
-		link_req.link_speed = speed;
+		/* If user wants a particular speed try that first. */
+		if (speed)
+			link_req.link_speed = speed;
+		else if (bp->link_info.force_link_speed)
+			link_req.link_speed = bp->link_info.force_link_speed;
+		else
+			link_req.link_speed = bp->link_info.auto_link_speed;
 	}
 	link_req.duplex = bnxt_parse_eth_link_duplex(dev_conf->link_speeds);
 	link_req.auto_pause = bp->link_info.auto_pause;
-- 
2.14.3 (Apple Git-98)

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

* [dpdk-dev] [PATCH 3/4] net/bnxt: add 100G speed config capability
  2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 1/4] net/bnxt: update bnxt feature list Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix link speed setting with autoneg off Ajit Khaparde
@ 2018-02-07  1:16 ` Ajit Khaparde
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 4/4] net/bnxt: fix an incorrect return in mac_addr_add Ajit Khaparde
  2018-02-08 13:21 ` [dpdk-dev] [PATCH 0/4] bnxt patchset Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2018-02-07  1:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

We are not parsing for 100G speed correctly.
With this patch we should be able to configure 100G link.

Fixes 710d3bd5568d: ("net/bnxt: add 100G speed detection")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 5450a0253..4dcdf36a5 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2042,6 +2042,10 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed)
 		eth_link_speed =
 			HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB;
 		break;
+	case ETH_LINK_SPEED_100G:
+		eth_link_speed =
+			HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB;
+		break;
 	default:
 		PMD_DRV_LOG(ERR,
 			"Unsupported link speed %d; default to AUTO\n",
@@ -2054,7 +2058,7 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed)
 #define BNXT_SUPPORTED_SPEEDS (ETH_LINK_SPEED_100M | ETH_LINK_SPEED_100M_HD | \
 		ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | \
 		ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G | ETH_LINK_SPEED_25G | \
-		ETH_LINK_SPEED_40G | ETH_LINK_SPEED_50G)
+		ETH_LINK_SPEED_40G | ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G)
 
 static int bnxt_valid_link_speed(uint32_t link_speed, uint16_t port_id)
 {
@@ -2118,6 +2122,8 @@ bnxt_parse_eth_link_speed_mask(struct bnxt *bp, uint32_t link_speed)
 		ret |= HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB;
 	if (link_speed & ETH_LINK_SPEED_50G)
 		ret |= HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB;
+	if (link_speed & ETH_LINK_SPEED_100G)
+		ret |= HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB;
 	return ret;
 }
 
-- 
2.14.3 (Apple Git-98)

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

* [dpdk-dev] [PATCH 4/4] net/bnxt: fix an incorrect return in mac_addr_add
  2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
                   ` (2 preceding siblings ...)
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 3/4] net/bnxt: add 100G speed config capability Ajit Khaparde
@ 2018-02-07  1:16 ` Ajit Khaparde
  2018-02-08 13:21 ` [dpdk-dev] [PATCH 0/4] bnxt patchset Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2018-02-07  1:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable

There is no need to return an error if an existing MAC is added.
Fixes: 778b759ba10e ("net/bnxt: add MAC address")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 2268aba2a..21c46f833 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -727,7 +727,7 @@ static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev,
 		if (filter->mac_index == index) {
 			PMD_DRV_LOG(ERR,
 				"MAC addr already existed for pool %d\n", pool);
-			return -EINVAL;
+			return 0;
 		}
 	}
 	filter = bnxt_alloc_filter(bp);
-- 
2.14.3 (Apple Git-98)

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

* Re: [dpdk-dev] [PATCH 0/4] bnxt patchset
  2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
                   ` (3 preceding siblings ...)
  2018-02-07  1:16 ` [dpdk-dev] [PATCH 4/4] net/bnxt: fix an incorrect return in mac_addr_add Ajit Khaparde
@ 2018-02-08 13:21 ` Ferruh Yigit
  4 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-02-08 13:21 UTC (permalink / raw)
  To: Ajit Khaparde, dev

On 2/7/2018 1:16 AM, Ajit Khaparde wrote:
> Patchset against dpdk-next-net.
> Please apply.
> 
> Ajit Khaparde (4):
>   net/bnxt: update bnxt feature list
>   net/bnxt: fix link speed setting with autoneg off
>   net/bnxt: add 100G speed config capability
>   net/bnxt: fix an incorrect return in mac_addr_add

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-02-08 13:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07  1:16 [dpdk-dev] [PATCH 0/4] bnxt patchset Ajit Khaparde
2018-02-07  1:16 ` [dpdk-dev] [PATCH 1/4] net/bnxt: update bnxt feature list Ajit Khaparde
2018-02-07  1:16 ` [dpdk-dev] [PATCH 2/4] net/bnxt: fix link speed setting with autoneg off Ajit Khaparde
2018-02-07  1:16 ` [dpdk-dev] [PATCH 3/4] net/bnxt: add 100G speed config capability Ajit Khaparde
2018-02-07  1:16 ` [dpdk-dev] [PATCH 4/4] net/bnxt: fix an incorrect return in mac_addr_add Ajit Khaparde
2018-02-08 13:21 ` [dpdk-dev] [PATCH 0/4] bnxt patchset Ferruh Yigit

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).