DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/qede: fix unknown speed errmsg for 25G link
@ 2016-11-10  2:26 Rasesh Mody
  2016-11-10  7:51 ` Thomas Monjalon
  2016-11-11 17:41 ` [dpdk-dev] [PATCH v2] " Harish Patil
  0 siblings, 2 replies; 4+ messages in thread
From: Rasesh Mody @ 2016-11-10  2:26 UTC (permalink / raw)
  To: dev; +Cc: Dept-EngDPDKDev, Harish Patil

From: Harish Patil <harish.patil@qlogic.com>

Fix to use bitmapped values in NVM configuration for speed capability
advertisement. This issue is specific to 25G NIC since it is capable
of 25G and 10G speeds.

Fixes: 64c239b7f8b7 ("net/qede: fix advertising link speed capability")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c | 15 ++++++++++++++-
 drivers/net/qede/qede_if.h     |  2 +-
 drivers/net/qede/qede_main.c   | 25 ++-----------------------
 3 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 59129f2..f57f80d 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -647,6 +647,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	struct qed_link_output link;
+	uint32_t speed_cap = 0;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
@@ -681,7 +682,19 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 
 	memset(&link, 0, sizeof(struct qed_link_output));
 	qdev->ops->common->get_link(edev, &link);
-	dev_info->speed_capa = rte_eth_speed_bitflag(link.adv_speed, 0);
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G)
+		speed_cap |= ETH_LINK_SPEED_1G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
+		speed_cap |= ETH_LINK_SPEED_10G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G)
+		speed_cap |= ETH_LINK_SPEED_25G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
+		speed_cap |= ETH_LINK_SPEED_40G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)
+		speed_cap |= ETH_LINK_SPEED_50G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G)
+		speed_cap |= ETH_LINK_SPEED_100G;
+	dev_info->speed_capa = speed_cap;
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h
index 4936349..2131fe2 100644
--- a/drivers/net/qede/qede_if.h
+++ b/drivers/net/qede/qede_if.h
@@ -70,7 +70,7 @@ struct qed_link_output {
 	uint32_t advertised_caps;	/* In ADVERTISED defs */
 	uint32_t lp_caps;	/* In ADVERTISED defs */
 	uint32_t speed;		/* In Mb/s */
-	uint32_t adv_speed;	/* In Mb/s */
+	uint32_t adv_speed;	/* Speed mask */
 	uint8_t duplex;		/* In DUPLEX defs */
 	uint8_t port;		/* In PORT defs */
 	bool autoneg;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index d2e476c..ab22409 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -488,7 +488,6 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 	struct ecore_mcp_link_state link;
 	struct ecore_mcp_link_capabilities link_caps;
 	uint32_t media_type;
-	uint32_t adv_speed;
 	uint8_t change = 0;
 
 	memset(if_link, 0, sizeof(*if_link));
@@ -516,28 +515,8 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 
 	if_link->duplex = QEDE_DUPLEX_FULL;
 
-	/* Fill up the native advertised speed */
-	switch (params.speed.advertised_speeds) {
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G:
-		adv_speed = 10000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G:
-		adv_speed = 25000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G:
-		adv_speed = 40000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G:
-		adv_speed = 50000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G:
-		adv_speed = 100000;
-	break;
-	default:
-		DP_NOTICE(hwfn, false, "Unknown speed\n");
-		adv_speed = 0;
-	}
-	if_link->adv_speed = adv_speed;
+	/* Fill up the native advertised speed cap mask */
+	if_link->adv_speed = params.speed.advertised_speeds;
 
 	if (params.speed.autoneg)
 		if_link->supported_caps |= QEDE_SUPPORTED_AUTONEG;
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH] net/qede: fix unknown speed errmsg for 25G link
  2016-11-10  2:26 [dpdk-dev] [PATCH] net/qede: fix unknown speed errmsg for 25G link Rasesh Mody
@ 2016-11-10  7:51 ` Thomas Monjalon
  2016-11-11 17:41 ` [dpdk-dev] [PATCH v2] " Harish Patil
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-11-10  7:51 UTC (permalink / raw)
  To: Rasesh Mody, Harish Patil; +Cc: dev, Dept-EngDPDKDev

2016-11-09 18:26, Rasesh Mody:
> From: Harish Patil <harish.patil@qlogic.com>
> 
> Fix to use bitmapped values in NVM configuration for speed capability
> advertisement. This issue is specific to 25G NIC since it is capable
> of 25G and 10G speeds.
> 
> Fixes: 64c239b7f8b7 ("net/qede: fix advertising link speed capability")
> 
> Signed-off-by: Harish Patil <harish.patil@qlogic.com>

Now that the feature seems well implemented, I think you can add
it to the feature matrix (doc/guides/nics/features/qede.ini).

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

* [dpdk-dev] [PATCH v2] net/qede: fix unknown speed errmsg for 25G link
  2016-11-10  2:26 [dpdk-dev] [PATCH] net/qede: fix unknown speed errmsg for 25G link Rasesh Mody
  2016-11-10  7:51 ` Thomas Monjalon
@ 2016-11-11 17:41 ` Harish Patil
  2016-11-12 21:03   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Harish Patil @ 2016-11-11 17:41 UTC (permalink / raw)
  To: dev; +Cc: Dept-EngDPDKDev, Harish Patil

- Fix to use bitmapped values in NVM configuration for speed capability
  advertisement. This issue is specific to 25G NIC since it is capable
  of 25G and 10G speeds.

- Update feature list.

