From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0069.outbound.protection.outlook.com [104.47.33.69]) by dpdk.org (Postfix) with ESMTP id AFA0BF95D for ; Mon, 23 Jan 2017 13:01:20 +0100 (CET) Received: from BN3PR03CA0098.namprd03.prod.outlook.com (10.174.66.16) by BY2PR0301MB0741.namprd03.prod.outlook.com (10.160.63.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:01:19 +0000 Received: from BL2FFO11FD051.protection.gbl (2a01:111:f400:7c09::123) by BN3PR03CA0098.outlook.office365.com (2603:10b6:400:4::16) 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; Mon, 23 Jan 2017 12:01:19 +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 BL2FFO11FD051.mail.protection.outlook.com (10.173.161.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:01:18 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07ei019311; Mon, 23 Jan 2017 05:01:15 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:29:50 +0530 Message-ID: <1485172803-17288-21-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296464789011304; (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)(39850400002)(39450400003)(39400400002)(39410400002)(39840400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(68736007)(626004)(4326007)(106466001)(2351001)(105606002)(2906002)(5660300001)(81156014)(8676002)(81166006)(33646002)(5003940100001)(47776003)(50226002)(8936002)(6916009)(86362001)(2950100002)(6666003)(305945005)(110136003)(356003)(36756003)(85426001)(8656002)(48376002)(92566002)(50986999)(76176999)(77096006)(189998001)(38730400001)(50466002)(54906002)(104016004)(53936002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0741; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD051; 1:8UQaCpNGf78Ws/l2iccC8vzLoJuXbivRz/TT8nlK60LMUslIJF4TSZL+Eq6KXk5OB7KJ9spLf7hvywjL7FIWhDPNkl0C/5pt42cIlsTEDPcucYfc3l91yBlEoK7Sz7VDf3AabPHWH6ehXNbxfzDn4t/oQ6TfDSrrSVYQmG0tuI3yh+BPBo1n4Fkc28BnzjG9n8evP9kBP2h8NR2GKp7PgOtCraxo9mGrjPkxsOZWR4O4EPrs0LQO1nXm6pI8la61PF+I+OggNCFXRHzqFePhuFWgIJu+lmCKPW3FEJvIAKQSPY7rUEAyXFX8eUB3lMxadeb6BlG4fnBpDOp9BE+zhs69+TlrSpq+IQCoZe4vNW+KpK8Gw/SwWeLcyK2GwtxC73sHAfgYHN9423PtEEcgYbF3xMIXvQrXpKdbG0goNJ7rvjEnIFsiqaQEQi42bpc7qCvGHOkfIoOFte7+fFs1faPLaYX2m3gVgg+Ph57ifHk5pCRgRL+W6c4fUVXdsOY0LTnu20S8925T8Kxl5bnWM3eUBUQSfqQJDgIk3p2zkQCZEUSZXMkmJjqrREDqyDNOa/LaMsG3G7Pcdd37Mt/EVStruO8oXSKct9UhE2NG+6nTGQ2sGh5WEasl1d3mb7JrYV6W9OibLKhZ1Au5N+XrXs0NheH1NIfdAydlH+R9tlGiC3tblyKqfKErgc3AUQK7x59nN1RMVjvGQnc5HzoCCFUGiWeQxL3Ob/v6NAIO9ZFyFJ4RNCClBj5vhjm1pEQk MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4a7b2a3d-1093-43c3-adbc-08d443878a62 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 3:ZVcO5CXDGprD79lXk4gCHYuGMmXBzZy5dv1xY+1O1o87bqrDKWZC/kQxZzjJJ93nygOGPplIQ4hoe3QMKDuVk/pxffxGrYIbJ+Cj9St5t5FNnA+oiTzSvctCxnS+zu1w0hJgaW1Wg1rg0Qv9ZHDPUiwWFBE+1YPuazAguvBaRqJ1hWBgNRoF2IwA32hRPPKq1dMpA/Dbt4q/FoxiAIbJqiKESfb9ZgyqljnKSOHemopx7YeHHs99lQQGiJOxXMVamMcmjbkwen6jAXoWc53M+WWD2EM4zVM11kSTCFwgVgrf8+chD5+gkIbrsZNkAZOHMXkkbI4Ltggv+GHrtBdze9BdLO98g8nkCa1Uilye2HM/Z27zVzpJTggK4RwcFaBh X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 25:LxQlhxc0ZLOB1QyHCfkk2qasfVcEHa9utQJz1OH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4RI0= 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)(13015025)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123556025)(20161123559025)(20161123561025)(20161123565025); SRVR:BY2PR0301MB0741; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 4:3DmMpXYqq2rybOppTmbwAolHxhU6Nvl+sA7+knRide/5AZUf5ZsYT9KOJRapxXgFQCAzX3dfCKeP6teVgj0j1glGZe83rjmdQAwVqwPkvvX9atBHQsmjyV8xhPDGVWVbfUkI03vH3sbqV5a+RjYLD03z/2AMiq6IMgZoDHydgEi0LonAw2A9JOTeFSvcEmrySukOSPpB+TsffCNdgUoYq7ct+C7Yr2rzzWZftR+v3nZ+oV3pF9wT999MMMwebGcdzsHpou31xzIg5DYeEVkNmLjSWenkbdkgx1aVD0jbMcw5Tr6mPsTHqHMQfnyFMxYuQzmTKeZEqxquK0eQUkYyDyMYjhCamS/tyU7o+rY/Ckjx9bDoEq+YGvkTDTNstXhxlN4jrfcdrhkreL9VVNkRGrOi4N4A3tPlD7NLMh0hgWKx9yv+qptRkpeTn/u1MqFTgTcvqMlKRPYMwvr4RwZy+yCWbioxZMBKFJhYT1H93eGsD1yL8HiPA1oJZdFTfcMYdezJyH0ct940xbiGGaDO4RK9Gb5Jjp0/cQ4f+999oY6G5NY6S6BrVhQOF3/jva6sCqLOJEED1/Ffzw/FYKbhhIG5NYWYywLQ8Z2yeY3aqUIA9ggWKujGYm5Ywh16Y6cSUxcf1ZMYkPpqE1uShHytHIs7cUAvAlHMPiXB0PsK1JEO5yyEs6SCm9ISoE4Q9BUQ72mjzL2rv6Wja45/n9tFyUj6soNW4GsB8GibybdehasOWnk1zoNTXRRc8TBb+nT6 X-Forefront-PRVS: 0196A226D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0741; 23:A7vilUhNEDwHRNjvSRxM+HwuagJVaAbzO1vyFvD?= =?us-ascii?Q?IAr6HIZVffRyOV2QsxxSpXloAP/3rY4ooDc8XRm2wZu+l8WRaIAuudguIJxL?= =?us-ascii?Q?9VTvnL6oIIShSvlmhcHO+v1/pGQrP3Xh5mb2rbsc8CSF/pitbQmqxDke4A3c?= =?us-ascii?Q?AnSOAFmZSdhQpThUjXkYz7iQvWBn/89N6XEot8WhMBDUferE9H0wyR4m8m0v?= =?us-ascii?Q?d5LcQ/T0l/5bcfUHLKFFoN8fM6DWsionbzgD008Q8WWXYhRwcHJ9wpmxbEsj?= =?us-ascii?Q?SvngEY11ULsgXrkrolkgOBdl0zp6DIAoQIRESm0xnj2sCRdrNYjTWA5agHZy?= =?us-ascii?Q?X428oHCMvAo65LVmKmjzSAD9huXi9wxarZEHXYLXkYOR16vxc3LTWIgOQAI2?= =?us-ascii?Q?KZ8L0+Bk3qiktFVqmtDiq5hbXDGyWqR//vDx9WFwEZ+yAfh7oLEsw3m4hli7?= =?us-ascii?Q?r7sqUmFBS5nOYBhrZBUa91e1r5F8rmKC3bGLoiqalPqKNF//lN7q2RPiyBEl?= =?us-ascii?Q?yqho2ZHhv4gAYuo6U27cwD37+DfQvzvoIOT7ZYZ6hnlqQ+uXzb0QRbKHiW6i?= =?us-ascii?Q?OD2KvYKV0gJZKfoLfiYkAGj1IrglJ0A1rRNu+8rexqh8nwN0JVCSLT+LbqVw?= =?us-ascii?Q?bda7qRkZ+8QurKs0gpPZ82i4YqEB2bKWmGdmNQqnamg/ATIFinbV+OwqaSsd?= =?us-ascii?Q?Wx+YkGvaK4Thk4kzmqN6gSX5WFv6CyQsonRfAUVf1ayu172ZVX1oaB7UqZH1?= =?us-ascii?Q?Zaw2HgbPubfSucnBIOtz4Fel474uN+84Z9NSD7bl/8Q4c9g4BgJPCA2Gh07K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7qMY4OD/x1RfAipS9LWEalieI9BfuV+e2Mj99perD4Re1Kr8; 5:3N7cU+zoXxHQagYqVP3axe2Qyh8IjPmrM1xvQo+vqGuanmTYMUBpy+R/WLZ/1xYjY8SAIAXpvU7u54g7RXZR+Ql9T6t6M3ZLMspd1T2jDly+ownj7tpu8pCgo3V8hGWj5xalcBMFjyEpkuYyKOFfK+VJ8+5h8QMntU9e92LjnYmeb6+C2/izHpW7HJxtHtRY; 24:PBOS68zTEf7TJpnaOkUWK6HD9GenfLKwx3eSmFZY4bQhYM9i3Moa+VWZ+ZlGyjLNCMtkrwV5iO54ppzwY9QSKWvs88Xd6HHYvr0CZkcNSGU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 7:WvBusMZKC2m+g7nuNTxszIlYlV5Ms9oFZBkFu2CBKJo7sP9cyo5Sgbgm/VHbDSct50Sg9FkwRryNewkjgLxE2UiqftVAUU6/PpaF68s/Hk8lw+uH1MH8x/qzG3tcN0Dqp/pXLeFu89UwGZt1/1ZwBzr6utzWZYEMfQhixXZOsLe7123Vblje08+OkhZ5TY/eBB286ItcT06i7v6ERmUPZB6tdEQjpkErsDg4O4iYdUO1pOogo1O8gjs833ngcdWE3MTAbHUJxndl17s73CSN54Dn/yYwygugbPiLNIVe4Kyb1Untuqee63mpDjobDWnLudloxvDd7OionquH/U0Q5DSKKB/psOx6+Lr9IFCDJBQ79AK8H6C2lIjOeqtU9t+Riz8mxwwGNEE2hupfyDKzgWFJr1UKslgzXJDRmAa6ONfL1ilyriycCT+MzEYRjs5k1Wj4vszv2cK1dPKotAdOtg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:01:18.5735 (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: BY2PR0301MB0741 Subject: [dpdk-dev] [PATCHv6 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: Mon, 23 Jan 2017 12:01:21 -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 87f7640..979dba4 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; @@ -446,6 +447,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); @@ -454,6 +458,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; @@ -492,6 +515,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