From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0063.outbound.protection.outlook.com [104.47.33.63]) by dpdk.org (Postfix) with ESMTP id 5A5A7F94C for ; Tue, 17 Jan 2017 14:20:25 +0100 (CET) Received: from BN3PR0301CA0005.namprd03.prod.outlook.com (10.160.180.143) by DM5PR03MB2474.namprd03.prod.outlook.com (10.168.233.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 13:20:23 +0000 Received: from BL2FFO11OLC009.protection.gbl (2a01:111:f400:7c09::141) by BN3PR0301CA0005.outlook.office365.com (2a01:111:e400:4000::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:23 +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 BL2FFO11OLC009.mail.protection.outlook.com (10.173.160.145) 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:20 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0HDJ8mR021741; Tue, 17 Jan 2017 06:20:16 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Wed, 18 Jan 2017 00:22:41 +0530 Message-ID: <1484679174-4174-21-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: 131291328231056946; (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)(7916002)(39410400002)(39380400002)(39850400002)(39840400002)(39450400003)(39860400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(81166006)(8656002)(36756003)(5660300001)(38730400001)(77096006)(81156014)(86362001)(92566002)(626004)(68736007)(8676002)(8936002)(85426001)(54906002)(4326007)(50226002)(5003940100001)(2906002)(6666003)(6916009)(33646002)(189998001)(47776003)(104016004)(50466002)(48376002)(2950100002)(305945005)(2351001)(76176999)(50986999)(97736004)(356003)(110136003)(106466001)(30001)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2474; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC009; 1:eRnLFFU03TTB+jKEdFEK5bEzQzdOls7VY+ES/TT8vDNi3PpAO2p1KlCqIIdsw1I9kwZ6DKPBnZOYE2PITT8+2os1cQt2kMX4JOPx8Bf10uUltkllaOAqodAwjLcZ+Wf3JZrC+eGwT80tfqw6zeur5+2p7npY9JQtscl9yB5xX+x/grcIw8l4s314xBHVaSEkIQiFSzUvYvKNb3tGKyJGrJcYgvs9eYza7Mb8WTOwxJvk+rM3HT3HHtGya03g3FX86SXcNXlqx6i8zDVO9mvDQVZUB6gl/lBBHdMM/HhBfYusznZIRN5qxttFY2oSn4L78KMe9yusajbLzxe0u0fg9RBk+jLtnc+YyfcptqYlshWGNCev1OUp5lHLBgaFDI2DiovQmnAdPc7xIM3R8V61nGfig0A1rGrNI+dhRwkkJtgOBfuS9TNe1YrImlDjgCwg6+vkGxsfqbwnIPQnjxYTpaP6ocLfTgovbLFz9RSEU3WVLmiHf+0uKILP9DBvstj8059p8fCS6LuCyP8Sx6k17aw+Cg7F2BXCMU83h4WpKLNOYJaPzD1Ui0p1gJXE2J9jbKLPHXKLNXtUNaxUQRpESVtyVesjRcBZl94jMy78QUS16f2PGoAsS4REF8V90qXch3oVbIwOSau8jDvB1wtQRwpaAdfBP5cAs9KZ8rhyCxoS/cPsgljLuU47a8vzq9G6uwa+mSwcmUWwWS9hMLvGj3Rr4o8yDI9I3D8QyxEB2w0rbIgcZpoIoiPxDJU3Nz8k MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3b49416b-ea88-4aec-c4d7-08d43edb97c1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2474; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2474; 3:RQJ9onHSvN80/7XGicyTnfigFUp8srHbpnC6fKoL0UmNvDTfi2K0PFasZ3dkI7TO+f+aokTvj3kYPFlHNmbeeKIchvMcWGdg/8H/blOw6+Yz37QlvVZgtMs6XcL10JveXvFOB4ZSgCDyJdusPILsHp7JiUn+T/h5dexFwCdUFVRNGp+kYsX5gMy1XiuBv8d+p4ZQLFFNsgapqhR8b4jSg9Fr8RSnMN8xlXjfvpSDK0LdP4SEfL0WbYKjFKR9i4Ro1eAU5fC8alCj/8cedAtXuV7eyqWwQAD0tcuHgNCK85ul3JQYUTwQt7EFby+VPnyAVH2CRtYqV5MJOm0DJNAYj59oU4fuvNWPs8ySVUoWiC/FxAeE4VrYHQETGxrBSOIJ; 25:HG5rzKPnCSq3ULIFvFFNG4tzKNNxH8mVTB3McycX8oLPsoTclTIP7FaYIphsrqZqdL9yNUf2rDL4JT6D0+sBWBGlVoDnIiyE96/QemjmCKNvlSwW/Y0eoNLOezLwBpRTdMKxqjjfCvdyfYvYhx9sj4hbURPa09MvwCOM3fb+A9B69cPxaldzrpIrmKDfiKPV+5PnvAZQvB62lLHuTgRPDsTLmm6MSU8XWqWnUJdHbe1BmXp2OGID8q4k1rQ0Ew8d9lEiQqaW9Eg6HPP2ZLCPW32aqXoyro90tj1wre6t+AiCJqX/K+00u4DOCwTXe8LLJOU0w/vknBu4o00BaZPMMdKR84156aX8DRa1e0FzF3PAtPYHufPlgNfFHCS1y7XyuAxO1Qt5w6XESqTodXoq9+WGd2ZqaY2Bq5Fq7sFpBDVgD1d8b5ccAXeWmKIhjnOxF0lE88ApG1lwqnK2KiJYmQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2474; 31:X32ekZslmCMZFBML3naV6u8nRR73xVuieq2LC5u9KN9Hv79x6EjDJR8jufUAGIztCivE/KLFez8lRqT0PDFZD/XCTMNNstZXaLMZMEkeZKiViCke90OM7lm6p68KC3pt3S0HM7hl57Q6AYVc0RK/cZHGmvXXMybtuRC+Y6HCtwFMyui0sr4yZHzknpLVJ9OkXsVU0acQ/RllFQqUJEvEFcskbZSARI7JRpGBgeRYcvfxwHN4mO56suQuVkiOLGa1QpsfGhiPSRxFpe+wv7Moeg== 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)(8121501046)(5005006)(13024025)(13015025)(13023025)(13018025)(13017025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123556025)(20161123563025)(20161123559025)(20161123565025); SRVR:DM5PR03MB2474; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2474; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2474; 4:rTKy6EZOwwZodJatPWNIsQPk3lYrWH0bidEEpCb0Lzem5x0b99VMPBj/3oWW0HrMPJ2qH2LIa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+ww1?= =?us-ascii?Q?cVJyLf0A3ESx3EQ7tYwbLmMMb62LgmxpdzE4TfsIdSrlND40iFXdZZUPF3DP?= =?us-ascii?Q?3BZaCO0ynGP404ATTS0//SF5ndXZqAW0iwmFgD2SBUhZ9+jCPrqnEYoQC83c?= =?us-ascii?Q?P2V2btWDAKNZpcHagrakXh26eyZ4+sOWTeun2rfDC7+3a+4XJ21d1OBVcBbC?= =?us-ascii?B?QT09?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2474; 6:cSfIb4bQdof85+B2Lu8rTzzPd8wjqiGRWjbAiXRH7QiiDjEbIf65ju4gYs0DeFMYp8ITLVmSuqQYHkCXh1aHfDrG+7LjcLp+Su7agW2meWv8FXWjo+qOXE79FHURW5xRY96BdNsUt92NY9W760FNbURMzJ3x4rECWc2YihFUQzannD97e+9Rhwmh8epZRBynG0i2VTj4mE9YsVwa63zIwS6NivCHpBvAwkj1yNCvCrPMhLVRKvQ2BbYuE9VOwyW4cvzDCSo5xC+YJJFLhvGoZbVictEOxcLMCjjWaSiJDjEmCc6BB+T3g8jhRJFSJOL589dxB6OU5vv6tTLrOtPzpby8H93GS3CA1Qh5exl8vtxHVI01WtHETi0utXULYWpaUWy025RtCjm7uG9tTIln0Jw6vlYGy8uQ1xSKK92MBl2JuSPmrUCKbtBFyPzyu1BO; 5:5cUIALTl5wIHlL2afP4Wr2vGG3zYY6gqlmYsxJGoePYW9TQWvlHrHYRlHC5O+SmT++poLzNqPmIRhymoxBR8oh4vthaw8y5hskVZiBpOrS8IVwBiP3YLr3GYFlphLpEL1B55ZAI6yis+i47/LW8rdZTYEOZCzy0QL6FTJq4h5DG+2rZxJN9CN9OCtjjpmsNJ; 24:zxswOYkJzxZhVNIy/GG3wttKi9hFyPoj6/FdYHXPeveI30nDWM8/g6s6lu92UxRvoHjQ4+F7wTCp177zTvV4YOhlG0BrekHGkKPkxEwS4l8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2474; 7:/kjJrgt7m+ImNPSDwmvLOwyzZjfloX3yyTUaln49JPX6L4cuCZm++cU5ABmY4JGGUuMQLFukIhhnEGnO0EW+aKbgUVZ6k3a8BVT4C624HDA760cM6hK797w5Bv3K5486Ooe3pPQuCQZWRSQV87uziActJQ7YNdfeaATaeCmbRIi53FHDN7BfCVYdOmtlJDaPCjr+QXKSRV/xSsSqjsy732teNWwKuMwRAItjYaHAztThspLEshromvy7QlGiQ9z+ZQ5IC1hm/wTNDhrP3RCAaD4DstCejhVliELM9VS/3SzvIOb3ltc5upu6i9W3CYfp5dIVIC96IRDSdnINIwgaFd7zkygTtmi3mLg8vPKw3I8Ew7KfCKDmD9z35n9+4Ksq6SnRDBZr5rjtXjxDVqJimG+eOUZlqc1G5RmUj5wpnPmXMfbhVBbz/YQkXorbdMTKDybyxWw8GPuf90bJfbuMOw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 13:20:20.0325 (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: DM5PR03MB2474 Subject: [dpdk-dev] [PATCHv4 20/33] 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: Tue, 17 Jan 2017 13:20:25 -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 1d7ca66..54f4498 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -63,6 +63,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; @@ -447,6 +448,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; ret = dpaa2_alloc_rx_tx_queues(eth_dev); @@ -455,6 +459,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 = drivername; @@ -493,6 +516,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