From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0075.outbound.protection.outlook.com [104.47.34.75]) by dpdk.org (Postfix) with ESMTP id 6AEBD12001 for ; Fri, 9 Mar 2018 09:43:20 +0100 (CET) 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=u1J2lKy9FwH5MIHA78dmBsY5urBsvtJNB4QxrA6/yJk=; b=lSkyr5hn4hNDC8ikJ1HdvGx+Ub8FkDSujlaXL3jHRaFfZa4DGrunMlmbQXT6ctvFBV7H2ncz7inw48i9X5Ra02nH86z38RVFF7jkQSYBF82GHQuOOZGqE4HbbynxfvmBVbzgXAAwA0fLXWRZwRJULV/92wiz8y9TMQcvbdpOSwI= Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.12; Fri, 9 Mar 2018 08:43:18 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 9 Mar 2018 03:42:28 -0500 Message-Id: <1520584954-130575-12-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> <1520584954-130575-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: BM1PR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::19) To MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e5b59222-2880-4d30-5d96-08d58599cf42 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1517; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 3:IaWwm46dcaJHr0+LsdZjSHnrrHpV9zfYIvIqh9bhlh2UQ2rOT0TbtI4zFGvFGCjbJjuI23LQLH2MHtpjcH0u3i6MDun/UB/5dWkLBpEDTb0/h4DBFx8S6HN0VexQqHL/Md+XIkyb0Qmqp9whyDNPToRmizAM7nCmJXvSQ8qf6XwwiolynFFrxB/wkzsT3536cNpVBARCLkdEKJIIBY30ndRuEGQHUWPNfbZE7Hke+dQeT/eL4pis9Rbe84G9CSol; 25:ASXly3WBJVdzHrbTMzwjrZ9Ln9WyUhH1UMjzhL+RCEP1Z7KDHZrLe07IU68U4cPKoljoH6OQPiWUPfQLvrdl4FSHKns0Nv4B26h7fz8EplBefaOuqw0lz1S+xbzsLhR92O5FPoFsJ2C1TMPj7ObyTDNi8AVsdZ/codH9p+/H6kSDrNKjL5XDZFrcw7C/9UurV8Hs/xphsbW5eBeKxpqQqrebe6W0+3nXqi9IInYeaKm/fm6twJcpkzvz7vRqAta5kobwXG2RfPhKStvfKHcUkDTeE3VMDWAfIlPrEBqlAbaw4U4Mm5xknnJcRKusvB+0nqXGfH6HGh0ZjxqJgHJlGA==; 31:AJt9fKqkAYOyjC98jc82ZYDLsNraZ6V7scy/wO5gO+Ir5z9Cofy/v9uQH0x7wdrPtdGRiModKqlcMcPZaUs9UKtDJAdxt6CMdqr6KMt+sBn2PLmnZSRPl2yCECpA/r4XCesT9xFMZ9tPyuklp8eWIZZ2THEIVSkF6bfURgI4pxtlfDGU0TtIz8/Jpjh3R9oTs9cKvJMlNbi3TtFkIqdO/MeFhj971sSxuhuLXOA8hJ4= X-MS-TrafficTypeDiagnostic: MWHPR12MB1517: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:keVP0HdWfEvTB72NAD1muJPeFUfNKoO4YLxL4NHnNH76nxcxMebmuEnBxLslk/9Q1koSBe0AbvlRX572Ol7RH9M8x9l8oRZ4EIlzv50V8d7aks5gxoLq3JmnHcQJEoWPWkpH0Q3lBXCMfbOEgLsiCmGEQ5p08n5ZtknTFMBasm4NCRMGAfL2STQJrIapQZpuULws0TQAYQ0RwG7mbat2swHugi6xXJthBkxXLVTkNl67W1pTCRHc9ZGDX5P/zutj81qx8FlFwf0So33s6+ntBEcE+81JHaxfemRbXMNKk9trRB9ICq5i7OQa8heFMHzCHQjlmFd3FqZQdpkvcdWbLghddUorDFgTk7YjCGxIyhCpl9NfVcL3kIq7L65Z1h4vpiOwf0M4gc0Xyv2Ewdsuau2beY/kCE1v2TAjpBMIcjd1R5Ssa3f+SZQ+3UzbZ9v/ZpMEd3E0FINB83HVbwT81vOb3XE2HB4yD2JGxSJ26DBFr6EpcMPWrYthRCQEtlEe; 4:bwPlhOIiO5/MiR4xANEMGGxkN+lmz49YbEwecVBu6bx9KNhuyGac/vkzWK3rVlTpkvqxZW4zPOz7HPFTgWqyqK5ig2wpKWBXFHarMp85XUwgeqbtMvG0R9/1l0o5w2OucSfrGUwpSQzpuvwLea+ux2ZnHKFFz0i9TX/+j/K5PJte6ukrMgGZCe9AULo6H2vatK5UyXVHypd+EOhNXjoTLiy4RtzlENN/lvjiH2LUdW2W8D3a478b1meSNLnd6zK4TWL1Ys/Qo0+VcMDAy4zB4457kMwRKHkbfT/iC4UXKHTWpExWB8eInOrQdfk15zq0 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)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR12MB1517; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1517; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(396003)(39860400002)(366004)(376002)(199004)(189003)(305945005)(50226002)(386003)(6346003)(26005)(36756003)(97736004)(25786009)(7736002)(50466002)(8936002)(4326008)(16586007)(86362001)(81156014)(81166006)(6666003)(2950100002)(6916009)(16526019)(186003)(5660300001)(59450400001)(316002)(8676002)(76176011)(52116002)(51416003)(7696005)(53416004)(48376002)(478600001)(106356001)(6116002)(3846002)(68736007)(2351001)(2906002)(6486002)(66066001)(47776003)(105586002)(72206003)(53936002)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1517; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1517; 23:D9YwUwzg+k07bCI6VH1VihyB8QbOR/iW6Tam3Kp43?= =?us-ascii?Q?cZXEoi1xrq0OnMGlzrh45rHGnlCqZlNAuLTLEuSjxKT3wLzn2/Z/MHGHLivt?= =?us-ascii?Q?aCjPgmj0BaH4UWnFcLp6x5uTdpi+p76oe99OrTrAQTiRhLe1AcEsbGJua8dA?= =?us-ascii?Q?tyIExciMgdUThMB0IyFACR106Dst2Ra1OxFI9cdJOLYxji5d5Ja7++oWRkAG?= =?us-ascii?Q?bd4T/N5mz4PHjnu6eeveKQqXjV8myuT6ZlB9dJm1uMGyKVxS9CTseGpPJhxE?= =?us-ascii?Q?HKkYRlWbG+FQtRr21ykXGhXDl2EIV1aiinsr4jhvdvK2acndAUL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OJr+t/YIosrO5jnmYvgRcQPMVWAvrnBkNVH+5iEx8suUSecc70MFCQh/wSz+VlX2JXRnE+OjEXW6dUDkRD+Y31dHCOwQjHr5TjZLPe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:vT+tP0zOi+sShI2+3Ml+u+HuSPPUnUFPg38QxfCQr1ytqBZ9bRXFdQMAAhSb9qg6/cOCh1TLvNSnEML6cAKh2H0PRfWHnKwFgZbxdnHUb+4wXMXbuR1WtE69OTkiG4oESCyFjqXk3ueRU9zbCx8ufr1Hd4qFvxG0gtzgoxlzzrYWPyHECfNtok8Q0DaT8gY9XXcp6cE4hDGIXXOJN+BEh7Lq/HuKS58SOfGhZZyzQqXUxAj8LzkpDXMkCxpVlt2X X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:43:18.6516 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5b59222-2880-4d30-5d96-08d58599cf42 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1517 Subject: [dpdk-dev] [PATCH v3 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, 09 Mar 2018 08:43:21 -0000 Signed-off-by: Ravi Kumar --- doc/guides/nics/features/axgbe.ini | 1 + drivers/net/axgbe/axgbe_ethdev.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 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 ae78e09..ebae6cc 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -137,6 +137,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); @@ -193,6 +195,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, @@ -338,6 +341,36 @@ 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) +{ + PMD_INIT_FUNC_TRACE(); + rte_delay_ms(800); + + struct axgbe_port *pdata = dev->data->dev_private; + int old_link_status = dev->data->dev_link.link_status; + + pdata->phy_if.phy_status(pdata); + + dev->data->dev_link.link_speed = pdata->phy_speed; + switch (pdata->phy.duplex) { + case DUPLEX_FULL: + dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX; + break; + case DUPLEX_HALF: + dev->data->dev_link.link_duplex = ETH_LINK_HALF_DUPLEX; + break; + } + dev->data->dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds & + ETH_LINK_SPEED_FIXED); + dev->data->dev_link.link_status = pdata->phy_link; + + return old_link_status == dev->data->dev_link.link_status ? -1 : 0; +} + + static void axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) -- 2.7.4