From patchwork Wed Feb 27 21:45:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Stokes X-Patchwork-Id: 50557 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 828004C8E; Wed, 27 Feb 2019 22:46:04 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4963B4C88 for ; Wed, 27 Feb 2019 22:46:03 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 13:46:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,420,1544515200"; d="scan'208";a="127759276" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by fmsmga008.fm.intel.com with ESMTP; 27 Feb 2019 13:46:01 -0800 From: Ian Stokes To: dev@dpdk.org Cc: stephen@networkplumber.org, Ian Stokes Date: Wed, 27 Feb 2019 21:45:47 +0000 Message-Id: <1551303948-19746-6-git-send-email-ian.stokes@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1551303948-19746-1-git-send-email-ian.stokes@intel.com> References: <1551303948-19746-1-git-send-email-ian.stokes@intel.com> Subject: [dpdk-dev] [PATCH v1 5/6] net/ixgbe: set min and max MTU for ixgbe VF devices 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit sets the min and max supported MTU values for ixgbe VF devices via the ixgbevf_dev_set_mtu() 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. As transport overhead is the same for VF and PF ixgbe devices, reuse MACRO 'IXGBE_ETH_OVERHEAD' to avoid duplication. Signed-off-by: Ian Stokes --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index c4f6ff5bd..1a92a71cd 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3843,6 +3843,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev, dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues; dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL reg */ dev_info->max_rx_pktlen = 9728; /* includes CRC, cf MAXFRS reg */ + dev_info->max_mtu = dev_info->max_rx_pktlen - IXGBE_ETH_OVERHEAD; dev_info->max_mac_addrs = hw->mac.num_rar_entries; dev_info->max_hash_mac_addrs = IXGBE_VMDQ_NUM_UC_MAC; dev_info->max_vfs = pci_dev->max_vfs; @@ -6330,7 +6331,7 @@ static int ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) { struct ixgbe_hw *hw; - uint32_t max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + uint32_t max_frame = mtu + IXGBE_ETH_OVERHEAD; struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);