From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0075.outbound.protection.outlook.com [104.47.37.75]) by dpdk.org (Postfix) with ESMTP id 47BC0F967 for ; Wed, 15 Feb 2017 20:07:01 +0100 (CET) Received: from BN6PR03CA0059.namprd03.prod.outlook.com (10.173.137.21) by BN1PR0301MB0724.namprd03.prod.outlook.com (10.160.78.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 19:07:00 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::124) 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.888.16 via Frontend Transport; Wed, 15 Feb 2017 19:06:59 +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;caviumnetworks.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 BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 19:06:59 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1FJ5fLt020023; Wed, 15 Feb 2017 12:06:56 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Thu, 16 Feb 2017 06:09:24 +0530 Message-ID: <1487205586-6785-26-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> References: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316592193795919; (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)(39380400002)(39450400003)(39850400002)(39410400002)(39860400002)(39400400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(356003)(6916009)(38730400002)(5660300001)(5003940100001)(305945005)(48376002)(110136004)(36756003)(626004)(54906002)(86362001)(6666003)(53936002)(33646002)(8936002)(85426001)(106466001)(105606002)(2351001)(2950100002)(76176999)(50466002)(92566002)(47776003)(97736004)(50986999)(8676002)(50226002)(81156014)(77096006)(104016004)(2906002)(81166006)(68736007)(4326007)(389900002)(189998001)(8656002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0724; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD028; 1:EZonBW640tIV+UDOSqNYqThPat/e1ygM8Y1xxbua1q8XbjsBGEYWaacZVzY/6hoVY/8h411ypFh9H5OMvjtv9kKJ8bYn2FzTsr84UoCktwnGLoZxrFJw18mteB7+WGBSRHFI1F6ppdoFf5WQmdcvOW83KGgcfmALePhw+tiHaRX6Av9V4jq2K1Rg5/CUVUv2EUd5okPYLdDen0U9ZdTWJ58mbuefOYN01i9Nj1cGG3X5XcZXBCktPJOSj0oeReWw+bqSH8h1Z+h0fxV3Ji5Z8z0f4WkgL1q3bdxxx0IdIYQzvoXZ05J9/WA9str7JLKeDP9N0VP6VknoGMv1kK+lhuhFuvAhrHLhvZlZ8dHWmn4N8W/3SoZxno+votXGsXLKYHF4Xh1KXZWJruLoj+jSH37YT8Lu8i4clpMI9Bc/N0z73v+/5a9WB5qQq4KrOOiquShtL8+8s6w0jVWvoq0Qpf4wXlrBLucPmmmTC4bNfKLkyedjzpEMMLQXnpz5nMZoX972XAotgPZab/SM4PZhyo1izAQ0WiWSEhSlMpuvAN/ULy6hXvcCV+GhKorqd8W2ifzVJ1ttqXFEHP9OBrHl/6SH6LkZYhJScl+yC/Mr9VymS4iUwAz+RLKBg9Ew0gGxukR6zdnjgBfMUIb2wpLsAw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e57b8b96-11d6-433f-774f-08d455d5d14a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0724; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 3:4O3PgJAcWy/A0VDeyjjlrIxeyqfXNBTUrgXDlJZ+W7HGwsLi9VvsH/SSj1l+blW5hiy7XboVqZs0Cf2LZbAN/n8dVxI6sXBMqLFU4HKsPfAYOST90dC8LvNSDeo2Do1dyH4r1hey3HblHui6Vl2wt5HxADlhhXlI3nI2nGSpo+M/KjsTOwGfUPIy+KJBz3YLtX1gaZMjt19b71Gd6xjiOwd7jq2O5zj/k9xVjw42pJABHAmjZ2ergFsrp8/lT+KgSGfvDmnKqfS8LRD97xcAmp0bERPQnSwOpNSD/FvNWRfOyA13NAbfd5Pb0nLygLW79MutqTdvrkMaHqwYBk9oJZ4L6V3/Q2dKiE9c+gdN42mMTctoQq3ysMCOlkWGxCyg; 25:Pe2Yq4b3KxpcHry4+vnxaYJ2D/MMpqfsAMCeH+1Y+YfZa1tQzB2SLI8SKWfUyk/YeSwO6lvcdLfPXbktPDCD2kjWVX0I5/heORVJdSHKRwjzPiiVDYTM8EAz1yez+pE6qAVeU+LynZ1cMDfkUa+W6tSa99uzEjXi6/26Fmunxa8bZ8jle2RzdAd4OV7GY6eWcaoFw0er/gZB7OSL1cGGYg1VNGJ5rsGs1dpEgmbXpRNMxlIRdfnwKjmbkcREQTKpNlZUJGC6f4EUrZ3bREGYT83hozioOKFzY3BbBmTIPbjLMFUie99Un5tjbEuasTLGi2HqNulzKt/eVaEKwWxb994Tbl6CvNanO+ibESK3WtcC+e++yHH4f4xQZ14ypfoCaBhHN52F2PPO3JiR2dTa/jZzj+vlYqIk6LWGzH6GE7ix4echPgLlcWHcOEwrE0t0+qq89FyCrS6cAT17f26KiA== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 31:njZkIiTzW5T9g8o79vg4/2APUdG/qs9UwSe1lIB8PxN9y7HRRbOxhOp9/c296ov2aexCIEI3mUC0Ut0hPB2R41u6p3Yrt3XFGhm5BplZKkkQ5rbDsxxc2aIxVek7/HQGQgNCuG8t62bcnv+fAcWoxfzSSGOXR1WjrGXBZZG6HFT1jf2ScUOo+dYyoVGtYI4H3f3wM0BJHJnVomGU3Z8CexJW5oP41k/stLf9ft01Kmssh+7AMPhB/06rZYY6cqouDE6GLBJpqs/eUG3EaDcPrg== 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)(13018025)(13024025)(13023025)(13015025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123559025)(20161123563025)(20161123561025); SRVR:BN1PR0301MB0724; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0724; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 4:28nvdVR/PoV+q4SLbQTNPG3prVAxZLDo3pq8DTdQPCgtCdtg6mtnK/bk/GU8iL8qHAv/pjtEQ6SRQ5n5TdCh/8aIPQL/fwUhPMW6RMjST2kwEjQRS7yxjYPlLlpeKdtTLrOkKWgwjswRNgYysZcmM7HkTWp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1NviPn8I1quSRGRA0sAConIhCchT9llV6KxaCUIXJlXbV?= =?us-ascii?Q?Z6338SYvFGX3MWYHp9aTx5iNxXfEY4IA56zlwZuIYIUGQ/jy9VCzc/XmfWbC?= =?us-ascii?Q?kVjDjzMJ3hiDOyEJ5FO4K/Fc8LFpeu5DHdWbhcJe6/Qc2?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 6:7acCTWBHQ7ebXivkMWa67eGW+m4CWJqsQPjnr3JxUsdubcfG3l4zx41vQzzCc3ykD/Jv2377HSZSwxIfiZ6JNcx255J1Jv5qIt5b40kuTWXAj8svXtVZXCyretHLA6QexXBMu6H0sxdIrqszNokE5A+4Mt9uoA4sZt5NGm6A5BC6Kulk/ERgtqp6VLAuULbbet71Q6yr0jWoayw1QbKw1qQkUafjz9REbgZFanB4PMcvD+j+YvvsYZJOB7QFvafTGYR52TQ10BWkuybNRqVNVOHnmOXdMCgB3xXfwgJen/Z/Z+qMIjiLP5rjIb43z+aLK444D7Vzx3DbjwOhufnscQJskXuO+WHaMCsWxocj8rGl6NF3UuXp/8TNjunLWo5NTn8/BC7T6twWCSkATfa/SfbNzCpckUO5lZtvyhesC1c=; 5:eX/uHx7BeR7SAOqBUInhh1HWKS3JFoyE9V5HlKEgg5A7/qla58l2WyAvBw0wuNetUEUTPisZZ0RAePXF+Axg5qzmg2cL7XsLhrh78IVC0lxBWe1zCL2/6LMfpRVIbb3RYsaZvQ8l9TgJag4onEg9ZHBFVxt0AsVCSSScl+D8xGrBPvaxZaVqqNzw8Yvfwss3; 24:0uRbs7N4Le2O4357xuPNCxB7r2X8CBW1KecupXgQt610nRuu8QO7gWtmjC0SoZ4zBGrmN4UTw1PPjyPAef3Vff44pO5IZq4MJlRl8MnBVlE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 7:bHmzpa2I1uKPEOVVf9/8DThoo7eH9p6F1yKm6MYj766sFte1+gF/eHQVHQorpMXWNV6hLqnb5DWMC4hzjPcpJNAfZjw65217HpabEEGhy1Sc53BkrFckPVNzoq6D7uZ/EwqlBdR3nMlDdLKDracf5oz1ByhD5uarwkwm+w0vloB3BkeQ1rC6IDzoM/8Tzr++yGdVEaqDwu+ycHuQsICUVg7V4xVVEoKI/vkOP8h8yeExkNKMS9Bu/jSse254QXvRHvpOW7oHTcNWU3H4X9iCF6VT0sw1mDFtnJmwAPdPaZsp6+szIO1sHOKYwFp7haJaVRApddrbq0sot0P8qtd3Iw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 19:06:59.1611 (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: BN1PR0301MB0724 Subject: [dpdk-dev] [PATCHv7 25/47] 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: Wed, 15 Feb 2017 19:07:02 -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 c14b4df..ab9dfe6 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