From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <qi.z.zhang@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 5857E2082
 for <dev@dpdk.org>; Tue,  7 May 2019 03:51:42 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 May 2019 18:51:41 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,440,1549958400"; d="scan'208";a="155824436"
Received: from dpdk51.sh.intel.com ([10.67.110.245])
 by FMSMGA003.fm.intel.com with ESMTP; 06 May 2019 18:51:39 -0700
From: Qi Zhang <qi.z.zhang@intel.com>
To: wenzhuo.lu@intel.com,
	qiming.yang@intel.com
Cc: ian.stokes@intel.com, ferruh.yigit@intel.com, dev@dpdk.org,
 Qi Zhang <qi.z.zhang@intel.com>
Date: Tue,  7 May 2019 09:53:46 +0800
Message-Id: <20190507015346.32214-1-qi.z.zhang@intel.com>
X-Mailer: git-send-email 2.13.6
Subject: [dpdk-dev] [PATCH v2] net/ice: set min and max MTU
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 07 May 2019 01:51:42 -0000

This commit sets the min and max supported MTU values for ice devices
via the ice_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2:
- fix typo

 drivers/net/ice/ice_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 1f06a2c80..9f5f919f4 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1994,6 +1994,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_tx_queues = vsi->nb_qps;
 	dev_info->max_mac_addrs = vsi->max_macaddrs;
 	dev_info->max_vfs = pci_dev->max_vfs;
+	dev_info->max_mtu = dev_info->max_rx_pktlen - ICE_ETH_OVERHEAD;
+	dev_info->min_mtu = ETHER_MIN_MTU;
 
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
-- 
2.13.6

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 27381A0096
	for <public@inbox.dpdk.org>; Tue,  7 May 2019 03:51:46 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A97DC28FD;
	Tue,  7 May 2019 03:51:44 +0200 (CEST)
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 5857E2082
 for <dev@dpdk.org>; Tue,  7 May 2019 03:51:42 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 May 2019 18:51:41 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,440,1549958400"; d="scan'208";a="155824436"
Received: from dpdk51.sh.intel.com ([10.67.110.245])
 by FMSMGA003.fm.intel.com with ESMTP; 06 May 2019 18:51:39 -0700
From: Qi Zhang <qi.z.zhang@intel.com>
To: wenzhuo.lu@intel.com,
	qiming.yang@intel.com
Cc: ian.stokes@intel.com, ferruh.yigit@intel.com, dev@dpdk.org,
 Qi Zhang <qi.z.zhang@intel.com>
Date: Tue,  7 May 2019 09:53:46 +0800
Message-Id: <20190507015346.32214-1-qi.z.zhang@intel.com>
X-Mailer: git-send-email 2.13.6
Subject: [dpdk-dev] [PATCH v2] net/ice: set min and max MTU
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190507015346.o4CpyoR4M384opVGCOGvB3XT_rx-IdxAHbtlCrC8RUE@z>

This commit sets the min and max supported MTU values for ice devices
via the ice_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2:
- fix typo

 drivers/net/ice/ice_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 1f06a2c80..9f5f919f4 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1994,6 +1994,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_tx_queues = vsi->nb_qps;
 	dev_info->max_mac_addrs = vsi->max_macaddrs;
 	dev_info->max_vfs = pci_dev->max_vfs;
+	dev_info->max_mtu = dev_info->max_rx_pktlen - ICE_ETH_OVERHEAD;
+	dev_info->min_mtu = ETHER_MIN_MTU;
 
 	dev_info->rx_offload_capa =
 		DEV_RX_OFFLOAD_VLAN_STRIP |
-- 
2.13.6