Fixes: 64c239b7f8b7 ("net/qede: fix advertising link speed capability")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 config/common_base                   |  2 +-
 doc/guides/nics/features/qede.ini    |  1 +
 doc/guides/nics/features/qede_vf.ini |  1 +
 doc/guides/nics/qede.rst             |  2 +-
 drivers/net/qede/qede_ethdev.c       | 15 ++++++++++++++-
 drivers/net/qede/qede_if.h           |  2 +-
 drivers/net/qede/qede_main.c         | 25 ++-----------------------
 7 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/config/common_base b/config/common_base
index 21d18f8..4bff83a 100644
--- a/config/common_base
+++ b/config/common_base
@@ -315,7 +315,7 @@ CONFIG_RTE_LIBRTE_PMD_BOND=y
 CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n
 CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n
 
-# QLogic 25G/40G/100G PMD
+# QLogic 10G/25G/40G/100G PMD
 #
 CONFIG_RTE_LIBRTE_QEDE_PMD=y
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
diff --git a/doc/guides/nics/features/qede.ini b/doc/guides/nics/features/qede.ini
index 1f3c3f6..7d75030 100644
--- a/doc/guides/nics/features/qede.ini
+++ b/doc/guides/nics/features/qede.ini
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 MTU update           = Y
diff --git a/doc/guides/nics/features/qede_vf.ini b/doc/guides/nics/features/qede_vf.ini
index 1c0f228..acb1b99 100644
--- a/doc/guides/nics/features/qede_vf.ini
+++ b/doc/guides/nics/features/qede_vf.ini
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 MTU update           = Y
diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst
index b6f54fd..d22ecdd 100644
--- a/doc/guides/nics/qede.rst
+++ b/doc/guides/nics/qede.rst
@@ -71,7 +71,7 @@ Non-supported Features
 Supported QLogic Adapters
 -------------------------
 
-- QLogic FastLinQ QL4xxxx 25G/40G/100G CNAs.
+- QLogic FastLinQ QL4xxxx 10G/25G/40G/100G CNAs.
 
 Prerequisites
 -------------
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 59129f2..d106dd0 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -647,6 +647,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	struct qed_link_output link;
+	uint32_t speed_cap = 0;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
@@ -681,7 +682,19 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 
 	memset(&link, 0, sizeof(struct qed_link_output));
 	qdev->ops->common->get_link(edev, &link);
-	dev_info->speed_capa = rte_eth_speed_bitflag(link.adv_speed, 0);
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G)
+		speed_cap |= ETH_LINK_SPEED_1G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
+		speed_cap |= ETH_LINK_SPEED_10G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G)
+		speed_cap |= ETH_LINK_SPEED_25G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
+		speed_cap |= ETH_LINK_SPEED_40G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)
+		speed_cap |= ETH_LINK_SPEED_50G;
+	if (link.adv_speed & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G)
+		speed_cap |= ETH_LINK_SPEED_100G;
+	dev_info->speed_capa = speed_cap;
 }
 
 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h
index 4936349..2131fe2 100644
--- a/drivers/net/qede/qede_if.h
+++ b/drivers/net/qede/qede_if.h
@@ -70,7 +70,7 @@ struct qed_link_output {
 	uint32_t advertised_caps;	/* In ADVERTISED defs */
 	uint32_t lp_caps;	/* In ADVERTISED defs */
 	uint32_t speed;		/* In Mb/s */
-	uint32_t adv_speed;	/* In Mb/s */
+	uint32_t adv_speed;	/* Speed mask */
 	uint8_t duplex;		/* In DUPLEX defs */
 	uint8_t port;		/* In PORT defs */
 	bool autoneg;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index d2e476c..ab22409 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -488,7 +488,6 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 	struct ecore_mcp_link_state link;
 	struct ecore_mcp_link_capabilities link_caps;
 	uint32_t media_type;
-	uint32_t adv_speed;
 	uint8_t change = 0;
 
 	memset(if_link, 0, sizeof(*if_link));
@@ -516,28 +515,8 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 
 	if_link->duplex = QEDE_DUPLEX_FULL;
 
-	/* Fill up the native advertised speed */
-	switch (params.speed.advertised_speeds) {
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G:
-		adv_speed = 10000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G:
-		adv_speed = 25000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G:
-		adv_speed = 40000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G:
-		adv_speed = 50000;
-	break;
-	case NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G:
-		adv_speed = 100000;
-	break;
-	default:
-		DP_NOTICE(hwfn, false, "Unknown speed\n");
-		adv_speed = 0;
-	}
-	if_link->adv_speed = adv_speed;
+	/* Fill up the native advertised speed cap mask */
+	if_link->adv_speed = params.speed.advertised_speeds;
 
 	if (params.speed.autoneg)
 		if_link->supported_caps |= QEDE_SUPPORTED_AUTONEG;
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH v2] net/qede: fix unknown speed errmsg for 25G link
  2016-11-11 17:41 ` [dpdk-dev] [PATCH v2] " Harish Patil
@ 2016-11-12 21:03   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-11-12 21:03 UTC (permalink / raw)
  To: Harish Patil; +Cc: dev, Dept-EngDPDKDev

2016-11-11 09:41, Harish Patil:
> - Fix to use bitmapped values in NVM configuration for speed capability
>   advertisement. This issue is specific to 25G NIC since it is capable
>   of 25G and 10G speeds.
> 
> - Update feature list.
> 
> Fixes: 64c239b7f8b7 ("net/qede: fix advertising link speed capability")
> 
> Signed-off-by: Harish Patil <harish.patil@qlogic.com>

Applied, thanks

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

end of thread, other threads:[~2016-11-12 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10  2:26 [dpdk-dev] [PATCH] net/qede: fix unknown speed errmsg for 25G link Rasesh Mody
2016-11-10  7:51 ` Thomas Monjalon
2016-11-11 17:41 ` [dpdk-dev] [PATCH v2] " Harish Patil
2016-11-12 21:03   ` Thomas Monjalon

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