From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0054.outbound.protection.outlook.com [104.47.36.54]) by dpdk.org (Postfix) with ESMTP id ADF3D1C926 for ; Thu, 5 Apr 2018 08:40:29 +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=8hidYmDCRozJcrTUZnyN6YGaGT7ueumqMfbVwgAowEc=; b=Wg9sazE1Nk9ktRtgoZxdvx4Cxq3qj6ezpd8rMFr6YoxY6KY9VwmetPyKFeYgraTLwkyeEU7p6ja7UayolXh8f+LfJOBdHtSc8z9mu15CyVr/dgbOMumNLo+PwZ+G0Qrz3SsVgcBbFWF4CtEOdyTLSjTNQS7ZwT3A3mhMU3rZVbM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Thu, 5 Apr 2018 06:40:27 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 5 Apr 2018 02:39:44 -0400 Message-Id: <1522910389-35530-12-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> <1522910389-35530-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: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::26) To BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f61279f-f2b5-48a2-6e83-08d59ac01ef7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:xSs4CYbem/pcsEogNC1Xa5THpZjO/oiNZb+RNdt6nFfw89DHX+YuOZi0+jA+nLrPui3okybBTosajSMe49xM+aJAJzK+dNBLIqxMjokEQPFkyEKsbctGtcaYB1z9srFu+wAlS+FRkixk2eG7F59m8fLI1niv9EeC2SZ5iUJdtprBjpQOJV9gwT4bHDimmYFKYzvpeXNKlirQYSQqVAv1TQr5njOQ1c17BhKzcybWKJJDPpgFWfgb9O7Ke9dz2J7I; 25:Eoqo/XcWQbyNTbEKX9NcOrQrE+UI6pn0yh1ldcj9GoglNf2bFdSkTbSJERCSZqOEuQm+P4RQisj3qpUWQKcGNdPJepi6OEfB/RlHCr4qisWbxVvwTw+BfH5iRHnb9cchJUNS517Dp/G3jiAbqNn8rSMTYGL6ovYWsNn+HUa7OjJE59CrKGu4/tKsS+Lo9XJwLHfvyKZyYTkJ+e1iueFGwwJZ0AAICx90MNLrVt1iTb406w6LCHLnSOSTEkGeAGOZbsmgG7m6jGOZ9SyQTgLMHOeVUUH6Hpa9jrTYW4EK3PzhBLfzzTwjnmEyJKwy44KYZnGIRvqnQWWFug5HC0zGyA==; 31:MR0CYL4lhsiY73y9VpmazndCt+uGVX2XRgldqvlkuCkYB/bJx39WHqdKGbBhRTV/IYCO93xpp6RNjtQWRKq5Pwy6JLrFIgB3746MGEkMU8VfWeG9ynFY2KcfLuZZHDIWzSORdi76/J8hY2cRxIOraciCbFKJ92Njr/Ibb9OcpcQSW0Aa3zgN/uY9SmPQEAfVt1TQScLXkSmOcxL1EG49LqEgbDsu6IDAwRvrpQCe4Tw= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:G/h6ZQtDvhp61Vj4/47xhn7oRzVVJyI2P3BdIZUE+IpZTFh+34Yy2ZwO+bqbfpmOKqkZespLWZFy9UkYf/cySIqhk1f8XPC/UwV6m+zrm9PnWPholKAUW0UTvd16JHFUNVtc4HLR0riaymJQIrn/R/ub8XnTPEjAPbDIIgJIZky2XOwiPhuCdHVYdOIpQrzSCbCJ7SXt4jm6KgFqhpRsKpNyym3vS9PdJSz6fR46D6cRZF0mArUhpQo33eGEkXBkv/oELavySixtn/06jQwKLGY3LK7LDpS9Wzx6LpowmmQA1PUAafgJvZtqvOsjaYFYf7tJ9w0ZknRjR6n9mX8VgYjauqUDUjEGMz3VOLGH/o33FYkvJUiS4X2ThQ68gRwVrZym8Pd7R81jl27w8tfjDAHjqSdjXbJYcNnCZsBX1iMmNvSSv76C8mD3frG/AuJ2EAPm9NPUKbQpp9oobuohKdwLTLI2akamsoJs/XNvpf326Vniyrn9wbFSI9P7hNed; 4:PueZAbDMzfWLH+0l9Vl/DgGFOkER5Zx31WnXcFQVC9RJF36RQ6G5AoKYZBDD/aI9wIf8ypjmEPUSF7OJb2L1SsKv+WB7O85uJ0iTmB9OOeBpunewMvs1cY6J8FIh1y9FMn3h06U7reaoSNDT/ty5ar5ip5WWwuqgzthWweHXm4ZgBfRnMfCuCGayNNTapb/t2S7dGE9jhTKdRCUiqiEZSbAkOwyXdyOeNT61TxeHoDN1kYpk2QQE987LybS8czjrDtLBtqAeHZ6/OISB/5v08325ceAHD0IeKa9MAC1SxsxXUykkxnPYu27L3bkjx8R0 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)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39860400002)(39380400002)(199004)(189003)(3846002)(476003)(2616005)(316002)(446003)(956004)(305945005)(7736002)(478600001)(16586007)(16526019)(6486002)(186003)(76176011)(5660300001)(59450400001)(97736004)(2906002)(6116002)(486006)(386003)(26005)(50466002)(11346002)(25786009)(8936002)(86362001)(50226002)(66066001)(47776003)(48376002)(2351001)(6666003)(2361001)(6916009)(4326008)(81166006)(36756003)(53416004)(51416003)(68736007)(7696005)(15650500001)(8676002)(106356001)(105586002)(52116002)(81156014)(53936002)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1505; 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; BN6PR12MB1505; 23:X1Fvp7nDLKjFRzaQA5XAYJfilucLBV7CJI8hlv6k5?= =?us-ascii?Q?Va9N/yocwdwk4biYKgHKiKMo/JT4LAjea6xmb4fiMX+tW3W83nYRxb5sEldn?= =?us-ascii?Q?3sGr17ElA0R2dnezho6JJk2dBua/i+b9uu/qnrzj3UepF7jLKfFzEVuxxnUC?= =?us-ascii?Q?6f3zESCChG7Q06Dn2U+J99L19y/Vm6i6+4fvfZ5PyZYMDKUDZFJv088m818j?= =?us-ascii?Q?NAvzROpflzTZgK7BNiYUiTxSxsocoAcdLE6tcIYIYjMZLKTFgrZCwbNkxlPv?= =?us-ascii?Q?xKBKwFnHrg0/r4u1f2JP28Y41QWKW0Tlg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w5LIESrdAhA6glfPFkWGkVQQU0jgN805r+WWEubUNdWpg?= =?us-ascii?Q?v5fEVntNGBacURrL0ap9XbBzPevpMu6OlYWxPitpjrKBlfu+BilczIHh4yfB?= =?us-ascii?B?dz09?= X-Microsoft-Antispam-Message-Info: Qs2qki4Pi/HGfjqiHQURfs2Z/5UGxRYE1I506Hto58lLAyQq12d7GxI1y0sD0D/WoZLdZdDImNdRNqejSYekuaBbvdox8k9NEd4ZeoX76BPVRG3QJT3q5cjZO8tqkU3V1AVIK+Nfdp4n2U5BuYyBMev8yBXcrtyoVi2rEFyFEkyuwMYRZT5naX2hlXKWLGRQ X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 6:SltF5Zp3ciU46Cs72q3/HJA4hi2d7C2pSXSR8MtJQoblgbmPx5pj7DrzFL7hhXQ/M8so//sgkJUm4nnIqfr3P87X6MfIKDuWsrjt6ycC+9l8Vax103nFg7FGDCETF9XYs0vYPii+ZclSl2SSLDc5R+3izoDxEUqLF78f2NOwtCvXiE7F6dFY47VxzO7eT6gr0fUhk5N5/ls9fFTJqNayh7ufqMoVYnVMqAPZ0VbCk3ayLq2o/smF9qmS/XY2jvlsByKpE0+TwFuTX4jIZSqioNx2RR+IrvpAmvXrwx89o6pNYW5vpx2FkGemIEfEPxjMLAWfUrVnfGQmZSJxL/Gm487wL+TRBT4Lnb00zj3vPbRG0W9kHLyA93yuqjtSlpZBdw4DzsMg/AWBoQje2jNC73YoTDnX6K4vWxPmkKsezcMrsv01Pvr5bCTepyqZA76cazcWvq+6KTV6LwNF8KwVoA==; 5:MsSONrQjj3tHBSXnqVyXNHlNiNVn8NpcLbhJXAf26bp3XQAyxUTDeJIFD7MtmEthXLJcL8qFUFklZBVgjEa7MiYONQVk2X5f18pAv9fFpaea94Is/W57G6c6eD680GFXJx3Z03PILPjNORdc4BDg/9boCVD72pYe3/V/7/hw8gM=; 24:ROfnGaJPcdBg2prDxLMATB0Yb7JrnBgGrY7EZH+SVpYvGfnBZqkF30ge1ttIYICmer3/A0Bp9nQRV72kUcR7G5hWVKYs/0GpXmuj8QyNpuc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 7:a1UVT7AWidazRpdjaQUSrmCoSnXmG7teRDjXC1dzX7Rj1xthakaGWWYstdg6Y73eBKKxBG+Ms53uUx1iSndB39vrIdiq+rw9AWkSZpmHZZIiV5s+9LggqZhzAoMHC/cAtdwQIxNyzZWYALTM4GXnkTlxApe44dLgtaQMYyOuqY9kj/AfxtW9JP7lOFLAadzRxdYVLV+sAQHLSrKut1ACnJuA5jJ/agO5Ft4TVgxA+q11JqQriqhBtm194ZhcqOnq; 20:jA0iXur/dSF0l1iA64Ff20gY6M48PFVP4j+CfWIEUL/CpQitG2H6+xw/+33rNypjG2n+zjJZbATbrpP6ROB3v/r9Yei+7pBl+8u4OqjRhPBqoBOh0MylDEFgnB/TYjUccFSeZ+mJA/hheW2/vQPyzl7TQ94Bxt9BpmvohGxvyGMqxOcrL/Yes+M1o9fg5ZWV1DG4MqyYCgAHdAgPfjjSUmdm4edC9rGxgR0D85WwAr516bHjVCZQGV42DbfCwTYx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 06:40:27.7586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f61279f-f2b5-48a2-6e83-08d59ac01ef7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v4 12/17] 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: Thu, 05 Apr 2018 06:40:30 -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