From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0045.outbound.protection.outlook.com [104.47.38.45]) by dpdk.org (Postfix) with ESMTP id F3EE0FA45 for ; Sun, 4 Dec 2016 13:44:34 +0100 (CET) Received: from BN6PR03CA0010.namprd03.prod.outlook.com (10.168.230.148) by DM2PR0301MB0751.namprd03.prod.outlook.com (10.160.97.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8; Sun, 4 Dec 2016 12:44:34 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::138) by BN6PR03CA0010.outlook.office365.com (2603:10b6:404:23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Sun, 4 Dec 2016 12:44:33 +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 BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Sun, 4 Dec 2016 12:44:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:715; Count:10 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uB4ChXbP032240; Sun, 4 Dec 2016 05:44:30 -0700 From: Hemant Agrawal To: CC: , , , Hemant Agrawal Date: Sun, 4 Dec 2016 23:47:17 +0530 Message-ID: <1480875447-23680-23-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131253290727955047; (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)(2980300002)(1109001)(1110001)(339900001)(336004)(189002)(199003)(305945005)(85426001)(2950100002)(5660300001)(8676002)(106466001)(38730400001)(356003)(2906002)(6916009)(81166006)(39450400002)(6666003)(8666005)(77096006)(7846002)(39380400001)(39400400001)(104016004)(626004)(81156014)(39410400001)(110136003)(50226002)(92566002)(4326007)(97736004)(76176999)(36756003)(50466002)(86362001)(68736007)(47776003)(105606002)(189998001)(33646002)(5003940100001)(50986999)(2351001)(8936002)(48376002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0751; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:KDZ0OiapmUchNIa4tSC9rwLqlrlx9LDKQniuWjppQHPtjRNI4Crjir9Zg2Xt2Abr0cTLnCK33Aeyubz3pv+XlijR6qBykvrc9+r4gSnjvueutakXGT1ZtWOkmCcCHmqjkArH01kVHYfQdtThieW9/NNls6B3TD1z2eOXwghhx37HDKDfd9fTR+KINnZ5Z58w6tv4QdGdv0hdzDBmPT3xBAMYGmKUrctUPOZMoF5k/CfYWBEJL2j8z2VvbElJr6K5UOVd3tAwunTAQiMzqQEPWHOiGfRtb7bNccnSwXS51CvZhIquRyAmGdF4Z9jD+Too5NkBpwWiu8yGyDQ47jg5+Hf2dYzPPzvkMN0u/7I+2E42qNT2M6sZtWJJtlPwaJpyPEnEhPgHeRflfo5z8X0sgHpIVuZmJfyJdGY4guBoVd0/VO+BerKkkLDTxZikv1LFjpVhJ4ug7+ITAaDRK4dVPp93ICp2OXqv97k39tMXMqr7klHHJtMJznfbNbuywd7KwT7vS+1x71SKF7GMi4aditnWvFyT3f7lXkPoD3vlxbXCsyKg9KNDA2/AYEjgg+WTY0UInA1YqYZ+FAZe2/QzkYplEKmv5OUqDIaN5ampTmZWiAntNtka1TDygmJq49oxamf8JrLjZkagPbHHruGCOWifV4ToZeSt12t6c0VNSjP4oxBGMomZ6jXztPC6OHZqXTrt3yAX1BhdNk+QwtlJpU+LLEhOkaVehw4JqM1MGue+RX6arChhqObF3xeL7NJovfwZQ1UHHmYvvl542tFfOw== MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0751; 2:r7SHePvUkxDjQgrlcEKtQzIowWFqlANL7tYuxAL/+yaQqRr1vegH+rGK1HAseg2HXhQ1hfK4/GMfGhL3XuyCd/ObvIglsXNuEKY0JwruMx/X9pm2CIgx8qI4no1kHZtvz1zxJzSmTPx5hkSRMlNU27duxw/mdKOQdK3LLJLbyk4=; 3:lqu6wsfoit5z/oeSZ1g/RNQ5VrmhKXWtiaSBO1j1z9YAebTehYKemUFY7W5/EH508WKDJvA/7Hmp3MQc6hyu8+4eDRXJTzn9OK3rQraZpdllUK5n5ygYp62KxsRUJQV5mv4ARQHMNbdGfbwwegoCKQ0g1vR/7xnBW2XZ6wTQFhFMB741/Be0CWoLPYzXALdjFjZhYfjLKcxEYhgziLVDKxvQ4QYW1JYrqPv8aWbZwq9lNJ+fDhJUZhUPde9E9FVyWnSbuPc4ghU9uXmJobE6Kg==; 25:BssT1xc5eO6Xh/ui5suwEVhjA9DbsUgXLEkRnXM8QejoUBGJz9z35iGc3qki0bckHj2tJv/5U6krn63203S9+P/jP//OKODbnrwVzneyVtmetfiwAcchzNZUfIOQM370Qgv3N8n52jZyjdV1XB/h3yXl870JwOGihKBDixyb/iUrW/HW1QrjLFYWWyIrG7q6ndhDpajIGa4jTyey3gJj4fXL2qyt2PNdaKk5IoQehjmwpt76N4QIkI7C3Xa843BDPSf4UVE6AEvoyXPx6CJj5NFNV8RDOZhcULTufJH4fFhwj83yTNis0UYceOc3UmF1US+FxoPyx9reEjVx2n+1DKOWYzpNolJspltopRxKmV5MZNi8ZD7gGLBO2e5qeEYWb2QCMTtuh3ySe+3qj6XaLkYBp7v+qXDujLEhLkiSUe1Mb91sCtlp8NluMPhVTX/m0mKQBaKvwcHzfIYj49uZYw== X-MS-Office365-Filtering-Correlation-Id: 7c983e5a-3c0e-4130-7906-08d41c434be5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0751; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0751; 31:p6hhHFjt7TSpJxBgK2cysmIIyBGp15uiVv+2cp+cR+ItjqwPp2MAUhQy6u2xFeD87sl48Yz0MalHqMFhVFqax2oKfiDSoajM4kzWQQjAfIBqJ6DJKd7KJLGgf+AhBjndWQ85c9ahr7xzQjqxehpYJOo+L/X2JJX28xpzhInsO9qO+wCwUHKYbBaXzuuzuQm0ZujTPD97ex6l4nx6Q+h01SnVwL6IDyHZWJBp/tR4LAL5sT/hD5sKDUbEMVibGFfkMpxLMYwSeiQlkabbaxUZFeP0GLnuHkxq5ro3pKY9FSg= 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)(13017025)(13018025)(13023025)(13015025)(5005006)(13024025)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123565025)(20161123563025)(20161123556025)(20161123561025); SRVR:DM2PR0301MB0751; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0751; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0751; 4:VhtlRgvSnsnC0dm9GM5mfG6fN8SqwZtyg4ofVS8JRtRobb8/aUbAkdHuhJ+9MuEyujXte5r98VGgGJeBxmmt68TnwGNw4sCdh+SUX2ezgsR05710LLfwuUGiHBmQGO8IlOZOm9M1/aqxfuxH4KFuVrEJbtgq8O9w9oK061EpjgVdWSNojvWiUGlWJqk6589Xvp185oQNorCzRfkCPE9YY7RZ2Sb677WzWZbg4zSS9bW2s9YapUFcPrjTFrPNnanYpcOu0UnjqxNZGNS/h09BKfQGkIB/aup4v/IxrpaJYtL97Z03Dty85ALh8ByE5Dsu8GZcd6ubjPo7GOzXMyVfHKXG6za1B8vXvsOsUmjwrVh9mWXsWunihDM2Q+leXZO6XnaHrRRC3haFVCXHhni5U8CIZicds3hHMQ5WcARkY27I/Um7nJyNcyHHD7rJD/J5gwb9pdR7fzjlXl9O4BIFTc8ymvVOtRVxYUY55gTbpffsaa5wRq9g8TFW8SeBt2ly5PtaPvRMNHt0gpMzmd9sjE2ctnBb3RmX36zM6f5h2PR+TFOf24Ypay8ZfAEX4eA1qx+8RgKnJqKpQoycPo+6xP7I5FQbE+WLsbKjjd1Zywjy88TYIXXjAT8R+g2I5oMoBODRT7Fm3dhui9xXDkDPupG/pLu4l3AK1ADmRfu8x4gNmFtKJZkKxFMPWe5NC0QnUMrdTbGQzF1UaTJEyP4xy58qSjY7nYs15mtgT0gezhaim0ACW2kGPxbiSx1XmJKs X-Forefront-PRVS: 014617085B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0751; 23:Zqu9H7YCzPKxMecDgzt9CFpQ/mm385tFs8VBp9n?= =?us-ascii?Q?byWTsnJ6JzzKkaNwb+yYrY7GZLua+S+ILlVYWSDrWbujJ+LHdIYvN31cpUKB?= =?us-ascii?Q?lnoS9RND7gtJadG74oj3zF6EuuDLS2R4ArFZsKUJ6oM7zdbV7VExSh41pgaj?= =?us-ascii?Q?tH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l8MVYhw63CDk?= =?us-ascii?Q?nOeZv71UvkH9thbQvcZuClLH6rMGmBExeU2+66bP/V0VvdPaJUw987WRyRgc?= =?us-ascii?Q?hVTd4GrmMPtKLuiA6EsTnhsDDPR9BF064T0Wp3W77UtVK9i5RKbEzq2trFCa?= =?us-ascii?Q?jlAL4AsD13wBqvXA1pWQ1/KU4881jkkM9CpeFDTKhhpQ06/CMHqA7FLORxQ?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0751; 6:mlzjf/FAx6Ns3CMEmtqCSbyZJHyQo3xhTf3uhVm7rWel+gSDoiJqf35wbyrPZR6GcvTE+mBWOTm17ad/K8BvVqDQ+chK32Qh+cH5XLMpVAEK1yAENod5D4DmblKMC7Tw/ghWMmxPgOhGQTLeo7XRwfT1GQxFPHX+lzDq8zLfhn2tqIeI1GteqDxsVQCi/Db2GQNjONUa1sak3UvfeAYn2W/ixZqw86KTKoJc7xAoTGohTMed1AX2/e88SCj049bqVy+ncg8uAhXRv8WKYIgjdMqb0cLoNawhHN+EDSIKY5FJld51KYGrHTE3Li3dMbJ6dEaO2BMEBpOiDxhcDB554w==; 5:dGJbeFExB3/JcVz+S3p1gyu0zqcZ4716oeq7ZksP49bTJ8jXRqOv+hBdR8QOmYqaU9szXxEciTyd7U94GykwFtnUsT2VowwnnHKePbvSWQk6o5ryCgY9IvimcqPh7oDMLa+TgrIkyPneQfepz4eJi4YB8JipIecUc82SRZeXiyZNFNDmrSiRldalRaPCpu1w; 24:lMIPq/lj9+t/5JYP70GJ3MviqbsDelz5k14ojr2H80bcnsciUdzVrs+vBN3nM4DfgIgrg1owjjYU0tTH1v4w1nSeTiTFa7ohQ5AANamYoXs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0751; 7:iIoAmU8mlTXqqt1nEZUlLtiufrx3Vn6dhbLfve+dlLDng1ITzpufaratPPK2nlN+otmI94+CLEAgY6NBHSbhW+9di9R1luJz8cEwvusGBEjfk4Y8jiYTWwBveL/OalP5jn3WhJFl0SX+IOhaEkkkqUj7BZETiATAEJJBocffT+IBYVmc0D7siahZE8boZgNx9aTYx7s70dYvZrJdzj8g803qRljS7URd7mZ9g3sJ01D6eJTT1vGm0ccVkfw69IqeI9S2iFmDBFw1tEnKMlQHi3Js/pfc1T6K2zsBxti9UoeaZjXX9Vsh8aPciQCvz5LplZeec/5rh7vyNGrVLnDF0PDmp//0PxdrVV9Y/+3mYRI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2016 12:44:32.5615 (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: DM2PR0301MB0751 Subject: [dpdk-dev] [PATCH 22/32] 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: Sun, 04 Dec 2016 12:44:35 -0000 Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpni.h | 3 +++ drivers/net/dpaa2/dpaa2_ethdev.c | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h index c109396..70d52b6 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.h +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h @@ -63,7 +63,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 */ }; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 094296a..65c3384 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -64,8 +64,12 @@ dev_info->driver_name = drivername; 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; + dev_info->speed_capa = ETH_LINK_SPEED_1G | + ETH_LINK_SPEED_2_5G | + ETH_LINK_SPEED_10G; } static int @@ -444,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); @@ -452,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; return 0; } -- 1.9.1