From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0051.outbound.protection.outlook.com [104.47.33.51]) by dpdk.org (Postfix) with ESMTP id 77241F97D for ; Fri, 3 Mar 2017 08:14:23 +0100 (CET) Received: from BN3PR0301CA0053.namprd03.prod.outlook.com (10.160.152.149) by CY4PR03MB2949.namprd03.prod.outlook.com (10.175.116.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 07:14:22 +0000 Received: from BY2FFO11FD020.protection.gbl (2a01:111:f400:7c0c::139) by BN3PR0301CA0053.outlook.office365.com (2a01:111:e400:401e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Fri, 3 Mar 2017 07:14:21 +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; 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 BY2FFO11FD020.mail.protection.outlook.com (10.1.14.137) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 07:14:21 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v237D50R005035; Fri, 3 Mar 2017 00:14:18 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 3 Mar 2017 18:16:41 +0530 Message-ID: <1488545223-25739-25-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> References: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131329988614085940; (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)(39840400002)(39860400002)(39410400002)(39400400002)(39380400002)(39450400003)(39850400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(50226002)(110136004)(356003)(38730400002)(36756003)(189998001)(86362001)(5660300001)(85426001)(104016004)(626004)(8936002)(50466002)(33646002)(48376002)(305945005)(2950100002)(2351001)(81166006)(2906002)(47776003)(6916009)(6666003)(50986999)(76176999)(53936002)(105606002)(5003940100001)(77096006)(8656002)(8676002)(92566002)(54906002)(106466001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2949; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD020; 1:bXPnpxm6R5ks+C1p6uYQ0oAvBAamaP1TyKtYTGZvizGZOmy+egNFgUOZe85yB8CLLRzH9o3k+zFqn2tQMybadzKZizoA50Fj4RdPIU1AR/Dis+5DlrgCzkSKkY1HwfGW3T0mwhSFH728GZvlbUqc3NXgbJXMBSWRikf2Qc7eeZNbSPbAV5JtW7wSUUpVuQRKaqBskz1sWOA7kMXmIP5FY2LIJtkxS0Jmrw2aobKLh6uaGOuAIaU5bhWqjqAg09PuzbQsKjKnbP6gJtwbkfwf1rsSmBAwqeykd2ryn+j7e6rZ8k/92yggpuFQffPuF47tUuX/Rj0F6+cjgo/L5Mq0++uFzEJ0mGT3tN2DV5QCyXm24M0/aoUveGWYbePMfJepGTF5BAAX+NcfdawDOPWIuGG8ZnlnFZAelS2UJ6482+IyxkkbNxp8BtsmnNoQmjJ7j9/P4oGoHr8/K858JKNkz/MAfmLD9XqU6YJMMtbVsS5PsaKs3GSU3dEmnM5PLyPVjApRoxZpIjCRXl3dYGnYRHqwGvemJSZ1PqNV6kNb7QQPYaO9Po/vq3eHa6iG/P0Ee84qeDgJ8CWjGel4UJu0ad4YD+bSUKBL8f32UTUsk2778e3Id/fA7qsT2wdGHQb6fGhOzXtP7roW0X1NqW2Qwg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 70f79614-7690-4fda-dd34-08d46204ea29 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2949; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 3:s2MFakCFZml9fpWExjP/Gp4wp/zU06APK28h27gnfe/Q5ruf6I0QMQz77LmMgn04G5yUle9GCyO4NyWwBdZEb+PqtB9BuChITJFRC4BZXELW1RSTEfwMfDQKm/L0fSmyT87pMTjFnQTmugtzhsbNpaXmkW4RdW0ubeTId+/PCd1/IEGGaxgrQ/cfTcPfBD4+eQRoAncN0824vq5EffQsr6Sn5uaOE6DK2kr6Y99cJtr/Mwbjg+eTz/AqEsKCNU+ndumC/YJGeWIXt7WA2vx6gcUGygtFd7AGlCZ1wyjCnSY7LX7Icq5ksxxJ7XhOLHcJoGdY9VNBRmNZ1Zm36OXPzi0TdHNnGbyWiSD1HpXM1oLoKGGv0Xlo7UTmDk1+G6Fe; 25:XYr4eiU724bSxLV4tVUB6Hf4SOgP3W3BaaJh4lhMqsdRjf7mlu1AvUF26FYqttNYoV0W273Gjzd95VJeSTuSLqWIJpL6w9wJZqpKXnSc8xa/FZtRHxqzftyUWK/dz8X54G8HmM5h2Idj4KrqRDk1zu+oaesaTKUg7JzKeZchcRV64s7i78d9XFn6SaYyalUmLF9CwsDOyV5MREgri3NvGS2owH6jNauIBi1rLV9OwCiHYWlM+h3YknMfzWaiQG5kCcNcTw744It5b39be8vhk4E1Ao9STkp6yhWyBTJ7NJpFcgX89dnfq5CpHDP+eRAbrAJB4aepBQkFKbbmJiQziKemVScisj5OLzWxpmhf5bazjCpObyfCymYnd4U3uLC9F9vzXyLahxKI02bisMnWJGVL44zauM6EwCF91iJSMM0H3iCrrGrAHGBCyzJhKVstHrf0VF6fj/f+fwvC4kkfzQ== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 31:eC1GeaN/PcNvu3aRXJH3TuCH0NLdM0TgMAwZrNhJPt9ZURtUezA2B7ScjxCyaxhANjptALWyN/gJkCdcUvVBBkB15GuOwMetdWGqO1xgLQkPs7pXmr1kWgUzV0g+NeWY7bNfB5H3GreBL7FW+pqW284GuqwgZLQYMfd1D+Jv/E1d5UbRntLR52LOIt+RIJAjZTkVGw0QgfcuxDzckgRdlS3uWxmxZJEiQh2VEP9r1wpnDmiHJCFiy7Ue1Gg5nnuX67VuCUItnHzYKbYR1sMYlw== 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)(5005006)(8121501046)(13018025)(13015025)(13017025)(13023025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123565025)(20161123556025)(20161123563025)(20161123561025); SRVR:CY4PR03MB2949; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2949; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2949; 4:oL+EkW+6QoCe5EHZ8deSyk56npgMe6F3O3ZRm8l2TqDPOHAz1WRrkpBZFgkNexVjpix0CzVDUKOJ/rDCiTa0UgIrMQwleLMSXrOJCnGR4diXe2dEPRiHU+844Fy6pJLwx1fvQM+mOaq1/6Bx1Gg9kb3HjWyqNQxXDmEteMSr/t7onwXCoDx48aRgHopzFlR8nwJDFEdUIuTjlsDn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VIlw+ON2i3/qMijypGAXU5dIcWlgEfRP2lkEYXRjovf1q29W7jZCtMpDJVxDYzFUgY5XhOUGqTws6WXUgo4Yy1gRwpigO5Kd7v4hA9fDHFLLOoVP4HCNKhKdOfJFkyd5OwRsmJDCV4kHKB72iditgqryhndWLzLKQfHFSg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 07:14:21.2213 (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: CY4PR03MB2949 Subject: [dpdk-dev] [PATCHv8 24/46] 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: Fri, 03 Mar 2017 07:14:24 -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