From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0060.outbound.protection.outlook.com [104.47.34.60]) by dpdk.org (Postfix) with ESMTP id 8BD4D1B19B for ; Thu, 28 Sep 2017 14:20:03 +0200 (CEST) Received: from BN6PR03CA0073.namprd03.prod.outlook.com (2603:10b6:405:6f::11) by BN1PR0301MB0721.namprd03.prod.outlook.com (2a01:111:e400:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 12:20:00 +0000 Received: from BL2FFO11FD051.protection.gbl (2a01:111:f400:7c09::155) by BN6PR03CA0073.outlook.office365.com (2603:10b6:405:6f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 12:20:00 +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 BL2FFO11FD051.mail.protection.outlook.com (10.173.161.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 12:20:00 +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 v8SCJ72K008785; Thu, 28 Sep 2017 05:19:58 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:59:47 +0530 Message-ID: <20170928123000.1711-28-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928123000.1711-1-shreyansh.jain@nxp.com> References: <20170928113344.12248-1-shreyansh.jain@nxp.com> <20170928123000.1711-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510748008035938; (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)(7966004)(39860400002)(39380400002)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(15650500001)(356003)(189998001)(16586007)(5660300001)(36756003)(97736004)(316002)(106466001)(76176999)(54906003)(85426001)(105606002)(50986999)(33646002)(1076002)(2351001)(77096006)(305945005)(498600001)(50226002)(53936002)(4326008)(47776003)(2906002)(8656003)(86362001)(104016004)(8936002)(81156014)(81166006)(6666003)(50466002)(48376002)(2950100002)(8676002)(68736007)(5003940100001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0721; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD051; 1:8J1zO4QizaXKpgm5YQXuv8pgeU9ZroZzIYZwVUylhEtPzPjFRNfKIyuf6tZa7+gbX73iPfZDEfcUf57nP/TEv7W0421Ks3ehYOi2lTyU9Ttm8JGZnjs2HX5RCyJhV288 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ce8ffc9-cee8-4c9e-d503-08d5066b3d9e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN1PR0301MB0721; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0721; 3:Atb4G/yHZjv2jPHOQEw6b3QATbp9IqF8VFa5Df8OkHcE7lgy8LABpBC2TJu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lAqwbRvsbMrF2jWSd7vGXBR7J+XXcQybxqkA/IxGE+LCqUi2OmdO/FroNfOI8UdsA/1wVX+p0aISQpC8SX4nIkoN5mCm3lAan+2N2qrUUS3fh/nsl5CqVVb1hTgVJ6/iDLkckWBIr9/Frjcpe/GOP9ogjyK67y3XxrqZR4CQ6CsU6TRI1jMqGCxxYk8y62lpl3qXtPE= 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN1PR0301MB0721; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN1PR0301MB0721; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0721; 23:yQNdmIta6y1T3ZK8+42lGwLFoAVPAsIWzrgObGX?= =?us-ascii?Q?wPhVVDyvlDow7ymDBydgG9R28jdE2dmtPuj4w/ma6ntGz7JySIreHpXBMtzc?= =?us-ascii?Q?QXqT+rTd7iTNdTTmxO1czrTtMP+2Km1X8vfaG2cfX21ExRvpAqnT8BeI3R5Z?= =?us-ascii?Q?B6auxdgzBX6UvXYPsKaWp8vSlwXWbQ0du7GycktyiHyPunY6xOPeBxJC+H58?= =?us-ascii?Q?KedvZSqmVlATc9gsCOeepq4ZilgszoeKQI20LLuv8GU+vZKRcQ9zU2+uWvar?= =?us-ascii?Q?sohiM+PmvH+qoDrmWIjVd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ga1lBt5arODCDLXCCGXcO07r/OCR/mBgbM2bvPG+K7/GFT/NZBJTvnBA?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0721; 6:RVPJf8mt1mD86BoczXpaeEvpHLXztTCgiRtLoFV8TI3Ux8cvrzTOYN9GB3vnShYDdv7vCzDoXNz++CcXJI66kDYklLUUYHIT+Ipvh+/nGL6XnnnSAGI+cQV7AfPlkq07iPRNDcqHmIg7uBTuDJfinzhUdcvDRnFdkcejvJgKkUINK648io6WbZvGcmH6cat1wBwld4PK7tMp+cqiwMUU6VlFwIG4GlcXOeK6WMcMAqFgweAIDt5ISzbNoqRBbUzoa7Zet/s4AB7sBnQxvVxBEIjwPwLu4hg+4nytRRNon25Sl0wCxJsVc4344oKfLiyTv1cfXgc3fzBQp74YCtVxpw==; 5:gv8rIjJUwFJMtGwi7gqNqitZvQ8ICeMSvGZ4AH1ZmMp3b3r73Tr8YpaS63YUF4ZyG91BT8+POWKP+gOoGovwR1yhd1HEe2WEVRm86RDvkV0YtKwXuyjt+ce7FlnFPAEd7Z4g1z0Z7fk7l/LbX2boZQ==; 24:hKBe44NUPLlS/sdueMezuAyrFCaaMNSB2SyZGdFVAAqmIE4ul3XtFONR5eSPyzzWEglNQdRgRFcVzjzwZIEt8jqnWBbOPEpu8c3mIZan358=; 7:QIeLpp8sgJmhEyVnbzupmlbD+1g+xsjg3QlV0CUPN1sN3yi4R/aExGpaVLOt+czR4eobBR4C2s7JuudGwhbKnyOKCrpiDoJ5GCuIpgh4Zrejv/sMWPvnmhMeD/6ig7LeMd2doJDlTrehW0VW40E5EA3lscaUfXzrghTa+AYLTubq+cEnppJ9C3w0C/xVOvig6xoMfrW1FpCGGIhSAv/ia3OKWGi8udWDx2sn2D4oEyU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 12:20:00.6319 (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: BN1PR0301MB0721 Subject: [dpdk-dev] [PATCH v6 27/40] net/dpaa: support 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, 28 Sep 2017 12:20:04 -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 1f4f372..aae229b 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