From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0089.outbound.protection.outlook.com [104.47.34.89]) by dpdk.org (Postfix) with ESMTP id B54CE1B16A for ; Fri, 5 Jan 2018 10:53:11 +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=tZf96NeTikZjlgmhXRT9qmI2Nb3Bmd4KV/iaBIiF6bukI32fubVE33roAcBiEF9uRdcSnEmsEV0bIDQ7OQuO68DCwZt0A52T17x4idrWmieaVZTe9Q1EX2+djVKfzMIRTKVaXaRaixWt/TbrdeDWBHczoSKWNtBPt9bEL6lyz9k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:53:08 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 5 Jan 2018 04:52:14 -0500 Message-Id: <1515145938-97474-12-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> <1515145938-97474-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.221.17) To BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e6c846f3-5dcd-4adb-37f6-08d5542220db X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1506; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 3:GmdubaqJxnrFqVKZcVWCdR16gQDpW3C2c1FUzmAyHtH5inFh7BAe99Sy3B0AHxgyKTeQ/+hUWuH1VE+MgwCBsnHTaUsTglqor/geqC+fqIY8vtFjF08fjsqzexVKabMan/Pgg1+AxseGRoVZmHHcic7N76Wb3vH4UFP/FVVTioUeIrLQSXmeYzZ03HrR5P+Byljq2qZzafzdVKaIGIMfio12DDkkt93QFE2HC0210VbPQyqQcC2F7HhNuq5PjsHt; 25:LnaWbL5Ao4HaySI7vnVr0hYhqiD7m5d8uGwCWlGL8FIzkZqhlnu1UvBDZ+RWRZg9ZdT5DtUAlm5YeeIUvG/gIfgCMU0DDgiEIFPoPQOWRQsIIBzZuaKRgXwP5UFtpk/X9yUrZJCSa9T9qPasz3/csDWZUdROSjft9in7rFMemcbB3UC3xIiOSpfBGYu9jSzIOcyKjpPkGcfXIJw/NoRMU7xfFHv8NUmHNRiG7qVtWSGdXLO923EY/P1f3OphWfqoeKRxWxztuQSEyjz+vokJXo9TU/UONTLsfHjmzF0eLqiCLw6bDhsAimrc8WzBVFsGc7CC/wytvoRiC5DoSIZJzQ==; 31:gk8LHudrL1pG+S56A40KuzwiGweR7M9xFL3gydSW3qB7PUHhYKxwQ0rzExQnFesveBc/CVTbMoWyvzXBk5rOehmizmX9UaJeoxkqcyq/p7EOJCJNOK4VuNBD7cxO2EjXZh3DfRv5+G+W0xsU2xeAj3CfNqAJyyphxLREVooQNb9Cyz3SQX8R0fWn/SAY6dvlbYpgxXXuppt4O6SuN2XoBnwD2hrdnoGsEZAec9S9aIY= X-MS-TrafficTypeDiagnostic: BN6PR12MB1506: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:PHd1efjwI5asty5feuMaUgqS/Fc6nqa23JCe1Ir8Py8K2EHWNLBhcrYHFm0KVEtGdgN82/pr9vl/LAJqMkkvmOZpB42VmDQAcuQyHjCYvnnwZnQ5yfhBv6pRd+FzQwG4FQtkau4/XW57w+JPAB5P9AgpM+9wKUqvVTDnEj3xRbtoDLzZXpdl/V9WWQtd0JOYqqabvw2nBfqDRpeN6xoXATBjb0R+pHApRnTmdCijJnrNKIWO63qrGUtaTMh6NTDXRkp1NU8fuXsXrK5FtY1IP7lmFNaPo9ifst1gx1/mvTeWLoTNp/eq2/q4OGQYugeLiQ4FWls/Aca3mOHus5FmXYA+pGnLjc/XExC+aHt38R7rOYCJGLrGYUOlrKPOVhjAf3ZaPhzWKabNfswTS/iw4aHnNnkexbcfl4X9tAXtS1W/4EPIPoWam72r5YwgZ8yYTpis2DbrCLMkbBZntKc26+zYfcAC2E91nLTUAHCWOZZarszNI9687qw019J2EYEC; 4:QUaRZwp9znMeee406gSVrB1onVqf+tzVelmOywWN+5vjuffxOU+Q3DAHgqUTlMqJ/5i/whSGBFVtP+F5Fuc9+CPWJGrNp7fnnhER9kpOa8pfY3GvkPCF4KNg9R5VdH8Z17TDRaPDC2dhPZ+sgPaLbNzwVrQVPZ4rZdBJdf78gf9LpbRUowlmJsc96X9OpXkELcugbgXRSTJyrDNIPrFas6qNlyJYQTx0WAkgWB84QsnLAz803tTsxb8Yz20I6IdePmEAfkzkVXrcaYgO+I9Sq4yupLEJh+XiX6x2+dXjha7o+a2Qn0JDqib/rjIfcbXZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1506; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1506; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(199004)(189003)(105586002)(4326008)(53936002)(36756003)(68736007)(50226002)(7696005)(8676002)(51416003)(52116002)(25786009)(3846002)(106356001)(8936002)(2906002)(53416004)(6116002)(81156014)(2361001)(6486002)(81166006)(47776003)(97736004)(16586007)(316002)(66066001)(305945005)(48376002)(2351001)(478600001)(7736002)(16526018)(6916009)(2950100002)(6666003)(86362001)(59450400001)(76176011)(50466002)(386003)(5660300001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1506; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1506; 23:y0AhkovsWh5JvYb/TtCdSLzmfxILMg06lQPdzZw9y?= =?us-ascii?Q?4g9Ly+mfKCecSEu7BSqtt0wP/1HWOCMcvBViDEmuY/MZL4B7bt2DRX46nq7L?= =?us-ascii?Q?8eLAKGv72KXjhFps/Uh9ckJvfgB5wXq06EAe6L/OZ2pd1Yw1vMEeVVK44CXR?= =?us-ascii?Q?EydZKAWcNbNOoPVg242XGD8a5QhcpdNafLMoak4COJWoJlzuf/oXAQ5E5roE?= =?us-ascii?Q?Jtet6KpOS4ma+4HYtIwR6KuNdv2DFQuIYiBfU1Xmss79SgYEnvyC7JUsMecL?= =?us-ascii?Q?Bvh0daysMjU1CN4M/gHzIEv2PLmdSSta5nTxGVV5coF2lRflz5TqKua95T9/?= =?us-ascii?Q?nDNayEAeXric9OSDL7ugppHEAhUjVq2timTNpISpA2T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CIXd3dLqxrmRI4u+Lh2yA9Kyd+Q3z3Fkp8j+aCiKJtVakWpOgal1sThI10olXrn5U92ejr8a8JPyYszEzaqv4vM0c4pgyzA/hKDJB4QhmP79H6MdLC3eYRZUJL3rjiZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:53:08.8558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6c846f3-5dcd-4adb-37f6-08d5542220db X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1506 Subject: [dpdk-dev] [PATCH v2 12/16] 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, 05 Jan 2018 09:53:12 -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