From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 2F27269F7 for ; Sun, 9 Apr 2017 10:09:43 +0200 (CEST) Received: from DM5PR03CA0057.namprd03.prod.outlook.com (10.174.189.174) by BL2PR03MB386.namprd03.prod.outlook.com (10.141.91.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Sun, 9 Apr 2017 08:09:41 +0000 Received: from BN1AFFO11FD029.protection.gbl (2a01:111:f400:7c10::175) by DM5PR03CA0057.outlook.office365.com (2603:10b6:4:3b::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Sun, 9 Apr 2017 08:09:41 +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 BN1AFFO11FD029.mail.protection.outlook.com (10.58.52.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Sun, 9 Apr 2017 08:09:41 +0000 Received: from DTS-02.ap.freescale.net (DTS-02.ap.freescale.net [10.232.132.223]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3989Aol015502; Sun, 9 Apr 2017 01:09:38 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Sun, 9 Apr 2017 13:41:09 +0530 Message-ID: <1491725483-6619-9-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> References: <1490362538-20854-1-git-send-email-hemant.agrawal@nxp.com> <1491725483-6619-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131361989813668115; (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)(39450400003)(39840400002)(39850400002)(39400400002)(39410400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(2950100002)(6666003)(6916009)(47776003)(5660300001)(105606002)(48376002)(189998001)(106466001)(33646002)(38730400002)(2906002)(85426001)(4326008)(110136004)(50466002)(2351001)(5003940100001)(356003)(8656002)(86362001)(575784001)(50226002)(305945005)(8936002)(53936002)(54906002)(104016004)(8676002)(77096006)(76176999)(36756003)(50986999)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB386; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD029; 1:mHzeoerHXsEkB/2E2fpWz6xQ2i43ngp2Pt4kiOs/UWPWzwbQBz3Pc2sAxuslz6mM9tn0j4156bsDiXZXIwm3YO/L0gbnoPeazpjaYtZ3y2LKykYxMIzP/dUHsp/8qZgbnbPxDPFOqB4CyS2IWZJpdyRTVqwC5g7UUX80qCHyeoevS3iS5jCLpF4iqp4YVL0fcwjhPhr2qTRuL3azd8RJy3YQmEvmjfmCpDr5EtXhMEULeOK5yYklIGu14w8M1LHvn68EhTd86aLuPhsdS7h3qU9aNiwPZ44fWpEaIwnuvhDjjipcmlxtWVPWZLAJhGWz7yo71u4sfJgzLt8LuZYnnEWcW54qmGD3LqkIh/x2FLFR/fPNaTG9vG04VFAsNf3EyzOcVOvElwqLIe1xy579ZonRc8QG60COA8lQtIeC2dhcFeoVcaqWWFTNzKnudwAvxUa0SGP0/gZXFy0svvy/xJBe0Zz2lH14kpRdFlmW9VtCprKBD4OTDlhIVBN7hozUKbfBLSqRiD4YP3rpTMziLHbkmGXVP9L7qGAbVBNKQTYIAsvCXaUW94YOPUXZAnUAk0qQkbETiQFXsq+iBy2q6/lxAZHvqLLXSN2XwWZr5CSnao5tQkf25ljRN32Kg35nqRNJRY6CZyXjuGM81sat2XpDHHqeAZjyak6afBfUCWM= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: baba0ef2-e8d4-4c46-0913-08d47f1fc64c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BL2PR03MB386; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB386; 3:4TSx5mNIEJGeHQ3xgRYA27NgVkoFdcH0s2DpEvdQF79Gxte1K/Qz+Hn7Aj/QWlx6d3mjXmbUB/usLfbWCOmzfwnrhVXMQpDPT9EgaC/i6pytkfITWeKdgyGC9aGjpZijisNWh/0QBYgCNXT3IfFE6aiUt30Fszfs8wPX4mTRvtdmc1cz+Cr6ziFlEzf+H/anJQJVdE8mcQIEv3Lj2EeVRsPCLyJfh6uPjxzvr6+951EZpcPxTQba5PgcfqmW03xG9vilZ9efU+VdZM99yT0TaQDkckn7C0cJu1YrrQgzSUtUwzYUSFLSV7/hlUPRbdup6uT+CeD3TBwhPlLHF73RVhb1+Qg0R0JxpdZgS2Dv/4jJWIQPmpTw/v/Fd3b6v+Pe+VQPDSB+uyJlx8WDSl7NdbZL30BH8RUii/adYqMYpSOTALQRlUYMzcBOwrWUg68H; 25:OMwBjRIyqBK/mFXbsgyAHaPQ18l/tV17UeAUTi3//N2JAzBDjv+2kepM+TYPULZXHGVHPRz8iimOacbG1IEePNeittcRb5YC+c8BeF6uddDF2TYzKIhW7z+3UkegCH67Fu4ukWEtiCnu4WvyydylF2BoZ2eyZuQGZK2lSraewuOsETYrB3VPnPySqYLbjiZiAGp85BXobEYo7g86jhYo3A7+yTFLUFYRszUJnu0QbR8AlHIWqCtUscCLBBPOP8kpT9uWDtWjPe+MoPXQXxEB68HVEIsP+gGueN/lszhw3yS3iJKiFgbeVkuTnoTt/n6gVHLIPJncVlrAWhVxR5YRuYFkJm8ObflXeyCx57OfTUI+ekr+DssOs8MLC25gPN9O2p5pMIfV34Lhd/185rCYtncMzdiGOY0HeCFO0EwzU9AzNyUiyl3gTMl23/dN5JH1OkUFeyPqfWnhTewxNK5/kg== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB386; 31:jWU3K+hJ9hB0m1Pp3VtE2vIXP8h3dtmMqCyjxrpL45TFMgjMlah5yRcrnPTogjuZlyyCiHAXlTTMMpX1DSa2TCI/ardaFAEU46ix/renSTEyfWKhGqU24WJAHmtaaOlz3eAvjj+plnqPoc4h4o1+xmU+v8y31uYTQPKc12QtWsV02x5TSZHn7GHtcC0SNt2uxjAxa5Sp+CPfefuQfZJRQeHmTrl5DMp4EVGt6G1nfQOVWBeT70j8Q8+wrXVpJDKRkh900fZDyLoznk8tJOh/xg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13017025)(13018025)(13024025)(13023025)(8121501046)(13015025)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259075)(20161123556025)(20161123565025)(20161123561025); SRVR:BL2PR03MB386; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB386; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB386; 4:hGcmmLiGTKmq9LLAnw/zT5QNbW1G4UernrzH4vyUrw08kJVgBVHTqKcp2aZE/bknkFKyqo64wkrobBk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sexWg95JJ4kyQwk3YnElDxlKoQenecZmmjuFen+lU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB386; 7:DqTxrDuDYn4JTfou6cCOFC+az/xBmfvXcnzd1/5NL5Bv0lSzfW/YkZDGcCKZmqr3X1SuER+seB3qYIRQOflIMnMndvzSQZdW/RejUVf4eKPYXHqWQbNR+wNxVwIcaPoVm82O8sxuBsYPzyKN+lJ0ghBfmcw+614F9iynnCyTOiV0TJ7lSNXeZw9wxng0qV8W76hVBanszhlFwyQsCgOxBj55TnAojNKXTckxfiRKPe21xb5ZhODmEDydH+S49I82j6cBbdl6DMiTDu5f2B3xI/hwF1BQEs/UrGLvnsfSBkN9uAHngYPktVH8ov6pyRct04kKR6Fh2sZC5f1Ro1fdGw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2017 08:09:41.1952 (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: BL2PR03MB386 Subject: [dpdk-dev] [PATCH v11 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: Sun, 09 Apr 2017 08:09:43 -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 92d334c..6462e0b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -62,6 +62,7 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) 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 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) 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 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) 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 @@ dpaa2_dev_uninit(struct rte_eth_dev *eth_dev) 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 */ }; -- 2.1.4