From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AE2F06A94 for ; Tue, 6 Dec 2016 20:50:06 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 06 Dec 2016 11:50:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="1078335493" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by fmsmga001.fm.intel.com with ESMTP; 06 Dec 2016 11:50:03 -0800 To: Hemant Agrawal , dev@dpdk.org References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1480875447-23680-23-git-send-email-hemant.agrawal@nxp.com> Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, shreyansh.jain@nxp.com From: Ferruh Yigit Message-ID: Date: Tue, 6 Dec 2016 19:50:00 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480875447-23680-23-git-send-email-hemant.agrawal@nxp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [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: Tue, 06 Dec 2016 19:50:07 -0000 On 12/4/2016 6:17 PM, Hemant Agrawal wrote: > 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; Patch does a little more than what it says, this can be added to prev patch that introduces dpaa2_dev_info_get() > } > > static int > @@ -444,6 +448,9 @@ Overall this makes harder to review, there is no function name provided int the patch, this is same for all patchset. There was a .gitattributes patch in the mail list for this, can you please get it before sending next revision of patches. > > 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; > } >