From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0079.outbound.protection.outlook.com [104.47.41.79]) by dpdk.org (Postfix) with ESMTP id 96563FA81 for ; Tue, 17 Jan 2017 14:20:46 +0100 (CET) Received: from BN6PR03CA0005.namprd03.prod.outlook.com (10.168.230.143) by MWHPR03MB2477.namprd03.prod.outlook.com (10.169.200.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Tue, 17 Jan 2017 13:20:45 +0000 Received: from BL2FFO11FD037.protection.gbl (2a01:111:f400:7c09::179) by BN6PR03CA0005.outlook.office365.com (2603:10b6:404:23::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Tue, 17 Jan 2017 13:20:45 +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;nxp.com; dkim=none (message not signed) header.d=none; 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 BL2FFO11FD037.mail.protection.outlook.com (10.173.161.133) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Tue, 17 Jan 2017 13:20:41 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0HDJ8mY021741; Tue, 17 Jan 2017 06:20:38 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Wed, 18 Jan 2017 00:22:48 +0530 Message-ID: <1484679174-4174-28-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> References: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131291328449256161; (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)(7916002)(336005)(39840400002)(39410400002)(39850400002)(39450400003)(39400400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(104016004)(36756003)(85426001)(81156014)(106466001)(92566002)(4326007)(626004)(47776003)(68736007)(2906002)(50466002)(6666003)(50226002)(6916009)(2950100002)(33646002)(2351001)(110136003)(48376002)(97736004)(105606002)(8936002)(15650500001)(8676002)(81166006)(50986999)(77096006)(38730400001)(76176999)(305945005)(356003)(5660300001)(189998001)(8656002)(86362001)(30001)(54906002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2477; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD037; 1:d5wxLRY632lIhO6pvlYVJdKxN4p9Csh3UFcQ67JqAKyl4kD8C5+v7Waxyd/7VOTY3EZS0gE8CHmhUx3ljQyx2Pkuyz63hnQ8RN23cxNuxhWHJQpjGd4uXCGDK3Cnfr2gwH3RBAR1LVlw2L5Kj0irClZ/7jj2GNslVrWFE7pcWvA+l5jusbllWyF660r84lM30UZLNbeC+td3n+3csyDoV4XFi/7oPvDZDWO3s6G8A6G/I+GoMkiafbOCVpWiDS03j/Z0iJR/da2/AJc3fm0/eiy9vDn2mHTiG+9k/KE7qhyLOMRvNUAS/MF15rbFhYZ80Bau2pETU3ENgcDSLfoz/sqedkVCQugSjGpgGB2KyTzF9q85YEREnyOgZGSaCE+877cCZiZCY/acgrKJ3jWtNhkNpwhlVf4pvBL1R223xRQfKbahaj5R8VousdUPfacVWBqSHkZiVMhO3obXUXv8olS9bklbk2SeKpdKX8WQoa2qmyAPbWudI0Pyit5GCDFIFcRKkNJtaWJeWUxuq5cH3nD/NKOaPeQR11FyM5p4HDTiPlDUao6k0ng0cnhH6EV+TiqpCxMqA2qGddJb0hbYjZjtMl8qzQ4t938fp7Fubw75EX5ZvCTedDD0nuOieyAyworCV8EC4yVoE3SBoPBsEU266f+PSWiz00gRHgUGK8MCMem0VK67lwB0h8RYKMrDJiMvNc0O22SoQVCRsRmGzknPlld6ma9JoSN3Rm/0e2nRi06RGZ160MIgEgU3ncNf MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 7d620ba1-e9e7-43f6-9ae1-08d43edba4c5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 3:tsgphMxjUtm7Af/WE1J0oqCA9neJLl5+wmjiKci5zxWhuk10le4cVysYvhrA/cN+vNrUiFBu9g5HOLaQkrbCPGlsqaImrVSxT1QgRBS7TEoLVCCfij4tZUplIhvq34VHFKS+t70VDn682MqQjHQFWhNvum4Awp98cCz5pOz0ebj/zrSHnttnGX9iY5HscIGchMSlgaWfQ8mgtOce7VXBQHLCHpagrxDoBEO4DcUkwm2ZUmrNakUpE2vjLZxkU8/G+F6PxFE6o2DqbkPWyU8dwjEr08j90QTPDQXhZ7XYQyTuO9gXPKcYja5xRYcvQvQ0/c8c/HgHWQSQO/CSCLcOIDLYzpxybWXpUDR/kBbfRN7pOkv1pgGgNZ+4qH8TOVMS X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 25:2Rkm7D0mAOObWWTh1FoPn6EdG7MSwI3YYL8mPBqLaJlk7cYNt/5G28QCNDdz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2Jeq/PE3ys0dZTpFrdkeDsndRBWvNFX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:MWHPR03MB2477; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2477; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 4:i34JM5jn+doLuuehekFth4OoVzi/2lFq5TdpNRHeb6DfyQUEa1DxBtDPBfsaQAzpUk7aVJ2mo94xxUlxSUswHfO3yh2pscxRpF9ySEDIW2zb5T85718XTHJmYp3ikncg3hZB5fzBd8sQpvqvy20Tb+OFytx9LAGdy68eHCupgvpugnRP2jy+Xibo8eLNlWTCn5hCeGzKiCr8dr32B01uUE422x9omklJzuPFfoU52NhgzhM7v6gbbzadLRoua2/gg/cVjTlduFf27JlvEZrQQZjAusMKu3Bi/ekFIN+P+0WivfC6IOKGbXfflfujWHIP+EaFfLUBWBUCxBafzTb3mdCYb0kcUCoq9rxw2UqEH6wZiKeBgIpfGxbIyJ2AiXQRlNThUrz9HrmDaRcl9H64gaGyUVMgZ/p756cZ/Q8xuflZLgkiLHJUYkUHMAX4qh+Ox7aATZaPk5zAjVjhnmysP5UR8HeB8v2sdkMC6zXNyyyUXp8B4ML1YPd6amnQ3Zg4s+xGD8jCeKTMMCVX8MxZXM8pAljXXO/nLW1EKhZsWg3e7BpF6Dzr1Gw3GjQlR0sliuF+4BHV8HcsopwHkH+PlRsTJ/V7nIWhH8sxo2L1sHn0PVlTlfG941RE227oOLmoBu7ZyTim+bZZqynrAkTCgxYarOSy+AE1IAk3rHV2/kHugFQnRNi4j9fMH407FY8jR/v+BB7KgmbxGdVZRphUq41KLTOcPJ1X5OQ4AGRTN8EUUhyhL65CX0U9pcsvVSU7 X-Forefront-PRVS: 01901B3451 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2477; 23:rCXt8GInOHXS7zgf8OXxffVsZa37T1/A2h4Is+24m?= =?us-ascii?Q?+3yj5e64DZbasczf4/2VIx/4fmTHNQ5mlZWk17U+w0iHDCj+W6GPDG/Yo1sq?= =?us-ascii?Q?NXgrBgIB7qGAHowbx5v7zWmeT/scIX1NDA15WEE4BYGDG1c5Ut4eHj61or1U?= =?us-ascii?Q?Mbga8b/rvreid0reRJl9cklAB1g6EN+sxMHUCyIuJaDbnp9bX2+irmhW/bbl?= =?us-ascii?Q?RkyR8tS1TDAdWYqM20ePBXwMDA7r8SKs6ScI5G1ZRdw53pFVENanBBEC9/kv?= =?us-ascii?Q?zlEQqgF1LxulBOhs3aY55qM2y92+ggnVo21p7HZOobgQrExqic3W3ZhtZhp5?= =?us-ascii?Q?zVgKwmcRrmd7AEjpL8xJIk5HAyWRjXgDWLa3zpcI0mtVyCkXDcl7BJN5VEkK?= =?us-ascii?Q?0tF75AA2q6pvo5XDfgvV2e6/LnFDUulML/9q2M/69Rc+Sm40fg2v3wIdQi2V?= =?us-ascii?Q?7ov27XNh2K/ppEqV87H94wRShySuybbHBPi4GbrKvjaTNlvsPKwyj6usPR5n?= =?us-ascii?Q?o+KHGeE/V6CyR1fXEdrDdxo8CVL+O2xSDVyqn62pxknNSUfLJSvHDOE9RudV?= =?us-ascii?Q?Y55xs4VMTykYLEZcZk1nD220QOAoiubDIErAJsaFlMvrbl0qmWHs9fhhVW5q?= =?us-ascii?Q?/32eUh4EbX98JwLcaR75kcUXTdJksPLLIRwS/TvFh3EkIxRF5aAtZdK3rvQS?= =?us-ascii?Q?KHwYfV5YYLz8Icg3FqRs4B5AxB3WZTFHPV+I3umYF8/bjKo6/fpchhYQhqoF?= =?us-ascii?Q?zJe8I7RAKmSIw+JbN3VLrL2QhJ+V25L0+dfcKj1c7SYcUVm87AkQj8raXi8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iGbMF/4gx8y/VtyfAe1th+K8S8BpuAx4MWVGI20y3Udfn5YWN6SFzXvNj9ldut; 5:jww30LRjIPCU2LBtEaYq4wlg1gUHmzTRq/xSUGcesP4moUqhbOjBpccFXr/dsNi5VsH2V13zv/NSddq/orGvfQLxCEIZ3GQNc87jG16jRUHOW/h/bwoDIAwhOwcQ0ay6PI1Oh949+EyXnjvYVq3Sr8CYQ1im6PZhx7L1PVjTrf71YRfT4NcsZnashA3+pisz; 24:R2K5zAAAF/Uz8/CbNff8NIm40esOsugU/gup9Ct+sEanM9EA3M1grfJuorPzTXdNJwqk3ibKIjP/9PVtF9dVza+eyt6YKc4RFp7YPi4+Zcw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2477; 7:gd1grbwxyx7WyIblQ7TUTIwEkBELMt+7fnVlOVjf9gfuM82lXQCqBzMwGTdnZNyBeSo8JXqz6Nsf6CAnHzGsiGKhNcVpyxiG65dZU7G7LI3UTtKKf5ybJAmah/atyFoxsxefi85giAiwogIfh72isXksgAcwTzH9Q2rhr1R472TVQmlxaGcPSJ+b9y2rjDteH3drzPEFIW6sWCgYmIujjVxA9BjtJGuvHUr2c3FMgW14FMKCHh/0C/8dHoVQazXg4yQq1h9b2NxKPrYtrnLog/h7Hocf1LqJmEd9xwKjznQ2lQC/oyX/+TLj01Ul7VMpHvU7puwhlJloSQGKmZ/gRheMdYIlyeOzHCkpTp0PoRuyyp5+k0Xj8+O+HNe0u5eIm/B1/HeuwB4gdDkA6HsEcGHxOwBvNfSfZWFRXyCz9gxhHhSB/n3qNGMuefIvR4POZbke9dsAIyHEjqVGteBxVw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 13:20:41.9303 (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: MWHPR03MB2477 Subject: [dpdk-dev] [PATCHv4 27/33] net/dpaa2: 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: Tue, 17 Jan 2017 13:20:47 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 107 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 0746d4b..0660cab 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y Queue start/stop = Y MTU update = Y Promiscuous mode = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index cbcf806..70264b6 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -55,6 +55,58 @@ /* Name of the DPAA2 Net PMD */ static const char *drivername = "DPAA2 PMD"; +/** + * Atomically reads the link status information from global + * structure rte_eth_dev. + * + * @param dev + * - Pointer to the structure rte_eth_dev to read from. + * - Pointer to the buffer to be saved with the link status. + * + * @return + * - On success, zero. + * - On failure, negative value. + */ +static inline int +dpaa2_dev_atomic_read_link_status(struct rte_eth_dev *dev, + struct rte_eth_link *link) +{ + struct rte_eth_link *dst = link; + struct rte_eth_link *src = &dev->data->dev_link; + + if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, + *(uint64_t *)src) == 0) + return -1; + + return 0; +} + +/** + * Atomically writes the link status information into global + * structure rte_eth_dev. + * + * @param dev + * - Pointer to the structure rte_eth_dev to read from. + * - Pointer to the buffer to be saved with the link status. + * + * @return + * - On success, zero. + * - On failure, negative value. + */ +static inline int +dpaa2_dev_atomic_write_link_status(struct rte_eth_dev *dev, + struct rte_eth_link *link) +{ + struct rte_eth_link *dst = &dev->data->dev_link; + struct rte_eth_link *src = link; + + if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, + *(uint64_t *)src) == 0) + return -1; + + return 0; +} + static void dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -431,6 +483,7 @@ struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int ret; + struct rte_eth_link link; PMD_INIT_FUNC_TRACE(); @@ -440,6 +493,10 @@ ret, priv->hw_id); return; } + + /* clear the recorded link status */ + memset(&link, 0, sizeof(link)); + dpaa2_dev_atomic_write_link_status(dev, &link); } static void @@ -532,6 +589,55 @@ return 0; } +/* return 0 means link status changed, -1 means not changed */ +static int +dpaa2_dev_link_update(struct rte_eth_dev *dev, + int wait_to_complete __rte_unused) +{ + int ret; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + struct rte_eth_link link, old; + struct dpni_link_state state = {0}; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "error : dpni is NULL"); + return 0; + } + memset(&old, 0, sizeof(old)); + dpaa2_dev_atomic_read_link_status(dev, &old); + + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); + if (ret < 0) { + RTE_LOG(ERR, PMD, "error: dpni_get_link_state %d", ret); + return -1; + } + + if ((old.link_status == state.up) && (old.link_speed == state.rate)) { + RTE_LOG(DEBUG, PMD, "No change in status\n"); + return -1; + } + + memset(&link, 0, sizeof(struct rte_eth_link)); + link.link_status = state.up; + link.link_speed = state.rate; + + if (state.options & DPNI_LINK_OPT_HALF_DUPLEX) + link.link_duplex = ETH_LINK_HALF_DUPLEX; + else + link.link_duplex = ETH_LINK_FULL_DUPLEX; + + dpaa2_dev_atomic_write_link_status(dev, &link); + + if (link.link_status) + PMD_DRV_LOG(INFO, "Port %d Link is Up\n", dev->data->port_id); + else + PMD_DRV_LOG(INFO, "Port %d Link is Down\n", dev->data->port_id); + return 0; +} + static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_configure = dpaa2_eth_dev_configure, .dev_start = dpaa2_dev_start, @@ -539,6 +645,7 @@ .dev_close = dpaa2_dev_close, .promiscuous_enable = dpaa2_dev_promiscuous_enable, .promiscuous_disable = dpaa2_dev_promiscuous_disable, + .link_update = dpaa2_dev_link_update, .dev_infos_get = dpaa2_dev_info_get, .dev_supported_ptypes_get = dpaa2_supported_ptypes_get, .mtu_set = dpaa2_dev_mtu_set, -- 1.9.1