From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0083.outbound.protection.outlook.com [104.47.37.83]) by dpdk.org (Postfix) with ESMTP id C316F5588 for ; Thu, 29 Dec 2016 06:15:23 +0100 (CET) Received: from BN6PR03CA0059.namprd03.prod.outlook.com (10.173.137.21) by CY1PR0301MB0748.namprd03.prod.outlook.com (10.160.159.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Thu, 29 Dec 2016 05:15:22 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::139) by BN6PR03CA0059.outlook.office365.com (2603:10b6:404:4c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Thu, 29 Dec 2016 05:15:22 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Thu, 29 Dec 2016 05:15:21 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBT5DOI2010218; Wed, 28 Dec 2016 22:15:18 -0700 From: Shreyansh Jain To: CC: , , , , , Hemant Agrawal Date: Thu, 29 Dec 2016 10:46:39 +0530 Message-ID: <1482988612-6638-21-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> References: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> <1482988612-6638-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131274621222444269; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39860400002)(39840400002)(39380400002)(39850400002)(39400400002)(39410400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(48376002)(50226002)(5660300001)(97736004)(50466002)(106466001)(86362001)(105606002)(305945005)(77096006)(36756003)(81156014)(38730400001)(356003)(81166006)(69596002)(8676002)(85426001)(33646002)(2906002)(50986999)(4326007)(8936002)(5003940100001)(8656002)(104016004)(68736007)(76176999)(189998001)(47776003)(626004)(92566002)(110136003)(2351001)(6916009)(6666003)(2950100002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0748; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD025; 1:XWI29abRvd6GYThM1oTibFM40VyUaKzzvzvGQ+W3haeEMPeLyhGZHZRMCRKvVsONjVQYqNxuVGUF7sYdmxe/fqHUq3GrmQ3+7KA4w1ZZab8bv96Spx/qJMJ6BxoQyVJG+9g/T9nSpe2zC2JS90VuMRMkzKB2lOG0sEnsYF24fvxDvISZgPfyAzKmh0OpNPUppVuR8B1JNyp7qm9zmSlPCg76an1YTr8H3TslfiPvrMmmLkMjlXj15t4MyBZjk0DD0BRRVNw7nS4w2S3Y6tO3uhjB2o0q7thx4xMhrjEH66LccMnLFA+dxK3MWVMR7KKFbc2aSfVdL/W9drW3krPWQpkc9ml0EA9d6PZcB/VwARibmHL9Xmfbd5U5rMg/RSGDDUYcM7ARDpEWwVJCwscH9CFekBfayAF3TtgCI/vnC3Tkw+RNbUCdGdxV0ZedA5JDsrwmykR35hy0qch0eZtDXlvoj1ncCCBTeFKejO15zD5LiDpeUgV/gJzwXM+vno5aqk0qPT2+rBaTAxVZ/fLKR4x7nccT91ZczsoqnEy6z76Rnj+VzQToZae3OS4y89xQLVNqjou+lnoxi7WSYIGO6DJcOEWNGWC0di2AcenSVEcJM3nnx7RTYdnWVSMUzOCwHxMKlmxw7YiV8yb69+TVoTtNi0x215NBw95qo4mljM8Buk8HZ4/y7piXzLFioy1TKE8l3Cw65Yfv19ct1DGjqOecX8woe0REmguitdD3oA0UzPvCCdUcs4mCruRQe69mo9WmmVQnOJy4ch2l6Codqg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4e6f8c94-b35e-4b75-7084-08d42fa9b05e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0748; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 3:KFEg2LRVlp6Poma6wi+r4bG0vTtBnPhtFr9VDgoiPQaY+y967+29FVhfED3hkmjKrPzFEFsjNAb4ZCEcV8DW97B+g24fhwis+53siMtf1djCrPhnpi+feUzFATJSswVTVrb8xpOQJf5gcd8PXMH5nG3dLbhjgJcaspxE76ObJVaVfy6BqXHM6QtyELalVx7+qtONrVdCa+b40vUvRmrQr4zkY1UrC2ldy+BjaVgtJqgwMIhw4E31G3FvP4TsIzcIktMkPOMP2/WGvKe4nvuJJmW7DVMroUIA5omE4OalzKlSp3MYqPOGQhD6ypJ2UdvByExhzwQPiaGE9+MNUkYqd3vmry38u1L6WjPdfzDasZ0= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 25:EuOViOs5LubnhNnaXoB/e5eR7UOZ0/AVDGVJka3lTAu4m5D+s9kVZkasqgjYKwsxL8TH0QsFsGoUPNs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VS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123565025)(20161123563025); SRVR:CY1PR0301MB0748; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0748; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 4:ZNt1pPA8aK6ie5lLYcJKn+bCvX4LlKbqyB8JcWa2Y1kAQPQm8lfWzO0Xa9B6hfRlHkidzgUdm0MprWhYp/4JJ8ODppqIiQw0lyvW0zMde/XFO5RD0oIDv0qOdO5RmxQ/Ylt1oXo7o32rHjkTbAZb1Jx4e8fZ+GGvnN88gJtI1ntQGOyW8QOSTf607QBi/hNl4l8Dh+lNEzmA7/AUuIJUdLFJcbabRBP4TybpmOG0FUtQ8DS8gqf1juUEjFm+M5va4yyYZcpyB7ofq9ualLZtDKyGD+3P2dhc15OnswilsywHABMoMpwjyIhcRYFqWTl5dCEKLjNFqY4ZZ70XlLfi/C7NpBxdUTNhO0EzgLwAqaELySzI4jG1iUnMe7VvE9V10LnGX0kNrJUDUoLHm97oeeZ5G7M6FY0UzF3xaK09DIk0dEQL4kpaKT0Fyfv1jcQrdIlvvNq7SsorJJ86KcelkO0VqtXr3qRpAdQuVZIqXUCoajSRK7TzEAvSv/MdlpPzM7YLqduo7nVPXKqXkUcSOLalFjVZ6aBbHJk7AmmWLFr7NpO0wBdf3NjJnGf47ynnZGWqiK8gYJIX91xnpGUFeSyZO6pXiw/DRuQcsKTzHHGmuB8+heTjBcP+HfkQaFGyWXnfe6nlbXuIIUdp4s0MgV7OcM1JTHeb22is665Chk5MsDG7S47ntS4pD0cHL20ydsDxbSIvdSp+KvXFgZSJ57cwYm91iVRZ/DJFDDl553I2RKzdAsWvyAggIkCJXH5l X-Forefront-PRVS: 01713B2841 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0748; 23:r2BzYW36v4g9MHnkq6YH4COUICaeY0FU18eUh7B?= =?us-ascii?Q?sAQ0QCLqh5rVlx8VXGLgoOp0Cwm5f1aD2vfnuDI2Tg1p1lnE/i+No+EW56QQ?= =?us-ascii?Q?hPYas6KiPJg1YLocvO0RaaHbOkS2A8IT6LwhKkvonxL3bKyciQm/vamIpWVA?= =?us-ascii?Q?1PwHTehDEi2A8El9a4B+CkLj5/uCdBOTEJbgQKMUiToqEeAdh4kSSfD1mmiQ?= =?us-ascii?Q?yzh1GXnRa5xDGkKyRyqY4csWXWzY4fd7u3xdTtDifY2JqHaxQ4Vu1OAsPJMg?= =?us-ascii?Q?QRgN1rGf0PtpSDWobQr81gABaRTYjEbR4UxgPGIBQVGM6EQqgRhALfLp12xv?= =?us-ascii?Q?1ZSVUs3gMcbulzZx+9Qm3irt3KAdngoPZzE8bEGIv0vAjQoelrPg8c7Sy7wF?= =?us-ascii?Q?KpOuospjiAR9Ze/8oA9rR5Q8MXlN/ZCOsrzblca0YeaBluLUkI7vCquFcG3d?= =?us-ascii?Q?5f7QXJvcOwkYLzvp9OBd3SKt37fgoFxEekTeHFkyhmX3dyclxRkFRASG30N8?= =?us-ascii?Q?lFGyZ1zGdn298WtQg202svEdevW0/J/zu4aAucMa4p/+4QRtlYX2WXsuM/rO?= =?us-ascii?Q?oywDEjgOczXcW8WJ21vg/7A/bbPXyYEI9TwRDwPhc1nVON3W/xY5pRj6rIxj?= =?us-ascii?Q?pzQqYm1E+QnBny4E0h5cIW9D88lDq7htBnYlT3eeyLSyaU/zZCI06Dptikik?= =?us-ascii?Q?g6gFj5wE3IXZYdDWDdcwAITe7w54lb2lubpe58MZMtb9wTHOpGO43wUwaCuF?= =?us-ascii?Q?GMiJpYgcI0fA99FPDmT8vXGrygI63z9KALoY+kD4oxDkqJljbMMz5ef8QgBw?= =?us-ascii?Q?bce6tdsvKKpbhOosX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VW709XXeJFJpTnEYqQZXR; 5:T0xzSM41HYHLkgOKXKf+25LKmlZogA+kD4kacC7jwBDTVO07gtp8P0J7dMdilE5GKdhpdcHfrno1C9VwsDV6j9IrVyTzbvMeaafnQRnhNa5fasI8DYtgN/bvm4XGAOaaMd4acyjExkmuGoLQqsnpWzUqq2I6hfrAG6tZ9W5VR3ht/IwWw/eN5KEM9dT0bdUc; 24:pUWSEjfTdLCJV5KffO3eREd54c3ikPTMFQP6rAaYFzM1iiAYAoPWnjdfGq1e/8+yM4f5mdcq/aRg1vjbtx7hLF0SRg89b3V9y3AYKeTzQpc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0748; 7:fc6ctfkpQlmj6jC29MzyNYhAvdqp9jIkTud17xeh+VCp69czdealZwrRQe67TD75oBBYlzpfAV7nkOXsEWGnZAQz5VsNVOdS4XT2uR0bHOv2ayo00jR0FBu7Uz4Q/lE9sA43VitHW+FK5ErCnpdDNeIDu/KME3VkvNWk9rjxTWp+FlA0MuKH+DhGcEFA7GdRj9bv0HsbCYIt3yXZVVNYoSSzD0sle8SA94aqcKLBMVppx3qrqVJhBUyFmJVqmvx5Gn1njcwGJvP0rw8Z1cCAtiPT0jsNTJdsLmSKTjdesaFqeYnvJKnfg9mEjlfDntL+BYiYhryFD3d4+mZINAlIRZipEmUMGqFKo/ZzFO0EdqnCtS+yIh18NkmSmW9l5f5f6gDJ5pZfd/5W29axFeIPvpmwqWew4aDhzq94KwpIm0NuHSM+7LSVMULU4ONGyY/Xx2PbcvCr4lMC5HrzrsvL6g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2016 05:15:21.8856 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0748 Subject: [dpdk-dev] [PATCH v3 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: Thu, 29 Dec 2016 05:15:24 -0000 From: Hemant Agrawal 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 9066aa5..ccd2c2a 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -63,6 +63,7 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) 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 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) 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 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) 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 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) 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 */ }; -- 2.7.4