From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0060.outbound.protection.outlook.com [104.47.33.60]) by dpdk.org (Postfix) with ESMTP id 49F7AFA3B for ; Mon, 19 Dec 2016 16:21:46 +0100 (CET) Received: from BLUPR0301CA0023.namprd03.prod.outlook.com (10.162.113.161) by BN6PR03MB2466.namprd03.prod.outlook.com (10.168.223.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Mon, 19 Dec 2016 15:21:45 +0000 Received: from BN1AFFO11FD020.protection.gbl (2a01:111:f400:7c10::155) by BLUPR0301CA0023.outlook.office365.com (2a01:111:e400:5259::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 15:21:45 +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 BN1AFFO11FD020.mail.protection.outlook.com (10.58.52.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:21:45 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFKMhk029110; Mon, 19 Dec 2016 08:21:41 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Tue, 20 Dec 2016 02:24:00 +0530 Message-ID: <1482180853-18823-22-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266345052639455; (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)(7916002)(336005)(39450400003)(39400400002)(39860400002)(39840400002)(39850400002)(39380400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(2351001)(86362001)(4326007)(104016004)(92566002)(8666005)(8936002)(2906002)(626004)(97736004)(85426001)(105606002)(356003)(189998001)(305945005)(106466001)(68736007)(69596002)(47776003)(50466002)(50986999)(77096006)(110136003)(2950100002)(6666003)(48376002)(38730400001)(36756003)(5003940100001)(50226002)(76176999)(8676002)(33646002)(81156014)(6916009)(81166006)(5660300001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2466; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD020; 1:qa7xpe54K1gAlZ+6f7k1WkafvhRND/FwKVlHAl7nM9iU9dM8VYzfZS8oyN9K6jF61Id4eZKGBOtKpXJGpteuC2EzJMcko3jovGK/73xOqbxugjw2FxtU651SRL0x7rf7Yg70mu8bkqfiCP40tMmCauA+JKHklCOZJWbfPEVpEzYpzodCYG4/xwg9h9iH8LQ1o5e6U7GIgPbHWojC7p5ags2eP8fViks+7/2dL8SgVZ36gcKkQgOVmG0uUzDgtHvUZ/ualGYoeylkdJ9ves0EKgFcFWhcFRjT2KlYndaQcIX9tC85dUu2+rIJBMzrl1CisvQIJsOuScVxT2LzZGdu2PZJeE2zbzLCffsvgD9fnlYvZZPN3cz/70znLhezky/vRE5cTy7MSFjoYO37yAgipCWW1WmnyytPDHBpDMrKWdcnjceD+JGR5m4hO7azc8mgdkvP8Qx3EYVyDZaiNsRrLdO6T1EkNpAeoee6A/PyjyxV5fWH/dbA9qrhYSdQhta2BGW1Nob3dtz5PXPz2mt0dLmDS0fgodP/Msg1/iAB0tVA969aU4K1rzlNPJLwDwQb9k2TFdlgaVGO/VNaY14giZXPL5ABWH2eQsGGI7HmAmAK0KBYtaZxsfN3qGnHU/cwdIxEcz+XmPnvRvv++x0sg019NVVs8xtM/2ivaxxoQGPren8gCJcyxyk8sBk8EZHMIRvoFEelVwWAVLNiw3cWeh/KXaO3s7g+wceAzz58T2LDQNUNKF8/5bOs8Oin9xPtjxky0nH45b0Wnhf1WPqfFQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ccb9eca2-5ae7-42a9-2f7e-08d42822be48 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2466; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2466; 3:fGNDT+JvC5vgkaWi4m7UErqGfTFrurOqMPohQt1AVoB9UQsKoWv9yqqLb/BrFWSUqmWJzdEUqMyiQBgFEoUUAIPBOYCAxzfwTCP549XeSH3TDJMC4zNvfSbDVPuHbhhqJJGDGs63lQyJuduZJtDygEkOTkrJoQGJN4xfGYPC1OuanSLHQuGOK3iI5RfBbcMw+9DoXmszt+5NGVlSrv54gW4NlJ/UTH01NJgQxfmt07ztGnRFyFfkvlPrTWRWv3nsM/EZJOhj5PmbJxhUwpR9fnjmiuhw1HFqcgnScph0zOrTABBMbmQHhfAhPqsrVwY+vWCnSu3Q7igDHTkhi8ilO/MbXyImRHaTYZgm5zVjVMO7hmfYtr8Q2qNuSi/7TQab; 25:N+IbWAjsCGQPprtU34872L86S6egYsWt0wr7B0L7RJhTJhg7mV4bwqQ0CG7qTf/CdkMBI0M/bJXhJnjox1B91ozUDaKHlZdZrApIZE6oFGhpuO5cYV3pwbGYTwf0oEgAM1S/ds/mE9uKWCoHNQQ9UCruLqeumhXjowDp0I4xktrJ+X0dqRS6yVwWyU7sk/9eICcx0SYA6oBjtxRJLPFDZD9FFFi/hHglEJlC9mFC8sEB0qB+6hHjSlqVU826EZz8W5e999Ewru1Ba9S6sgU4twgkeS80y3ew2zBjt97JkISKzquXzrD8PTtftPBwtonXufbAuTRRmHsn9X8yYEQOaGkZ3gnTQ9QeRRfhwwwIbjPhg7pGOhEXIPhqzlxsHxzIXaVMSb6Vj5uyABvsu1CVtOaKL+3Ex4lmkIVzGK8gwb4tFzdLuPUsyE73tufgvuhzSRzA+ELc7MpkScbiFypYAA== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2466; 31:hU8oQHtU2E1vpyxMDYFpwJK4JQaiJDTrAO7EIEq3DDy++WeEouA89yNJ2/nfId7KG0KApbzVOIdEGij0/wgvMdgrFE8bkLC1zIK0uIeFgyVQudZuvkyogwKULCZUppPD9/NQDlnEwUCht0PzeNsgzDp0zJbUYC+/teow8oGItSr60DScEJf4yzfZnxOx1EpPtWzOb4saCsgiu2L5x44FATcNchu6z5bb/HesvBC4u71vipt4jovnvu4iArfVpUiI9TBsjIAayrsbLd/0BchTSOCpHQoz7tdgTPeKed6mn7Y= 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)(13018025)(13015025)(13024025)(5005006)(13023025)(13017025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123561025)(20161123565025)(20161123556025)(20161123559025); SRVR:BN6PR03MB2466; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2466; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2466; 4:8rvYVGMpWslOI3LBJKqVCOqr96zpUG3s0CKc9Z8iBiIYHI+MKdsG2SmGqGmG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: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2466; 7:MjIh70cG1qjkn09ujAmumhP5Bzle2j/L4DDRiMnvObVTThUJfW7P+Nkrb1uvYk4rSsAifQxiqQI2bwfIE9PzFh9970TvD4LRclZgNtkDUZukMsc4Dos+04/57FTak56PiYmicjp2joJjeet+7NlqLCy1Gj/eGnKjZFKGaDQ9LhPnMrXvZS8OXu3LPjtHEZD7pIpghfzPvo0hNUttPjq7BIzY8mgw4HOQF/T8GOUcN7tb8Ci27tUz8ByZf7FieCjqJk60BLXcf0kO5Vh2Hk+W8DaSdNIggXdv/JVBr7xcx6+OZ3Va4TiZu+J7XSMA1flFpPBchP8m+EQZkRZO6oXwJr09Wr9YPXtS2jr0vzfuqij8+d6dWbGnKEDwZ7tZh14Wyk1QkK7dGAe2LwegDy8aKUC8OMXRgK6QUewSTRJjw8+KoeUfXns1kKDa04lnDAcHxCZINuaAO0DlBjnltdqUMA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:21:45.0143 (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: BN6PR03MB2466 Subject: [dpdk-dev] [PATCHv2 21/34] 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, 19 Dec 2016 15:21:46 -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 9066aa5..ccd2c2a 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