From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0081.outbound.protection.outlook.com [104.47.41.81]) by dpdk.org (Postfix) with ESMTP id 1B36CD0A5 for ; Fri, 24 Mar 2017 14:36:15 +0100 (CET) Received: from CY4PR03CA0001.namprd03.prod.outlook.com (10.168.162.11) by MWHPR03MB2799.namprd03.prod.outlook.com (10.168.208.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11; Fri, 24 Mar 2017 13:36:12 +0000 Received: from BN1BFFO11FD012.protection.gbl (2a01:111:f400:7c10::1:149) by CY4PR03CA0001.outlook.office365.com (2603:10b6:903:33::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 13:36:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.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 BN1BFFO11FD012.mail.protection.outlook.com (10.58.144.75) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 13:36:12 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2ODZhft005481; Fri, 24 Mar 2017 06:36:09 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 24 Mar 2017 19:05:24 +0530 Message-ID: <1490362538-20854-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> References: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131348361722743151; (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)(39400400002)(39850400002)(39380400002)(39840400002)(39860400002)(39450400003)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(81166006)(2351001)(110136004)(8676002)(54906002)(50466002)(36756003)(356003)(47776003)(48376002)(8936002)(305945005)(85426001)(38730400002)(50226002)(104016004)(6916009)(4326008)(2950100002)(76176999)(189998001)(575784001)(105606002)(5003940100001)(33646002)(6666003)(50986999)(53936002)(2906002)(77096006)(8656002)(5660300001)(106466001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2799; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD012; 1:MBEuRHCUVWLIxsd62kssb8wFqXIu+vV2Nv2o3Znh4Psxl4hC2NyQ5BvE47AnHQMZLhTAYRmHjTCQ/vJbTyJZ4ux6zf8kU7h/qicrFaERyHpQ/3IZ1ESJne5K1PFAYqkCYRHnSnirKk47v+B1byvWFbTIxPzgJ9XfF1dhKl/HSz/Ivzv0QfYnuwivZWHlLHLZUM2DuY8ALo4Q7iyEdzPFDz8U7flB8wU8Tjo8wfMey0Fa4a4LhbtyHpQZk6u/IclPaY96Eg6xd8OGQIczEcj1XJIY3CzTzB8/tJx8IL95mctf8Qkb+7SOoMrF3CrAVzrB1pxyr9LhwX9wwIjlqyjXO8qHglp5zLi405NNek4T7tNbp9lw7sTbMX6mlMVArmZaVpuAyGy0XPMiB+m1+ss3dpYmGlUSiiySfX/plSGoHBc+l5dYJwkD4o+DVuUmZfhdeGQFa2T2ZdVqK3XdksepTWfbzXG+vzhcJMJ9IGfgzr6AsCmq18l2M4Tjgdg4FGiH2XLwfgATswlyAIRzpHpIpZXSwR99OMQBxEjXoJMBv6YbsMIESRbMUiJweHmCYptHVUM/R/MgsxnPn8oX30xdlShR9Z/wBK7jgcWhyb8BmOy0jiI/+iNJnJI1+oDGYM5yqS/FRwH68JUrHi5kC0sCWA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 6ff7f367-f329-4f06-e80e-08d472babcc4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2799; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 3:DlBfRT2oErME5VpRbuYGhIMsp+xXVaeIIu+6PSvaTSjpu2/b++VDWLrcBdoa0d8j4OcqQCknWfBrHB47iFGiVEsrC3NRaiL7XxQF8W89qGV8bhSAOBIIle92elZQi7PlOdoTSVQu7Mw51eI7wg2Zn86adqcr0dDVS0dRsSB4vofG5pagUDFnghQXPfG/RbqgNznu4lic19X3dCenL6aRlYKO+tnIVBWw5/ovwRD4SUoZZHqjMittD/ayaF8CEW9avb0b0LUVxRf88mwnptfHsTAewfT6PzbPLuH48o2V70IAypX0koWpOWuuChS1lcNPISyAnIr6xLFL8bFBXrtjUnGJ5Za4Xbur/7jHAvtk+rRlfXnYScmLGshyB56XaPm8; 25:bhkFMFlQTOO+aVUYM5KLbROwO7lqwJ6Sa4Hb8nHQ0kTO8YqCqBTjNttn9EmsgDfX35AEf3cAabUZ++6kZB87d8V1JKP4kvJ99CfqUsH4cnxvwqRW5zkThXQn2y4GaO2j3AVHUzvrfk6xEKHNaL9WdB7hMcG5OG4fGdRc4FrxFsEVFP09rMM3eakxUpZk/FGZlix2tRX+323Nme7keO9aBL2vZHzlL7LJ/t6vjk0+Q0tmHm5RjPl7CewoDBeGfMVpsu4QZUVO8QT12dYa5ejqfotCJAx5ZISNKrmcg5HmXuVddAVK25arqrNUN8910SR9QoHbEhfs3DOJEPn9EJGhj+JZwdz37FB5/dKPxaJtHcv2cAd2uGk7QLEk3FNvhwh8Bj/fs4bzbOHTJSVUEW7BcSF9kjfuOa3FK/yVaspcAyemmciPJidTv29wsBxpibbxMVlvxP3TJYZPJY8y0JLy5w== X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 31:0EpT53I4v4ywCbuRDpVeXRZzviw6nV2LaGFMEtUqfVwfvMToUSgVsnk39NS7WhvZIqnoIFNXdEkepK7X2p7coEgwt8RHkS78zcuRn2aqMu0fl7To4jXVtSqKHAxWDZ2zERGHdKCoP8SB2wPpnAnbZP1Xf6yjNj46S04NkIjswRl1CDcso6dRZuQ/ZAPHSuIX5GbVokbh5IR8kcIbKEGHQjVTsvXUkOoTMpTSpZD2jvpwdo6KxEHw/04j8sw66fcKNWTru0df4vp4Xrc0Vxil3Q== 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)(5005006)(13017025)(13018025)(13023025)(13024025)(8121501046)(13015025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559025)(20161123565025)(20161123563025); SRVR:MWHPR03MB2799; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2799; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 4:7al3YFxUwdgJPCP0VzOaZjJPCOq0k819ngIdduyoHyYkifmOhz8kZ/jO8eKE1jG45NbkMdLeApuLUUiQMiIlHvsG0FPMUu7neQshvguZ1qsEa3UCaCJuGs6Sc9DpytZPE7wgsIsMib3X6RZ348+57qA8EUMjSOD9ouI6ny5UQHGzxSKkz1LSX3ZNg9oNtj/4gOPD2rrLJx1jdqr6iL+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QlrXb791ULetX5a7c=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 6:a3e8D+3jYX5oP6XP0ymhgbux2RAq6BQFgEFpEqaTIVXs0mDri7ATpD4y2cAOEqcbJEOOMU+G89n8A/PDG0U6uMJVTU4ueJMcMvXH1fCMjCutNSBq/ehH5tbKaG+4hm4bAGoEq2H9MwzESvJRCMaVGx7H53UueZxbcFlFWQQQsBdTLG7Uv1BEuPhETVYcTWQk0t869CUBAb+cbkchDyIireknTNapj7MZOHtcKDpVMX7HtTHscYmyt/gT47hYOv84BI7xLU/tTxnH2ynNI1pxRq7N9t7ucs7G6QGRo53PaNjcFGVjySCS7q8VH8TrJThMv8sjzh+seyxsRtcZoAfGal26az5FPjbakUAtttJxFjyl17igqhqJ+3bvmiBHdsyu3ptfS/TtbJAvtf5Bd9mtkuvClTg4HKWawbeXzXWfrbY=; 5:ZM7kX3Il5TzErsSvwqSS/FC5r593Ofyp0sgCv5mI8OHk0UqvIIBXwogJagsd6uuDfrJSroBR44L2ZIMFRmtnGkDVL1UyVLJiQJ8lYfqn7s2fOpOAeC0cwfo34F4gCzjUehpVZZrd51uXzXHynDBzeuY3g53zJ3814WmLSrcp1PdseLeNnAViqMQZMwBWp9l2; 24:Gh0H+c8RLwhp3y6ufcSkE0arLdXLAbKLTOU6u4MlefEORcG2K34umul1v/ufMRAhQ+QvZuE2NgHjyahhC2cEbFbTBOD5cabMN3dUaUYUoGE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2799; 7:TToRUPwAoiHrDno8+9UL2XxsZAUMUEsY4JHLFT5lghty0JaMo4JizM8Mlm0x803v72/SJa5V5lOGCqRJDzUkYqbO+Tv402yewplBqaHsiERiM0gkvI9yOhHNKKLFxCwiGCjW6O50YzamMXVMSCYjpHMk1SVmshhIhGr1YJK9FxiMozGUgAvXQIPiG9pG/J/sEsQ2ODALU5pQ6jSSiWzifwPltxMIdzRJSKbRkUNqf7gFq21QZFjEYSf4ALmjN3RUIMMt8QpoIW5XIqgfwdyVaydXK0hwY5jKJ9/v1Y+jOlAUrooXtlo0uLjqq+U7TR0CVMU9cWI6yfWIR0BV8P0XNw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 13:36:12.0403 (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: MWHPR03MB2799 Subject: [dpdk-dev] [PATCH v10 08/22] net/dpaa2: configure MAC address at init 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, 24 Mar 2017 13:36:15 -0000 Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 28 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 92d334c..6462e0b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -62,6 +62,7 @@ dev_info->if_index = priv->hw_id; + dev_info->max_mac_addrs = priv->max_mac_filters; dev_info->max_rx_queues = (uint16_t)priv->nb_rx_queues; dev_info->max_tx_queues = (uint16_t)priv->nb_tx_queues; @@ -443,6 +444,9 @@ priv->hw = dpni_dev; priv->hw_id = hw_id; + priv->options = attr.options; + priv->max_mac_filters = attr.mac_filter_entries; + priv->max_vlan_filters = attr.vlan_filter_entries; priv->flags = 0; /* Allocate memory for hardware structure for queues */ @@ -452,6 +456,25 @@ return -ret; } + /* Allocate memory for storing MAC addresses */ + eth_dev->data->mac_addrs = rte_zmalloc("dpni", + ETHER_ADDR_LEN * attr.mac_filter_entries, 0); + if (eth_dev->data->mac_addrs == NULL) { + PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to " + "store MAC addresses", + ETHER_ADDR_LEN * attr.mac_filter_entries); + return -ENOMEM; + } + + ret = dpni_get_primary_mac_addr(dpni_dev, CMD_PRI_LOW, + priv->token, + (uint8_t *)(eth_dev->data->mac_addrs[0].addr_bytes)); + if (ret) { + PMD_INIT_LOG(ERR, "DPNI get mac address failed:" + " Error Code = %d\n", ret); + return -ret; + } + eth_dev->dev_ops = &dpaa2_ethdev_ops; eth_dev->data->drv_name = rte_dpaa2_pmd.driver.name; @@ -490,6 +513,11 @@ priv->rx_vq[0] = NULL; } + /* Allocate memory for storing MAC addresses */ + if (eth_dev->data->mac_addrs) { + rte_free(eth_dev->data->mac_addrs); + eth_dev->data->mac_addrs = NULL; + } /*Close the device at underlying layer*/ ret = dpni_close(dpni, CMD_PRI_LOW, priv->token); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index d24fcc6..2d13137 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -57,7 +57,10 @@ struct dpaa2_dev_priv { void *rx_vq[MAX_RX_QUEUES]; void *tx_vq[MAX_TX_QUEUES]; + uint32_t options; uint16_t num_dist_per_tc[MAX_TCS]; + uint8_t max_mac_filters; + uint8_t max_vlan_filters; uint8_t num_tc; uint8_t flags; /*dpaa2 config flags */ }; -- 1.9.1