From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42]) by dpdk.org (Postfix) with ESMTP id 9C3E51CFE2 for ; Fri, 6 Apr 2018 14:37:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9/aL67w4t29r2QV+ljUBEbnMYmWq+RBXDCN2evoIvgw=; b=Kk/bNIb5xHeTvxQZyjU6DOpCYzdUGBv4NfotM4K2Y35pMXFPIydebhlLG9+kGjJzCQH2xlwtrAEjPtn6TyEjBZkIsjhf7j6aqnGnaJW6f8SzXb7Cc4PWHixo8jLxpKFoVICg+fmD3SXeHleroxyisebis+z/1+vbleFGpA3RNq0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 12:37:30 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 6 Apr 2018 08:36:45 -0400 Message-Id: <1523018211-65765-12-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> References: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b051d43e-4190-4c8f-1c28-08d59bbb2a3c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:OsT6zDHIN1lsdAyhSbdjpBPX6KpoSgHLH3AImxq4yKpT9j7LHUueY/JOrhXHXQoeq1T2/a2yrYnI6g765hEZpA6nsfoDafyIDTUeh+Cmh9k6O2ZqZmkCGVyS27l3eDzBPOYhiLn3cB/yIzw1w92OoFrB4OLeCFV/ysUn//wFVZIL5OoP9lBmZl65BcI/lO748AtsxdVRVJsP7XMnX3o6O9M8+HIzjJFGVjKH7nMjY/4w7A4f64TrmyHEe2ftUBNY; 25:VrciKnVyQLvkj7wqoNX1ipkCNviMy2MZ4AmmfzGauQR5PhqEhCIsixuccEvgEHZmld4a8gwpQXdCO99CY82PPAan0b2VS7Rh7btac6KejE05J7fbshI/c5zHtB5nn30GnFZHdAJtco4QAeJzEAGKzxKQVAAHD40VF9J8Yl1glqkx76Zcz22L2MXzLiJ4kS+ZaH3iF/yzmreAMFWMeBEsBAR23D+6MCYwE5UkcHx+E7TbTnZ9rFgdj5MaTW2vW4rdziPv1ee3LmyYhIxZDKrxzZZaXF3JneuwmQa5dWhWLpZ8suPzU7SKZNKxYv2Ylci4eVD2nIRe+EH7FiPpqWoB3A==; 31:AnqHGJXZUEPY6kfLb8K1EqkfLZ0XoDn454wR/J4UusitG3xuMY4ZVnHyJofNJQe13Fm+sTr9P7UJWrzCXIW+TRJfm/8gS03+WtJWfSiMSrq5vaymGWxgHRMwXDr4pAC5NK99ysO0YnpLg+ndocdFsUm1NeOPX0fQh03QJBNCYghW8xyvSKvKWbbxi6ggLXe99JuCC8PU8vUfokAvdWry4SZrJ1uU8k9IDw2er93DPXs= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:nHyFqeYuLTIoY/hBAWydbhNf2R5r64noTKSAVzvZM+lmx4djl+GI7ZMItSydwQxsJa+ojEN3vG0w1slU64gyjmgIjVGrgJmmDWL/rozkdfpuKoOZ42A8ix6TzcUAn10eciCAoHrpHGQL/swLZuFArW6iZfbImlNRhhz1b9lg1UKGL2xqxRlBT4Vltl5ruIlkApdIfc6SY1nouclZarKwn68DnDQd2mzwdNK/5l5tTq+h13Of9Y7JrfsMR3+ypuEimEfiCi9Qgql0ZaAUuT98rDkP3X3TTNm8b5w2psExt5cTqfD7OboA4eVfpyvd3iQ6kDLox5HFvbRTahhUa0kCqKMd0Bf/1yPWWR+jXOLZYj8meffVrWZRhYowSyZt1rGjzghmWDdczXdHCQcmJxxQ2hGnF2EjXpuhEKxbyLqB/gpvJsFLTiAoTUhEYY39pyyRGW0rK4JLAaujzE1nAZ07Z8hz7ytUNpz0Ge+Rb7lmaMCCH0n+5vhlpTpqyPradoTq; 4:0ElfVwsWqoABCr8Q+Ngi3OeGtBm7/oEx4uSirEOtJxN3ti5rM78PdeBaL0KNblHhrTbrI6PTGq+Tn9ZZajeEwNAviKYOZ9g0YIFfstgXgY5npA48pZcwqv53gr6ia6gv/QvgmQvaTR1jrHZvVS45W0u+wV64URGy4Xu3xpIQBdPK0VI82JBT8TWXF21aao9LihIqsfzgA+kldJcw9cn1Rj9a990V/Pm9xhxCVHvPYA1YOTdgoUuC5LhekjTLd87d7G9udpAOgApRQHEnxBp5AmtEoYC55dmW6vaKQWq7JPh5DvYHOhLyEWmAcUDbsow7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(366004)(376002)(199004)(189003)(48376002)(72206003)(7696005)(105586002)(478600001)(6116002)(50466002)(3846002)(446003)(486006)(53936002)(11346002)(68736007)(2906002)(2616005)(51416003)(386003)(16526019)(186003)(26005)(76176011)(956004)(50226002)(16586007)(476003)(316002)(97736004)(305945005)(2351001)(2361001)(25786009)(7736002)(36756003)(59450400001)(5660300001)(52116002)(8676002)(6916009)(6666003)(47776003)(4326008)(6486002)(15650500001)(86362001)(53416004)(8936002)(66066001)(81166006)(81156014)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1509; 23:d95kud+kKYsC/HE8NA321tvvovCfPhbMNb2JXYzx8?= =?us-ascii?Q?i6rswEE8x3IqmeKnFTv5Idh0ECaPzxDivpXtiWZ8gXSscxt6lNPOEme3ueMv?= =?us-ascii?Q?jg6AmIqu7whChhl7B0SqWeWR8OtoqABwLbG+/2Ep9gv49TT+dk4E+G8NXcGE?= =?us-ascii?Q?Na2Nrz3n22lv8nPxK0vngTURnCLV/ZLANEGq30xWCDXyU3IU1H9D1Ff2y2Wf?= =?us-ascii?Q?IzjyAiJIA0ak3ea+WOaRr/s9QBHPPj+rqZeQJQvSHWMiIV8rILebRw8/pPlJ?= =?us-ascii?Q?M6o+pfmZyapek2ULNEtVKd9313i+t4CTlQ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oAlAxnk2FkYkHmD0cHVGs9PotZmHg/4YqrdmcKU+TBDvqfORKlwaFW49Zbf9jXRGwZDPMfJ/ps= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 7:V7iOqoktaHyzUTcAYvcNIZCff5aXuWRHt3QX16MhzgqPcIJ228jQPZGoa3U/Yt1gj9S7kedocQS8sUHBEg67Bq073MVmef+RvyPEYGJT3odpqf+zSWqRtRQrM/UFae0E590KgYXg/6pq6esd0gxhJqskA+dvNxLHJAN8/a5yEfizXDhS8bAgYrU2LdTZo4pEG2UqaZ1vUJuM5mTB3lTn1njNB9zXopowvtekiNjrUpv+lEvmxadTzr+KFuZvhT7Z; 20:hWUXgnIxV8BK5l6n9uaRnzXpIpu5ko76hAwkI2QKXo8uhuJy/o5WIYv0/GByE/N/18H+e1BR2Nv3JG4Yuwu4/B34Tl+bNyB27rzqa+yCPFnnYx3HUMSaD9KOlslNXBLspk0BcKEbh1iBTWTo1izVpGmTn8pLUTSui1qmWvwCiy3sVSOROUlnH0AJMyvOcQ/z/YU6FqzNvn5Ix04ia7EHXvV/1Vzz5357GdlJ03hkyqr1TaTaqaub6q1H5XoPVkZ/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 12:37:30.3034 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b051d43e-4190-4c8f-1c28-08d59bbb2a3c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v5 12/18] net/axgbe: add link status update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 12:37:35 -0000 Added support to update device link status atomically. Signed-off-by: Ravi Kumar --- doc/guides/nics/features/axgbe.ini | 1 + drivers/net/axgbe/axgbe_ethdev.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/doc/guides/nics/features/axgbe.ini b/doc/guides/nics/features/axgbe.ini index f644128..2dbff18 100644 --- a/doc/guides/nics/features/axgbe.ini +++ b/doc/guides/nics/features/axgbe.ini @@ -5,6 +5,7 @@ ; [Features] Speed capabilities = Y +Link status = Y Jumbo frame = Y RSS hash = Y CRC offload = Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index a293058..3123572 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -15,6 +15,8 @@ static int axgbe_dev_start(struct rte_eth_dev *dev); static void axgbe_dev_stop(struct rte_eth_dev *dev); static void axgbe_dev_interrupt_handler(void *param); static void axgbe_dev_close(struct rte_eth_dev *dev); +static int axgbe_dev_link_update(struct rte_eth_dev *dev, + int wait_to_complete); static void axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); @@ -71,6 +73,7 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .dev_start = axgbe_dev_start, .dev_stop = axgbe_dev_stop, .dev_close = axgbe_dev_close, + .link_update = axgbe_dev_link_update, .dev_infos_get = axgbe_dev_info_get, .rx_queue_setup = axgbe_dev_rx_queue_setup, .rx_queue_release = axgbe_dev_rx_queue_release, @@ -216,6 +219,33 @@ axgbe_dev_close(struct rte_eth_dev *dev) axgbe_dev_clear_queues(dev); } +/* return 0 means link status changed, -1 means not changed */ +static int +axgbe_dev_link_update(struct rte_eth_dev *dev, + int wait_to_complete __rte_unused) +{ + struct axgbe_port *pdata = dev->data->dev_private; + struct rte_eth_link link; + int ret = 0; + + PMD_INIT_FUNC_TRACE(); + rte_delay_ms(800); + + pdata->phy_if.phy_status(pdata); + + memset(&link, 0 , sizeof(struct rte_eth_link)); + link.link_duplex = pdata->phy.duplex; + link.link_status = pdata->phy_link; + link.link_speed = pdata->phy_speed; + link.link_autoneg = !(dev->data->dev_conf.link_speeds & + ETH_LINK_SPEED_FIXED); + ret = rte_eth_linkstatus_set(dev, &link); + if (ret == -1) + PMD_DRV_LOG(ERR, "No change in link status\n"); + + return ret; +} + static void axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) -- 2.7.4