From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D83DA0C4D; Wed, 13 Oct 2021 04:45:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DD834113D; Wed, 13 Oct 2021 04:45:40 +0200 (CEST) Received: from smtpproxy21.qq.com (smtpbg701.qq.com [203.205.195.86]) by mails.dpdk.org (Postfix) with ESMTP id 9CA3641151 for ; Wed, 13 Oct 2021 04:45:37 +0200 (CEST) X-QQ-mid: bizesmtp45t1634093130t7s8dye6 Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Wed, 13 Oct 2021 10:45:29 +0800 (CST) X-QQ-SSF: 01400000000000E0H000B00A0000000 X-QQ-FEAT: rn/rQ7Qm5gX6RtmIgCwN1g/tFcceV8IIdosbXaZbsV8Lrw7AiNwT9GMfJqpuL 8IhItQTocNx0tob2FY4Qf80wtHoi04JfCoNmF0xJkzLvXLhbGL+PKAUWtbDYYzYo1zBeeFx FCM7fCGDZVk75Y7Eo4ZqMWVb+pJlO9eFzJDxWk5GrmXd7dQDE6yyEpZXWEFGqK84NnQVtBV lD6Y00j6CzsJgVrGfYAQX15lHiCBYQSgb+P0AdXN8IwygN8xwQGUJjLm+eyQ2fFc6BghsGj EFpKjzw7hoV242OpKMUrrWPT8e4STPIPadPn/s+f/I/3WDwjQr0VG+qQ/mnxYMRq4A0w5q9 RGq4mXWKxYvSOxi1CcwwzjcTfZemg== X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Date: Wed, 13 Oct 2021 10:45:20 +0800 Message-Id: <20211013024521.20520-3-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211013024521.20520-1-jiawenwu@trustnetic.com> References: <20211013024521.20520-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH 2/3] net/txgbe: set fixed flag for exact link speed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Setting exact link speed makes sense if auto-negotiation is disabled. Fixed flag is required to disable auto-negotiation. Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index ab972a3a35..dc822d69f7 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -1634,17 +1634,6 @@ txgbe_dev_start(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); - /* TXGBE devices don't support: - * - half duplex (checked afterwards for valid speeds) - * - fixed speed: TODO implement - */ - if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, - "Invalid link_speeds for port %u, fix speed not supported", - dev->data->port_id); - return -EINVAL; - } - /* Stop the link setup handler before resetting the HW. */ rte_eal_alarm_cancel(txgbe_dev_setup_link_alarm_handler, dev); @@ -1778,7 +1767,7 @@ txgbe_dev_start(struct rte_eth_dev *dev) ETH_LINK_SPEED_10G; link_speeds = &dev->data->dev_conf.link_speeds; - if (*link_speeds & ~allowed_speeds) { + if (((*link_speeds) >> 1) & ~(allowed_speeds >> 1)) { PMD_INIT_LOG(ERR, "Invalid link setting"); goto error; } @@ -2709,7 +2698,8 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev, link.link_status = ETH_LINK_DOWN; link.link_speed = ETH_SPEED_NUM_NONE; link.link_duplex = ETH_LINK_HALF_DUPLEX; - link.link_autoneg = ETH_LINK_AUTONEG; + link.link_autoneg = !(dev->data->dev_conf.link_speeds & + ETH_LINK_SPEED_FIXED); hw->mac.get_link_status = true; -- 2.21.0.windows.1