From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id E24D32C6B for ; Mon, 14 Mar 2016 22:57:34 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id p65so120092322wmp.1 for ; Mon, 14 Mar 2016 14:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nS69nlGD5HX/PaTnBuWUpY5QZpeMLc7VhWZ7f2dYg/E=; b=gMvkYlekdB2mgp3zdMIl4kw2tby8h08cIrnJEQRJCur+84l92qMqZXG1oeGfkwNI80 rpr0aAN9jW2hdg1GE6d8ZXC8CQMv7vRKyoBP2GPb6axlrC82qg1uZJk1QpXWuYgbKrjD 4M4eoKYI60kjtmBt47lu7ethwQXwLT0jtfYBDhcCongs4HBzNuSkdgtD3GK8rzp8Huie VaLGlaFJGDHmzTJjQG577wRPobnO3rZx65SgAsMxHOyMTnPHbhUJAtVndz2hPTMugiQZ p/ucfWiIDNV4f5bcR2a5GeS2V4YAuKjaSCVmZREFzNuckapV/y2cH2begWHunQnRef1/ mm3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nS69nlGD5HX/PaTnBuWUpY5QZpeMLc7VhWZ7f2dYg/E=; b=cnflxEswWoZdmDk2btZGVzSWRa3cpL6VrJFRB2UTczL8nUlrQpeKsWDoe9PlLS6vD5 wAQkdd1/7zYIE47SS331gE0XfEo/xkblxk45cfaZYwSMu53oaO8zZHP9ydBuPeaZ+EZE T5c9+P8YVlePhVXlEajowDWqUoTjKcQWbF2GvxHsbJHyy4a3ICFJXehRLNCdsv/zNfEj XFgRwgf7wruUtnWw5c6zsK1bmoKwAMWxGeDDRhjWWA0Vrh0sHa9Z2KgvsD0qffnAKcXJ ScvPSViZ+h9b5z+QEEevOhVmm7bVH+P384qpO0sc20tJvdPIxa5ictW1V2hHiXlQJLYG vITA== X-Gm-Message-State: AD7BkJLPCW/yFyMB7cvPGyRo465wxWlWh0mzivsY0LGGh647OwUBhc4j/t89UCaEoeASAEpS X-Received: by 10.194.174.134 with SMTP id bs6mr26308743wjc.111.1457992654800; Mon, 14 Mar 2016 14:57:34 -0700 (PDT) Received: from XPS13.localdomain (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id w133sm17918804wmd.3.2016.03.14.14.57.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2016 14:57:34 -0700 (PDT) From: Thomas Monjalon To: marcdevel@gmail.com, bruce.richardson@intel.com, declan.doherty@intel.com, konstantin.ananyev@intel.com, wenzhuo.lu@intel.com, helin.zhang@intel.com, jing.d.chen@intel.com, harish.patil@qlogic.com, rahul.lakkireddy@chelsio.com, johndale@cisco.com, vido@cesnet.cz, adrien.mazarguil@6wind.com, alejandro.lucero@netronome.com Cc: dev@dpdk.org Date: Mon, 14 Mar 2016 22:55:46 +0100 Message-Id: <1457992546-32230-9-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> References: <1456793151-1475-1-git-send-email-marcdevel@gmail.com> <1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH v10 8/8] ethdev: add 100G link speed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 21:57:35 -0000 The link speed configuration is now done with bitmaps so 100G speed requires only a new bit flag. The actual link speed is a number so its size must be increased from 16-bit to 32-bit. Signed-off-by: Marc Sune Tested-by: Nelio Laranjeiro Signed-off-by: Thomas Monjalon --- app/test-pmd/cmdline.c | 12 +++++++----- doc/guides/rel_notes/release_16_04.rst | 5 +++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 1 + lib/librte_ether/rte_ethdev.c | 2 ++ lib/librte_ether/rte_ethdev.h | 4 +++- 9 files changed, 22 insertions(+), 10 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 3bc7bb4..3337b7b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -549,7 +549,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Detach physical or virtual dev by port_id\n\n" "port config (port_id|all)" - " speed (10|100|1000|10000|40000|auto)" + " speed (10|100|1000|10000|40000|100000|auto)" " duplex (half|full|auto)\n" " Set speed and duplex for all ports or port_id\n\n" @@ -1017,6 +1017,8 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) *speed = ETH_LINK_SPEED_10G; } else if (!strcmp(speedstr, "40000")) { *speed = ETH_LINK_SPEED_40G; + } else if (!strcmp(speedstr, "100000")) { + *speed = ETH_LINK_SPEED_100G; } else if (!strcmp(speedstr, "auto")) { *speed = ETH_LINK_SPEED_AUTONEG; } else { @@ -1064,7 +1066,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_item1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed"); cmdline_parse_token_string_t cmd_config_speed_all_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1, - "10#100#1000#10000#40000#auto"); + "10#100#1000#10000#40000#100000#auto"); cmdline_parse_token_string_t cmd_config_speed_all_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex"); cmdline_parse_token_string_t cmd_config_speed_all_value2 = @@ -1074,7 +1076,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_value2 = cmdline_parse_inst_t cmd_config_speed_all = { .f = cmd_config_speed_all_parsed, .data = NULL, - .help_str = "port config all speed 10|100|1000|10000|40000|auto duplex " + .help_str = "port config all speed 10|100|1000|10000|40000|100000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_all_port, @@ -1138,7 +1140,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_item1 = "speed"); cmdline_parse_token_string_t cmd_config_speed_specific_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1, - "10#100#1000#10000#40000#auto"); + "10#100#1000#10000#40000#100000#auto"); cmdline_parse_token_string_t cmd_config_speed_specific_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2, "duplex"); @@ -1149,7 +1151,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_value2 = cmdline_parse_inst_t cmd_config_speed_specific = { .f = cmd_config_speed_specific_parsed, .data = NULL, - .help_str = "port config X speed 10|100|1000|10000|40000|auto duplex " + .help_str = "port config X speed 10|100|1000|10000|40000|100000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_specific_port, diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index f6d00f5..4700899 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -157,6 +157,11 @@ EAL Drivers ~~~~~~~ +* **ethdev: Fixed overflow for 100Gbps.** + + 100Gbps in Mbps (100000) was exceeding 16-bit max value of ``link_speed`` + in ``rte_eth_link``. + * **ethdev: Fixed byte order consistency between fdir flow and mask.** Fixed issue in ethdev library that the structure for setting diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index efaf2b5..cb49495 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1155,7 +1155,7 @@ port config - speed Set the speed and duplex mode for all ports or a specific port:: - testpmd> port config (port_id|all) speed (10|100|1000|10000|auto) \ + testpmd> port config (port_id|all) speed (10|100|1000|10000|40000|100000|auto) \ duplex (half|full|auto) port config - queues/descriptors diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 4d8c6bf..b4a0523 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1336,7 +1336,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | ETH_LINK_SPEED_10G | ETH_LINK_SPEED_25G | - ETH_LINK_SPEED_40G; + ETH_LINK_SPEED_40G | ETH_LINK_SPEED_100G; } static int diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 7494f69..6f82a3d 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -525,7 +525,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) info->reta_size = priv->ind_table_max_size; info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G | - ETH_LINK_SPEED_50G; + ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G; priv_unlock(priv); } diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index be1a364..00f0ce9 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1072,7 +1072,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->reta_size = NFP_NET_CFG_RSS_ITBL_SZ; dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ; - dev_info->speed_capa = ETH_LINK_SPEED_50G; + dev_info->speed_capa = ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G; } static uint32_t diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 38be554..fa7c09d 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1218,6 +1218,7 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_tx_queues = (uint16_t)internals->nb_tx_queues; dev_info->min_rx_bufsize = 0; dev_info->pci_dev = NULL; + dev_info->speed_capa = ETH_LINK_SPEED_100G; } static void diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4594f41..ab39296 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -888,6 +888,8 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) return ETH_LINK_SPEED_50G; case ETH_SPEED_NUM_56G: return ETH_LINK_SPEED_56G; + case ETH_SPEED_NUM_100G: + return ETH_LINK_SPEED_100G; default: return 0; } diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 5e3bd04..e215d55 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -259,6 +259,7 @@ struct rte_eth_stats { #define ETH_LINK_SPEED_40G (1 << 11) /**< 40 Gbps */ #define ETH_LINK_SPEED_50G (1 << 12) /**< 50 Gbps */ #define ETH_LINK_SPEED_56G (1 << 13) /**< 56 Gbps */ +#define ETH_LINK_SPEED_100G (1 << 14) /**< 100 Gbps */ /** * Ethernet numeric link speeds in Mbps @@ -275,12 +276,13 @@ struct rte_eth_stats { #define ETH_SPEED_NUM_40G 40000 /**< 40 Gbps */ #define ETH_SPEED_NUM_50G 50000 /**< 50 Gbps */ #define ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */ +#define ETH_SPEED_NUM_100G 100000 /**< 100 Gbps */ /** * A structure used to retrieve link-level information of an Ethernet port. */ struct rte_eth_link { - uint16_t link_speed; /**< ETH_SPEED_NUM_ */ + uint32_t link_speed; /**< ETH_SPEED_NUM_ */ uint16_t link_duplex : 1; /**< ETH_LINK_[HALF/FULL]_DUPLEX */ uint16_t link_autoneg : 1; /**< ETH_LINK_SPEED_[AUTONEG/FIXED] */ uint16_t link_status : 1; /**< ETH_LINK_[DOWN/UP] */ -- 2.7.0