summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stokes <ian.stokes@intel.com>2019-03-29 17:52:17 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-29 19:00:09 +0100
commit29350891c34f9d45bc27a9313079af71a4a40a40 (patch)
tree54f972ae55cf43886c24ecc7f4657bd050108397
parent11e5f7a2b57fcd6763c1e3e77dda7886248e3b68 (diff)
downloaddpdk-next-eventdev-29350891c34f9d45bc27a9313079af71a4a40a40.zip
dpdk-next-eventdev-29350891c34f9d45bc27a9313079af71a4a40a40.tar.gz
dpdk-next-eventdev-29350891c34f9d45bc27a9313079af71a4a40a40.tar.xz
net/ixgbe: set min and max MTU for VF
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 <ian.stokes@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--drivers/net/ixgbe/ixgbe_ethdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 60da350..feec856 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3857,6 +3857,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;
@@ -6344,7 +6345,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);