DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shijith Thotton <shijith.thotton@caviumnetworks.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/liquidio: set device speed capability info
Date: Thu, 25 May 2017 14:54:18 +0530	[thread overview]
Message-ID: <1495704258-5839-1-git-send-email-shijith.thotton@caviumnetworks.com> (raw)

Add subsystem device id of CN23xx cards and expose speed capability of
devices. Update liquidio feature file to mark support.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
 doc/guides/nics/features/liquidio.ini   |  1 +
 drivers/net/liquidio/base/lio_hw_defs.h |  6 ++++++
 drivers/net/liquidio/lio_ethdev.c       | 19 +++++++++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/doc/guides/nics/features/liquidio.ini b/doc/guides/nics/features/liquidio.ini
index 49cc356..3bea03a 100644
--- a/doc/guides/nics/features/liquidio.ini
+++ b/doc/guides/nics/features/liquidio.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
 Jumbo frame          = Y
diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h
index 67eaa45..de58c7c 100644
--- a/drivers/net/liquidio/base/lio_hw_defs.h
+++ b/drivers/net/liquidio/base/lio_hw_defs.h
@@ -42,6 +42,12 @@
 
 #define LIO_CN23XX_VF_VID	0x9712
 
+/* CN23xx subsystem device ids */
+#define PCI_SUBSYS_DEV_ID_CN2350_210	0x0004
+#define PCI_SUBSYS_DEV_ID_CN2360_210	0x0005
+#define PCI_SUBSYS_DEV_ID_CN2360_225	0x0006
+#define PCI_SUBSYS_DEV_ID_CN2350_225	0x0007
+
 /* --------------------------CONFIG VALUES------------------------ */
 
 /* CN23xx IQ configuration macros */
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 132c837..b92a8f0 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -394,6 +394,25 @@ struct rte_lio_xstats_name_off {
 		 struct rte_eth_dev_info *devinfo)
 {
 	struct lio_device *lio_dev = LIO_DEV(eth_dev);
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+
+	devinfo->pci_dev = pci_dev;
+
+	switch (pci_dev->id.subsystem_device_id) {
+	/* CN23xx 10G cards */
+	case PCI_SUBSYS_DEV_ID_CN2350_210:
+	case PCI_SUBSYS_DEV_ID_CN2360_210:
+		devinfo->speed_capa = ETH_LINK_SPEED_10G;
+		break;
+	/* CN23xx 25G cards */
+	case PCI_SUBSYS_DEV_ID_CN2350_225:
+	case PCI_SUBSYS_DEV_ID_CN2360_225:
+		devinfo->speed_capa = ETH_LINK_SPEED_25G;
+		break;
+	default:
+		lio_dev_err(lio_dev,
+			    "Unknown CN23XX subsystem device id. Not setting speed capability.\n");
+	}
 
 	devinfo->max_rx_queues = lio_dev->max_rx_queues;
 	devinfo->max_tx_queues = lio_dev->max_tx_queues;
-- 
1.8.3.1

             reply	other threads:[~2017-05-25  9:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25  9:24 Shijith Thotton [this message]
2017-05-25 10:30 ` Ferruh Yigit

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=1495704258-5839-1-git-send-email-shijith.thotton@caviumnetworks.com \
    --to=shijith.thotton@caviumnetworks.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).