From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by dpdk.org (Postfix) with ESMTP id 462A9CF9E for ; Fri, 17 Mar 2017 14:09:21 +0100 (CET) Received: from BLUPR0301CA0041.namprd03.prod.outlook.com (10.162.113.179) by BLUPR03MB183.namprd03.prod.outlook.com (10.255.212.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 17 Mar 2017 13:09:20 +0000 Received: from BN1BFFO11OLC001.protection.gbl (2a01:111:f400:7c10::1:131) by BLUPR0301CA0041.outlook.office365.com (2a01:111:e400:5259::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Fri, 17 Mar 2017 13:09:19 +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 BN1BFFO11OLC001.mail.protection.outlook.com (10.58.145.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Fri, 17 Mar 2017 13:09:19 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2HD8peU021077; Fri, 17 Mar 2017 06:09:16 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 17 Mar 2017 18:38:30 +0530 Message-ID: <1489756124-10805-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> References: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> <1489756124-10805-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131342297599228651; (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)(39860400002)(39850400002)(39450400003)(39840400002)(39400400002)(39410400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(106466001)(54906002)(81166006)(53936002)(38730400002)(81156014)(5660300001)(8656002)(77096006)(2351001)(105606002)(33646002)(47776003)(50466002)(8676002)(110136004)(85426001)(104016004)(76176999)(50226002)(8936002)(4326008)(356003)(305945005)(50986999)(189998001)(2906002)(48376002)(5003940100001)(36756003)(6666003)(6916009)(86362001)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB183; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC001; 1:PTRjf4MWyN3yoKGWOuEKMmUoPXoa09gEbKG4HTyl6PsS37IC68HZLReSb8b04gQzqfNocuRzjDNe8MyOauVyIYQ+pW7zS6Fn1yldQjJRKjG8QMwvyhr5kAax6+lB8xwQlWKZEiaqDLo35SlllvSRD/ij8utthgf8Mjz4C1fQydx5SzIUSj8+q1NXVcZGAe4SvhoaGtSsK8nn5IDeDr7n0p4OLZCxbaNsh1roOGj55DczmrT031oAFBwBHhNFtLdLxglLwSZJjMTDgHSayAvJIuk195Zg5XEUfyGcd1WvOb9WfzrDPGgba6cByZds1vYExue9d2iJHZ4ZPQIFy54hIZQBMOMu6ERHBLTm6WxMDy86HMd6yMhMZhv3PYz4E7mLP/t5W3Lj+H1OWVT5qCnVY+BzHRcYtPXBT1kdWx6iSa1Ej5K1wmHSRsLpsdp6BgirHiBmGDiBSb9IJf7rFvK33M6G7Njq8WyzwTxwqvEmWtjh4O4k23su2AZp0jEVJ7PnsbA+ce0qIeTvM/oDX5n9O7bGoMhLkQGL6bcnGpKf3QAry2FkYWADfRrhJCHmhUqcUSqHGPkIoUnshqKfAvyQT/SwejaXUaFm4Mif5z3Dp8gHWz3uB02Wz1TgSBJU8zzzOBp3qKb+31d0ZZJ6Ls9gTg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a5c43654-c498-440e-598c-08d46d36d2d7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BLUPR03MB183; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB183; 3:+SQWOJIvsgwLOSAB+QfrNBSzLU8cxEQEooFIsG3A0x7J9yZu9G7BfgJdNFVxTclfAEq7A/bSK7xjg8docPWnlA/XPxe1fj3z0K8/WQCx0D+1jMr6YxfGMas3I2RrC03zKHzPb89S2PTUEuBD8X9Bbt/1KAgQnXrBT79zUQzDGi0mGM76Mej0eYwSxUDF417sfFYOXdnMdg4E40FXzh2tHH83lcoUrbIntCOl0nvnfSuL4ysJmZDm1NC8v1hZ2feZii0Ksq4yX/m9fTyViqltMsjRPJz02vgKFAcd8FuuLQbN7wWvYkDjiuWdPq1xj0xP9vIqRbWljlbzvjQMzC6+wPcMyfXXBxVyTHz1PjKsb4ABSgW19EA+AuIO+1mUBqyN; 25:HgXknQ9f5N1ASeTc9tF2xGI6NEJpJVGq5CRmMQ51HUZnB3R6XsmdKt+DC9ryDouadbhfedlMRIJWTH/qP02WLlYS2xqgW7flMkJguLJuN+00tpv5+AlA5AqlN2/I5w7QlfJdmz4aoVSEeXqBLuvn8tAO/TqtUN8xbGKyyaHe3seZsweVADuCHIsqYM7BM/XTsgh4TnLFgTR/VqzwSZo0GkCql1uNbzkezKSDAR1esHHqPTt9vd101yVd6O95c1uYU3+IcZnZbHAVN59bnQe7XJkDsz+4KnzTyqWiFt5QjUfWpV3YD7xVLFu15p6NbuQtT1qMJX4F/VxTipJWojMKAEY2xuzvRt23seq0kFStRIzesOVrITiyoaXWvVMR9tdOOm/Eh0M5tJPnVkuTRgCKGUbVfuUynyyYqB/vFnQ9j+Qcr3LEaHcEn27q2T6hoXtBhSEHa1wZFIiesEoUg6nuLA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB183; 31:9fjmeJnN2LP1epHLtLDLuWh8y6G2fJJBsUCjeglmnkP7cb6R+9NUnpxJHF7zykf3HZd0LBJb6Oy/ueWuPr3Ihf0aan4nJQVBxMXEtJEHL+46d8DGGOFxehPHLSIQhR17/yZy8XrZ2Q1nragAaf5CE+qSmbIHnnFe8Lt/mJXGkFyr2KGkqLrb5xLOsGrkZvmXJA91eetG9U8WRv/IuyxRIMtq6OaJdj5a/FzLPL+i4oHPucMhS2UCuWURpQpUCvsvmKEvW82Uoi0aTwMW9rtREA== 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)(5005006)(13015025)(13017025)(13024025)(13023025)(13018025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123556025)(20161123559025)(20161123561025)(20161123565025); SRVR:BLUPR03MB183; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR03MB183; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB183; 4:Tq3huUnP3EjzRjUI0z/dUSXVaP/0Tl2bl0ExbLEZaDcjTG/Oc50RH9d8okBH0pj2XIM7fX2RQ6sD1An8AesFmwHO6pm6lRn+EXX34Vk8+vLIfdX0RYzUDKtGZASSJdsFrwED92xkJVbIxUC5V6CoOuQ34CUbcU8YDCniDt46xP7o0UozKkRRq+PT7B2s3rl3vXiZkilSnxs7QokU8To4V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=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB183; 6:hodJOzu6eyxHOjsn26b3PfeyXG9e2VMqhg1aExNwc5MnX4mrxWB5Lc9HQwWRZTvWXH74lZuS3msmOXPf0BHvxGsRVnXz8N8CS3lsP6GqB134TFZLXvNR2kirPBAVho7QYbM8wz830xDlZLfChm0NhU/rbX4QS+Rj/LG3TvZQY3/9KLu5URcr4ifj6eFTwbalmbq7/S1gg/R+BBFyuA7CO0m6MY28l7+UHRMuOu+/4SqTTuAB/5oRKmLGWK4TB9SD7xfBJJzFfblAjFHuPe/z04erUz9hpr2FmwQMeTHILVnPGGIc8U+JXptO3x1SnEv/zLhutE4fumsvb4VRt6934ja9kwlX7Mp7OiadIOOgeT74e4SnUrsDUxa9+jegcEwtIsRKGeMTylkouwqbtHo8jXOxwmAeq9WLm6aVQt1JXTs=; 5:kLJ6k+NeEccQsFW+YwTT9RkJ5RqhJlPIbHaGubSWEtcVT1C7rKKLAAx948wu9wwp2qODwlHxKOx5TePCoeAF8MusW5rwY3C81NyZWc8qLkvKEVMjVTReY3qO9+9gA/vtsWUejv1sKBJbLlH88UVFEAmscKP2EGOBS2FBIrIeyIq51n9Y7bdSEr8jphtMWFRh; 24:PWQOpNSS+i1FP9diLK6KTt3hZcyYBAH8IS1h0CMKtW6Uxojzfp3KTTRP66hOnkhY+ThfB3V0OUQRiLt2/aePU4pMnFXeOQwvroTCvxdxom4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB183; 7:wpzjo3p0sSvWhimcGnJQ2UqxtXm19bq07PBq4/L0LjZD2dPI6tt8TqhqJbUThMYCICkaQTe2+mmaH34/CuhVsIRQzqnRP7P3SAQBWSY1ZnLp7qqMwhRWGhL20C7X6MJgiM5wb1QcqxQXfBfI50NEeKq3+HKHMQLXk5AFjIzbax91YZ6bseuIawjCxqreVgqnS8HXQtvfR/poo5UEOIOBVyOgxpR4Kt/yufWuTWCviOs3WhJWexAHm+1J5H9AuHV/pAnMeyLRVDj/La3ZhF3efHV21K36DnJWPhvRt/nq3wtduE1Cp6JlXRXb8/KnPyFI6t+pnUQAkR3eJyLZ4wT7JQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 13:09:19.7200 (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: BLUPR03MB183 Subject: [dpdk-dev] [PATCH v9 08/22] 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, 17 Mar 2017 13:09: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 266f70b..47a8788 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