DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Richard Houldsworth <rhouldsworth@solarflare.com>
Subject: [dpdk-dev] [PATCH 05/11] net/sfc/base: add X2 port modes to bandwidth calculator
Date: Mon, 24 Sep 2018 14:50:24 +0100	[thread overview]
Message-ID: <1537797030-26548-6-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1537797030-26548-1-git-send-email-arybchenko@solarflare.com>

From: Richard Houldsworth <rhouldsworth@solarflare.com>

Add cases for the new port modes supported by X2 NICs.
Lane bandwidth is calculated for pre-X2 cards so is an
underestimate for X2 in 25G/100G modes.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_nic.c | 43 ++++++++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c
index c3634e351..1eea7c673 100644
--- a/drivers/net/sfc/base/ef10_nic.c
+++ b/drivers/net/sfc/base/ef10_nic.c
@@ -131,34 +131,59 @@ ef10_nic_get_port_mode_bandwidth(
 	__in		uint32_t port_mode,
 	__out		uint32_t *bandwidth_mbpsp)
 {
+	uint32_t single_lane = 10000;
+	uint32_t dual_lane   = 50000;
+	uint32_t quad_lane   = 40000;
 	uint32_t bandwidth;
 	efx_rc_t rc;
 
 	switch (port_mode) {
 	case TLV_PORT_MODE_1x1_NA:			/* mode 0 */
-		bandwidth = 10000;
+		bandwidth = single_lane;
+		break;
+	case TLV_PORT_MODE_1x2_NA:			/* mode 10 */
+	case TLV_PORT_MODE_NA_1x2:			/* mode 11 */
+		bandwidth = dual_lane;
 		break;
 	case TLV_PORT_MODE_1x1_1x1:			/* mode 2 */
-		bandwidth = 10000 * 2;
+		bandwidth = single_lane + single_lane;
 		break;
 	case TLV_PORT_MODE_4x1_NA:			/* mode 4 */
-	case TLV_PORT_MODE_2x1_2x1:			/* mode 5 */
 	case TLV_PORT_MODE_NA_4x1:			/* mode 8 */
-		bandwidth = 10000 * 4;
+		bandwidth = 4 * single_lane;
+		break;
+	case TLV_PORT_MODE_2x1_2x1:			/* mode 5 */
+		bandwidth = (2 * single_lane) + (2 * single_lane);
+		break;
+	case TLV_PORT_MODE_1x2_1x2:			/* mode 12 */
+		bandwidth = dual_lane + dual_lane;
+		break;
+	case TLV_PORT_MODE_1x2_2x1:			/* mode 17 */
+	case TLV_PORT_MODE_2x1_1x2:			/* mode 18 */
+		bandwidth = dual_lane + (2 * single_lane);
 		break;
 	/* Legacy Medford-only mode. Do not use (see bug63270) */
 	case TLV_PORT_MODE_10G_10G_10G_10G_Q1_Q2:	/* mode 9 */
-		bandwidth = 10000 * 4;
+		bandwidth = 4 * single_lane;
 		break;
 	case TLV_PORT_MODE_1x4_NA:			/* mode 1 */
-		bandwidth = 40000;
+	case TLV_PORT_MODE_NA_1x4:			/* mode 22 */
+		bandwidth = quad_lane;
 		break;
-	case TLV_PORT_MODE_1x4_1x4:			/* mode 3 */
-		bandwidth = 40000 * 2;
+	case TLV_PORT_MODE_2x2_NA:			/* mode 13 */
+	case TLV_PORT_MODE_NA_2x2:			/* mode 14 */
+		bandwidth = 2 * dual_lane;
 		break;
 	case TLV_PORT_MODE_1x4_2x1:			/* mode 6 */
 	case TLV_PORT_MODE_2x1_1x4:			/* mode 7 */
-		bandwidth = 40000 + (10000 * 2);
+		bandwidth = quad_lane + (2 * single_lane);
+		break;
+	case TLV_PORT_MODE_1x4_1x2:			/* mode 15 */
+	case TLV_PORT_MODE_1x2_1x4:			/* mode 16 */
+		bandwidth = quad_lane + dual_lane;
+		break;
+	case TLV_PORT_MODE_1x4_1x4:			/* mode 3 */
+		bandwidth = quad_lane + quad_lane;
 		break;
 	default:
 		rc = EINVAL;
-- 
2.17.1

  parent reply	other threads:[~2018-09-24 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 13:50 [dpdk-dev] [PATCH 00/11] net/sfc: update base driver to support 50G and 100G Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 01/11] net/sfc/base: make last byte of module information available Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 02/11] net/sfc/base: expose PHY module device address constants Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 03/11] net/sfc/base: adjust PHY module info interface Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 04/11] net/sfc/base: update to current port mode terminology Andrew Rybchenko
2018-09-24 13:50 ` Andrew Rybchenko [this message]
2018-09-24 13:50 ` [dpdk-dev] [PATCH 06/11] net/sfc/base: support improvements to bandwidth calculations Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 07/11] net/sfc/base: infer port mode bandwidth from max link speed Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 08/11] net/sfc/base: guard Rx scale code with corresponding option Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 09/11] net/sfc/base: add accessor to whole link status Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 10/11] net/sfc/base: use transceiver ID when reading info Andrew Rybchenko
2018-09-24 13:50 ` [dpdk-dev] [PATCH 11/11] net/sfc: add 50G and 100G XtremeScale X2 family adapters Andrew Rybchenko
2018-09-25 14:32 ` [dpdk-dev] [PATCH 00/11] net/sfc: update base driver to support 50G and 100G 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=1537797030-26548-6-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=rhouldsworth@solarflare.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).