From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 84F695AA9 for ; Sat, 26 Mar 2016 02:28:11 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id 139so1258462wmn.2 for ; Fri, 25 Mar 2016 18:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=971jY9nUIe9BiDC6Ccz1fAYo/BvprBRoO2o692AxSow=; b=NclJdmmMECEWatt/XQ/8YXacM9erq8XkUZG/D9H2qCRZaD6HMYOwlknL2SBDvisfDl VEyW7dgT71Rv8OMsj0NYcM41OH9XozBktb7T6uUKDej5TYhBBqU6ou+gbYkO2feNjpwg uzFcoVn4nUwV69ad4/0gbQ9h04w2ce+k3VdomXP42+8M5qbdsHLEkWFaMaBAdSRHPg/L ubcIb9DHw0QODk4YEY8oUUBSHSZdnRRRvgJAk/othoXcKyASVlExiT3PFnKKyChhSq4j IwDkZvsUrcdPVxG5YWhToS6BzzUb3ZK7A4qNIp92vqpgAxBayCscNrevHuCGeKvOp7af keFw== 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=971jY9nUIe9BiDC6Ccz1fAYo/BvprBRoO2o692AxSow=; b=VT/pBAjIzn8WnjlQuWq8vingBf6qlpVIt+NdzLtdZ5ps2S59n+dKErkiqfzXpwAv3N P/eN4FyUy4EwHdGRi2WhP8Y9X/BoZ3IQSa93M5bSRGk0vz1yDg4jA+Wcd0nJeIR1DCeB Yskup7zGzpSouPcNzrqfy4jnMrxUk8P0olNhvgnVBuzQ++28E+Kk94ToVUt8zgB7f7vb m2HQ2ljzw3x7LEN+jW/iv0a62EPcc3R6iw3elLflhTsdPaHFTGGk4knE45S+vbW2emzZ vaqzTEx04De7jonbuPqowK2MinXdQpHaIS88vYgn4gol6bFpKtg9TTNx2cTSui7Rqq6Q Z6FQ== X-Gm-Message-State: AD7BkJJSJkJyZp320cMfgKuUW5VEVCo632h7OfUaJFuwWImxPCfSJmDnlQppKPA7dFmAhQ== X-Received: by 10.194.242.202 with SMTP id ws10mr17638210wjc.3.1458955691357; Fri, 25 Mar 2016 18:28:11 -0700 (PDT) Received: from localhost.localdomain (28.red-88-23-79.staticip.rima-tde.net. [88.23.79.28]) by smtp.gmail.com with ESMTPSA id hh8sm14070113wjc.42.2016.03.25.18.28.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 18:28:10 -0700 (PDT) From: Marc Sune To: Thomas Monjalon , "Xu, Qian Q" , "Xing, Beilei" , "dev@dpdk.org" , "Ananyev, Konstantin" , "Lu, Wenzhuo" , "Richardson, Bruce" , "Glynn, Michael J" Cc: Marc Sune Date: Sat, 26 Mar 2016 02:27:20 +0100 Message-Id: <1458955640-22951-9-git-send-email-marcdevel@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458955640-22951-1-git-send-email-marcdevel@gmail.com> References: <1458934950-23333-1-git-send-email-thomas.monjalon@6wind.com> <1458955640-22951-1-git-send-email-marcdevel@gmail.com> Subject: [dpdk-dev] [PATCH v13 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: Sat, 26 Mar 2016 01:28:11 -0000 From: Thomas Monjalon 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 Signed-off-by: Thomas Monjalon Tested-by: Nelio Laranjeiro Tested-by: Matej Vido --- app/test-pmd/cmdline.c | 12 +++++++----- doc/guides/nics/szedata2.rst | 6 ------ doc/guides/rel_notes/release_16_04.rst | 5 +++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- drivers/net/ena/ena_ethdev.c | 3 ++- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 3 ++- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 9 ++------- lib/librte_ether/rte_ethdev.c | 2 ++ lib/librte_ether/rte_ethdev.h | 4 +++- 11 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 741cac3..c5b9479 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" @@ -1022,6 +1022,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 { @@ -1069,7 +1071,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 = @@ -1079,7 +1081,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, @@ -1143,7 +1145,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"); @@ -1154,7 +1156,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/nics/szedata2.rst b/doc/guides/nics/szedata2.rst index 77c15b3..741b400 100644 --- a/doc/guides/nics/szedata2.rst +++ b/doc/guides/nics/szedata2.rst @@ -148,9 +148,3 @@ Example output: TX threshold registers: pthresh=0 hthresh=0 wthresh=0 TX RS bit threshold=0 - TXQ flags=0x0 testpmd> - -.. note:: - - Link speed API currently supports speeds up to 40 Gbps. - Therefore there is used 10G constant for 100 Gbps cards until the link speed - API is not changed. diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index c891a55..a0fc02d 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -320,6 +320,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 94fba6a..aed5e47 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/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 4e403af..02af67a 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1177,7 +1177,8 @@ static void ena_infos_get(struct rte_eth_dev *dev, ETH_LINK_SPEED_10G | ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G | - ETH_LINK_SPEED_50G; + ETH_LINK_SPEED_50G | + ETH_LINK_SPEED_100G; /* Get supported features from HW */ rc = ena_com_get_dev_attr_feat(ena_dev, &feat); diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 85ad0df..953d9c1 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1413,7 +1413,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; } #ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index beecc63..36b369e 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -566,7 +566,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G | ETH_LINK_SPEED_50G | - ETH_LINK_SPEED_56G; + ETH_LINK_SPEED_56G | + ETH_LINK_SPEED_100G; priv_unlock(priv); } diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index bdeb21f..4e909e0 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1062,7 +1062,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 const uint32_t * diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index ee97a4e..78c43b0 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1036,6 +1036,7 @@ eth_dev_info(struct rte_eth_dev *dev, dev_info->max_rx_queues = internals->max_rx_queues; dev_info->max_tx_queues = internals->max_tx_queues; dev_info->min_rx_bufsize = 0; + dev_info->speed_capa = ETH_LINK_SPEED_100G; } static void @@ -1155,13 +1156,7 @@ eth_link_update(struct rte_eth_dev *dev, link.link_speed = ETH_SPEED_NUM_40G; break; case SZEDATA2_LINK_SPEED_100G: - /* - * TODO - * If link_speed value from rte_eth_link structure - * will be changed to support 100Gbps speed change - * this value to 100G. - */ - link.link_speed = ETH_SPEED_NUM_10G; + link.link_speed = ETH_SPEED_NUM_100G; break; default: link.link_speed = ETH_SPEED_NUM_10G; diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 695b475..fd49b26 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -892,6 +892,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 0b436d9..fb247a7 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.1.4