From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0045.outbound.protection.outlook.com [104.47.32.45]) by dpdk.org (Postfix) with ESMTP id 7C1888CF2 for ; Wed, 23 Aug 2017 16:03:24 +0200 (CEST) Received: from CY4PR03CA0007.namprd03.prod.outlook.com (10.168.162.17) by CY4PR03MB3320.namprd03.prod.outlook.com (10.171.247.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Wed, 23 Aug 2017 14:03:23 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::197) by CY4PR03CA0007.outlook.office365.com (2603:10b6:903:33::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Wed, 23 Aug 2017 14:03:22 +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 BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:03:22 +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 v7NE2Q3E004389; Wed, 23 Aug 2017 07:03:19 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:42:01 +0530 Message-ID: <20170823141213.25476-29-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479706025080615; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(86362001)(81166006)(36756003)(575784001)(8676002)(85426001)(305945005)(626005)(8936002)(2351001)(4326008)(6916009)(53936002)(77096006)(2950100002)(189998001)(6666003)(54906002)(110136004)(97736004)(50986999)(76176999)(498600001)(47776003)(48376002)(5660300001)(1076002)(8656003)(106466001)(15650500001)(50466002)(33646002)(356003)(68736007)(81156014)(5003940100001)(2906002)(104016004)(105606002)(50226002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3320; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:wIED0NXDfzK6HaDb6WnYm7aQwXpFeIOHhmJ5k7nVbIqdmOlJh75K1EWjSN/qvO22EA/FE/JjXXOcyv0dv2h/kovUUYxs3HIic2W7a8QvVzyOdPZgQJkVbA4mG8bqSOlT MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e5d6ea7-587e-4fc1-d5c9-08d4ea2fb740 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3320; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 3:MP0ViAGbqBYvUJTbZNoPYu+eRIaQ7pBTAIi1ZJne5LbhDslnMpKfjZZ2XJzGqhal6v4v06MxEQEQli2SVaIO7mfHOHfEOdFD6U9cBOUobgEfg92xnonD7Ye1117zWwTb8iVyjUXZ2H15+MESZCIU2iydXxq4OEsOvK0nQFw03PXnwXXZva4lwZuiUti5iQRq/T459+eitd0pDQcNRK0kAv5CrzGhyIyYY3LaAhAmDFd7Kw3VQhawfY+Fof1XAs0CZEbEkJTgmtnflL97PxXFNCCM9glXGxw5MzCglxFFneCPhxcEBN8kkWcqf37WSmLpN3hzSnVtRcw0zpQisJjl9VL7qys0fT79ZerLAERYOPQ=; 25:5gXDmRNi9inWmkoKR30K0jrm6rcn+YEGz5BPeetgttcxkwf8z3TalRIInw7vHcBIy48dLiKmgCQ+ZJbJxxNS6KsGFzs509G9b7dNZnbVqP8RMn32rh9bVC5ENWCxPU4uI1C9AHWgF9IhMIMRrT8r07rb2pUi101kFK/gUPtAhOMe57vqxwKvUKfdGxiO93FG5CKEiPwQpssEkRZDpwIMtlXLHgkjsydbFmHIn4GMrWl7VG2Yx9aqUaYuWN/HHt/h56Z9gIkurNnlW8j0aAu7hzM6BBJi/HNmqRIR6VgfJn8BiD5MGfTjxkokhB2HpXQRUDjsONUSivWFY9IKcV7zlg== X-MS-TrafficTypeDiagnostic: CY4PR03MB3320: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3320; 31:jkw42SkraMt52OkT1LdA7VP97mjPocUfrA7CXfddf0gaaSgcaIYoHwOaVJIQPpjRMKI3mIMRK2mh1tj2yICzLmkC7TBKe1oI3Bk/tiQAEr8DrPRWnRnx9IIiQcjLEmlhryG62CZCeIXs09ys6ms0hYPcS8aPAORXnrc3/PBhfB8VCmBolvSkHNquGBLDMzfEeC+YeoL8GltUsRaxBQgBrGH/FghWAcjp6FGvMLUyoyo=; 4:s7ogjvjX30Fi0SW9TErm9ekdAs6zy86utShisamu0l6EAL+GP0krnHW8I/GcN5efNdMVjGX2ANt1rMXT0SzDvgs4SdaDeh3PLutz0qE4xfISygU5N6uQPDSDuozCKdqDYQ0NEaGJLiVeZHSHqJxaI8xozVnEyuizs791X/NxR7RK54m9zmRaBNlc4KfIzp+/TxkcJKSAd6KkfV4Wa3ve2cODGkUUVQCqXejCtGKdPoEj7Uyxq0e0r8hnHIYqwASbWKTfUz/lUqw1Mal8Q3RFI7Rqy2D9Jr3LUgkDay8uxk8= 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)(601004)(2401047)(8121501046)(13018025)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3320; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3320; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB3320; 23:2cxpQc/cOh/zovttHVZ9xmpwsvf1KJ8Qt7zZiC8nZ?= =?us-ascii?Q?/aXXwJJLCeTQb/qnRZZxYB5y1uyNh5MQvk8FTfDz2nDvaKaGy4MuWEtZtK/H?= =?us-ascii?Q?TpfSSaR4vpoYpzlcEhLzfUxmqQv/fcqpVVWZK/yGQPtUNboQ+GOMdnZJjMDl?= =?us-ascii?Q?3FZnkd2HUZNyvMQhevwFClzg76LMbY+6c+XpFDS0Br64Q+jlEujYBQ1ZeqT0?= =?us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MuHqmR2TuLvX5oTpj5aj3HeV2POPDZPhH+kFPWQXWTKBkaI1wVSs4J0k5N9etCazB/UJrH0Ss7hp/ZegjMaqNi7s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:03:22.1492 (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: CY4PR03MB3320 Subject: [dpdk-dev] [PATCH v3 28/40] 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: Wed, 23 Aug 2017 14:03:25 -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