From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0079.outbound.protection.outlook.com [104.47.33.79]) by dpdk.org (Postfix) with ESMTP id 968541B261 for ; Sat, 9 Sep 2017 13:11:28 +0200 (CEST) Received: from DM5PR03CA0058.namprd03.prod.outlook.com (10.174.189.175) by CY4PR03MB3318.namprd03.prod.outlook.com (10.171.246.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Sat, 9 Sep 2017 11:11:26 +0000 Received: from BN1BFFO11FD021.protection.gbl (2a01:111:f400:7c10::1:184) by DM5PR03CA0058.outlook.office365.com (2603:10b6:4:3b::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Sat, 9 Sep 2017 11:11:26 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD021.mail.protection.outlook.com (10.58.144.84) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Sat, 9 Sep 2017 11:11:25 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v89BAUhS026326; Sat, 9 Sep 2017 04:11:22 -0700 From: Shreyansh Jain To: CC: , Date: Sat, 9 Sep 2017 16:51:19 +0530 Message-ID: <20170909112132.13936-29-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170909112132.13936-1-shreyansh.jain@nxp.com> References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131494290866232789; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(498600001)(356003)(76176999)(15650500001)(50986999)(104016004)(105606002)(106466001)(47776003)(77096006)(33646002)(2351001)(2950100002)(110136004)(6666003)(6916009)(8656003)(4326008)(5660300001)(305945005)(1076002)(97736004)(53936002)(85426001)(86362001)(575784001)(189998001)(5003940100001)(50226002)(8936002)(36756003)(48376002)(68736007)(8676002)(50466002)(54906002)(81166006)(81156014)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3318; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD021; 1:4TZZWG0Clur3ZUNIo0YOxz5XAEJqHRBvxO0Fep2pLgAdQngr3c6yasCuGSOOosSDG0RFmnuVGroB7gLKcKyhATya1cqLkZ7PJvsF6E7eec+1On5KJEQ6HsMFgo76vrhX MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d495ccc5-03a1-4158-ddd5-08d4f7738389 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3318; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3318; 3:zC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/mAXYwfVNSwDz0HlCbRILyf7PmBf6unyek5YPIu6AuCGLTvFOhgKxTFV5p6ZCadyVX7z85xyAmVyPxaIE2H51cBX+jyzZM53dp3Je4uAXfhzuD0H7KizWh9/knL3mAgIkUDrVQjYahX2KvCWxDnWcgwvw0t/aYbs/aeyz5vww6AlFlKQ/2xk7mpXN1nIEKo3ZYMtuNp0Sa6uJEDHWxmTDfy6ikyfU8+9e/nuu8QoAemVA= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123565025)(20161123559100)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3318; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3318; X-Forefront-PRVS: 0425A67DEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3318; 23:kK8aj46jWCHrlyrL2TyZFemBLGTi2afD0NlsVJoIM?= =?us-ascii?Q?nan1FkmcgQNE0LvWcjkVhz2kZl9HHs5OWz6Tl7Hf71++8Z/NvKu32J1OjfaD?= =?us-ascii?Q?9eIHnfU7s5P8BDKwbJdQYt/qokB3IlyDVgy8kKLn1iKYCKLWQUEd09M9kJUu?= =?us-ascii?Q?uU57l5griVrW/QJz0DzpDWDrFaWk01oYBem91UhLsu7pfmo+dNEFiTCT8O+L?= =?us-ascii?Q?AG1d9mKSgeW7+lzxqTxyAwiQ1qaNLVyeNIvkdb9DPm63ID0yatIDVV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j/PkGjdU6kXeC4ZB6InEkrzCQ2re9eKoeADM5xipUrNr?= =?us-ascii?Q?CopmM1Tet05JeQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3318; 6:BJB/QhwlbTrWDVTx/Nrvxc0QS1gbfnsTIlzeUIfCFMe+P5bjb5d47f65PBlqqSGY+EA1nwV3FEoDBp8VM2O2IIf8J/qYxn6ePY1qytTkD2U71vm52v7mcalVooiQC4X+CkSIhaMS0rBzhucdCN0+voa2Of+fnOuJhNWlG2LjaFjrGiyhS9OhMmBdiqPBIXHPGMGI725DM7xHHvKBNiMmc7sprPbZa06qlrTfZ9qXH8+ij1SqS/THsNWRIWcQAJHFLfkChfeUZ+hPFwx7KOR1c1JR3uxeISaDu2+oeGnfKQI7J3RuaftOg819IRqrHnMlW1RVGDTQtEbA9rAY0LAMpw==; 5:NfsN+h5h7R8gKPJiqBP55hH5dspf+813MywpGh2+0sCLqsflstgZ3KrrcNfU62Fel2qnXz/WBPMck1d9Zw5AE0hKJoIEwlZOz5oPDCiiwGEpT/XggeTGJZDQ6df067RTRDxkeg7ktqIse54PtP1qNA==; 24:4L85vVdN9CtwS8plsIhK9Ey6EKwU7q58t2GeTBZgYR/1wcakRNVpLsWcg24VWC4hGF5qz4SxnRH4qILylrnkDpnWaYEblr3awDru61v4caM=; 7:oyPC1BmuBY2Koj3KLDg0mfv39JCFWio30PKKQOCN0zqYIGRUKJHi4V9hxi2IiJmCJ50JVjN5FuWcqVanmIRszsOervaQYjuwV+p9yX5rWmPNj+z2EnOKVOS8FAW4dCToTXyZpdDqJ9taWxPv+BhKKlERIs+HbHI8ieK8vk8hOtyHg9yvchQbAE4WqHn3olDMwwpiOK4CsMxTBoN6248hfsgKNyvd3oOFXi8P1E5epco= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2017 11:11:25.4220 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3318 Subject: [dpdk-dev] [PATCH v4 28/41] net/dpaa: add support for 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: Sat, 09 Sep 2017 11:11:29 -0000 Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index e62812c..132f94b 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y Jumbo frame = Y MTU update = Y ARMv8 = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d0bab36..75fded2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -142,6 +142,28 @@ static void dpaa_eth_dev_close(struct rte_eth_dev *dev) dpaa_eth_dev_stop(dev); } +static int dpaa_eth_link_update(struct rte_eth_dev *dev, + int wait_to_complete __rte_unused) +{ + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct rte_eth_link *link = &dev->data->dev_link; + + PMD_INIT_FUNC_TRACE(); + + if (dpaa_intf->fif->mac_type == fman_mac_1g) + link->link_speed = 1000; + else if (dpaa_intf->fif->mac_type == fman_mac_10g) + link->link_speed = 10000; + else + DPAA_PMD_ERR("invalid link_speed: %s, %d", + dpaa_intf->name, dpaa_intf->fif->mac_type); + + link->link_status = dpaa_intf->valid; + link->link_duplex = ETH_LINK_FULL_DUPLEX; + link->link_autoneg = ETH_LINK_AUTONEG; + return 0; +} + static int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc __rte_unused, @@ -216,6 +238,22 @@ static void dpaa_eth_tx_queue_release(void *txq __rte_unused) PMD_INIT_FUNC_TRACE(); } +static int dpaa_link_down(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + + dpaa_eth_dev_stop(dev); + return 0; +} + +static int dpaa_link_up(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + + dpaa_eth_dev_start(dev); + return 0; +} + static struct eth_dev_ops dpaa_devops = { .dev_configure = dpaa_eth_dev_configure, .dev_start = dpaa_eth_dev_start, @@ -226,7 +264,11 @@ static struct eth_dev_ops dpaa_devops = { .tx_queue_setup = dpaa_eth_tx_queue_setup, .rx_queue_release = dpaa_eth_rx_queue_release, .tx_queue_release = dpaa_eth_tx_queue_release, + + .link_update = dpaa_eth_link_update, .mtu_set = dpaa_mtu_set, + .dev_set_link_down = dpaa_link_down, + .dev_set_link_up = dpaa_link_up, }; /* Initialise an Rx FQ */ -- 2.9.3