ethdev: fix max Rx packet length
Subsystems (3)
PATCH v7 3/6 ethdev: move check to library for MTU set
In reply to Ferruh YigitMove requested MTU value check to the API to prevent the duplicated code.
--- drivers/net/axgbe/axgbe_ethdev.c | 15 ++++----------- drivers/net/bnxt/bnxt_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 13 +------------ drivers/net/dpaa/dpaa_ethdev.c | 2 -- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ---- drivers/net/e1000/em_ethdev.c | 10 ---------- drivers/net/e1000/igb_ethdev.c | 11 ----------- drivers/net/enetc/enetc_ethdev.c | 4 ---- drivers/net/hinic/hinic_pmd_ethdev.c | 8 +------- drivers/net/i40e/i40e_ethdev.c | 17 ++++------------- drivers/net/iavf/iavf_ethdev.c | 10 ++-------- drivers/net/ice/ice_ethdev.c | 14 +++----------- drivers/net/igc/igc_ethdev.c | 5 ----- drivers/net/ipn3ke/ipn3ke_representor.c | 6 ------ drivers/net/liquidio/lio_ethdev.c | 10 ---------- drivers/net/nfp/nfp_common.c | 4 ---- drivers/net/octeontx/octeontx_ethdev.c | 4 ---- drivers/net/octeontx2/otx2_ethdev_ops.c | 4 ---- drivers/net/qede/qede_ethdev.c | 12 ------------ drivers/net/thunderx/nicvf_ethdev.c | 6 ------ drivers/net/txgbe/txgbe_ethdev.c | 10 ---------- lib/ethdev/rte_ethdev.c | 9 +++++++++ 22 files changed, 25 insertions(+), 155 deletions(-)
drivers/net/axgbe/axgbe_ethdev.c +4 -11
@@ -1478,25 +1478,18 @@ axgbe_dev_supported_ptypes_get(struct rte_eth_dev *dev)static int axgb_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { -struct rte_eth_dev_info dev_info;struct axgbe_port *pdata = dev->data->dev_private; -uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ; -unsigned int val =0 ; -axgbe_dev_info_get (dev, &dev_info); -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) -return -EINVAL ; +unsigned int val; +/* mtu setting is forbidden if port is start */ if (dev->data->dev_started) {PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , dev->data->port_id);return -EBUSY ; } -if (mtu >RTE_ETHER_MTU ) - val =1 ; -else - val =0 ; + val = mtu >RTE_ETHER_MTU ?1 :0 ;AXGMAC_IOWRITE_BITS (pdata,MAC_RCR ,JE , val); +return 0 ; }
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -3029,7 +3029,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)uint32_t overhead =BNXT_MAX_PKT_LEN -BNXT_MAX_MTU ;struct bnxt *bp = eth_dev->data->dev_private;uint32_t new_pkt_size; -uint32_t rc =0 ; +uint32_t rc;uint32_t i; rc =is_bnxt_in_error (bp);
drivers/net/cxgbe/cxgbe_ethdev.c +1 -12
@@ -301,21 +301,10 @@ int cxgbe_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) {struct port_info *pi = eth_dev->data->dev_private;struct adapter *adapter = pi->adapter; -struct rte_eth_dev_info dev_info; -int err;uint16_t new_mtu = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ; - err =cxgbe_dev_info_get (eth_dev, &dev_info); -if (err !=0 ) -return err; - -/* Must accommodate at least RTE_ETHER_MIN_MTU */ -if (mtu <RTE_ETHER_MIN_MTU || new_mtu > dev_info.max_rx_pktlen) -return -EINVAL ; - - err =t4_set_rxmode (adapter, adapter->mbox, pi->viid, new_mtu,-1 ,-1 , +return t4_set_rxmode (adapter, adapter->mbox, pi->viid, new_mtu,-1 ,-1 ,-1 ,-1 , true); -return err; }/*
drivers/net/dpaa/dpaa_ethdev.c +0 -2
@@ -167,8 +167,6 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)PMD_INIT_FUNC_TRACE (); -if (mtu <RTE_ETHER_MIN_MTU || frame_size >DPAA_MAX_RX_PKT_LEN ) -return -EINVAL ;/* * Refuse mtu that requires the support of scattered packets * when this feature has not been enabled before.
drivers/net/dpaa2/dpaa2_ethdev.c +0 -4
@@ -1461,10 +1461,6 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)return -EINVAL ; } -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size >DPAA2_MAX_RX_PKT_LEN ) -return -EINVAL ; -/* Set the Max Rx frame length as 'mtu' + * Maximum Ethernet header length */
drivers/net/e1000/em_ethdev.c +0 -10
@@ -1786,22 +1786,12 @@ eth_em_default_mac_addr_set(struct rte_eth_dev *dev,static int eth_em_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) { -struct rte_eth_dev_info dev_info;struct e1000_hw *hw;uint32_t frame_size;uint32_t rctl; -int ret; - - ret =eth_em_infos_get (dev, &dev_info); -if (ret !=0 ) -return ret; frame_size = mtu +E1000_ETH_OVERHEAD ; -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) -return -EINVAL ; -/* * If device is started, refuse mtu that requires the support of * scattered packets when this feature has not been enabled before.
drivers/net/e1000/igb_ethdev.c +0 -11
@@ -4359,9 +4359,7 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {uint32_t rctl;struct e1000_hw *hw; -struct rte_eth_dev_info dev_info;uint32_t frame_size = mtu +E1000_ETH_OVERHEAD ; -int ret; hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);
@@ -4370,15 +4368,6 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)if (hw->mac.type == e1000_82571)return -ENOTSUP ;#endif - ret =eth_igb_infos_get (dev, &dev_info); -if (ret !=0 ) -return ret; - -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || - frame_size > dev_info.max_rx_pktlen) -return -EINVAL ; -/* * If device is started, refuse mtu that requires the support of * scattered packets when this feature has not been enabled before.
drivers/net/enetc/enetc_ethdev.c +0 -4
@@ -666,10 +666,6 @@ enetc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)struct enetc_hw *enetc_hw = &hw->hw;uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ; -/* check that mtu is within the allowed range */ -if (mtu <ENETC_MAC_MINFRM_SIZE || frame_size >ENETC_MAC_MAXFRM_SIZE ) -return -EINVAL ; -/* * Refuse mtu that requires the support of scattered packets * when this feature has not been enabled before.
drivers/net/hinic/hinic_pmd_ethdev.c +1 -7
@@ -1534,17 +1534,11 @@ static void hinic_deinit_mac_addr(struct rte_eth_dev *eth_dev)static int hinic_dev_set_mtu (struct rte_eth_dev *dev,uint16_t mtu) {struct hinic_nic_dev *nic_dev =HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV (dev); -int ret =0 ; +int ret;PMD_DRV_LOG (INFO ,"Set port mtu, port_id: %d, mtu: %d, max_pkt_len: %d" , dev->data->port_id, mtu,HINIC_MTU_TO_PKTLEN (mtu)); -if (mtu <HINIC_MIN_MTU_SIZE || mtu >HINIC_MAX_MTU_SIZE ) { -PMD_DRV_LOG (ERR ,"Invalid mtu: %d, must between %d and %d" , - mtu,HINIC_MIN_MTU_SIZE ,HINIC_MAX_MTU_SIZE ); -return -EINVAL ; - } - ret =hinic_set_port_mtu (nic_dev->hwdev, mtu);if (ret) {PMD_DRV_LOG (ERR ,"Set port mtu failed, ret: %d" , ret);
drivers/net/i40e/i40e_ethdev.c +4 -13
@@ -11419,25 +11419,16 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev, }static int -i40e_dev_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) { -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data->dev_private); -struct rte_eth_dev_data *dev_data = pf->dev_data; -uint32_t frame_size = mtu +I40E_ETH_OVERHEAD ; -int ret =0 ; - -/* check if mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size >I40E_FRAME_SIZE_MAX ) -return -EINVAL ; -/* mtu setting is forbidden if port is start */ -if (dev_data->dev_started) { +if (dev->data->dev_started !=0 ) {PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , - dev_data->port_id); + dev->data->port_id);return -EBUSY ; } -return ret; +return 0 ; }/* Restore ethertype filter */
drivers/net/iavf/iavf_ethdev.c +2 -8
@@ -1459,21 +1459,15 @@ iavf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, }static int -iavf_dev_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) { -uint32_t frame_size = mtu +IAVF_ETH_OVERHEAD ; -int ret =0 ; - -if (mtu <RTE_ETHER_MIN_MTU || frame_size >IAVF_FRAME_SIZE_MAX ) -return -EINVAL ; -/* mtu setting is forbidden if port is start */ if (dev->data->dev_started) {PMD_DRV_LOG (ERR ,"port must be stopped before configuration" );return -EBUSY ; } -return ret; +return 0 ; } static int
drivers/net/ice/ice_ethdev.c +3 -11
@@ -3974,21 +3974,13 @@ ice_dev_set_link_down(struct rte_eth_dev *dev) }static int -ice_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) +ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused) { -struct ice_pf *pf =ICE_DEV_PRIVATE_TO_PF (dev->data->dev_private); -struct rte_eth_dev_data *dev_data = pf->dev_data; -uint32_t frame_size = mtu +ICE_ETH_OVERHEAD ; - -/* check if mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size >ICE_FRAME_SIZE_MAX ) -return -EINVAL ; -/* mtu setting is forbidden if port is start */ -if (dev_data->dev_started) { +if (dev->data->dev_started !=0 ) {PMD_DRV_LOG (ERR ,"port %d must be stopped before configuration" , - dev_data->port_id); + dev->data->port_id);return -EBUSY ; }
drivers/net/igc/igc_ethdev.c +0 -5
@@ -1575,11 +1575,6 @@ eth_igc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)if (IGC_READ_REG (hw,IGC_CTRL_EXT ) &IGC_CTRL_EXT_EXT_VLAN ) frame_size +=VLAN_TAG_SIZE ; -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || - frame_size >MAX_RX_JUMBO_FRAME_SIZE ) -return -EINVAL ; -/* * If device is started, refuse mtu that requires the support of * scattered packets when this feature has not been enabled before.
drivers/net/ipn3ke/ipn3ke_representor.c +0 -6
@@ -2768,12 +2768,6 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu)int ret =0 ;struct ipn3ke_rpst *rpst =IPN3KE_DEV_PRIVATE_TO_RPST (ethdev);struct rte_eth_dev_data *dev_data = ethdev->data; -uint32_t frame_size = mtu +IPN3KE_ETH_OVERHEAD ; - -/* check if mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || - frame_size >IPN3KE_MAC_FRAME_SIZE_MAX ) -return -EINVAL ;/* mtu setting is forbidden if port is start */ /* make sure NIC port is stopped */
drivers/net/liquidio/lio_ethdev.c +0 -10
@@ -434,7 +434,6 @@ static int lio_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) {struct lio_device *lio_dev =LIO_DEV (eth_dev); -uint16_t pf_mtu = lio_dev->linfo.link.s.mtu;struct lio_dev_ctrl_cmd ctrl_cmd;struct lio_ctrl_pkt ctrl_pkt;
@@ -446,15 +445,6 @@ lio_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)return -EINVAL ; } -/* check if VF MTU is within allowed range. -* New value should not exceed PF MTU. -*/ -if (mtu <RTE_ETHER_MIN_MTU || mtu > pf_mtu) { -lio_dev_err (lio_dev,"VF MTU should be >= %d and <= %d\n" , -RTE_ETHER_MIN_MTU , pf_mtu); -return -EINVAL ; - } -/* flush added to prevent cmd failure * incase the queue is full */
drivers/net/nfp/nfp_common.c +0 -4
@@ -951,10 +951,6 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) hw =NFP_NET_DEV_PRIVATE_TO_HW (dev->data->dev_private); -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || (uint32_t )mtu > hw->max_mtu) -return -EINVAL ; -/* mtu setting is forbidden if port is started */ if (dev->data->dev_started) { PMD_DRV_LOG(ERR, "port %d must be stopped before configuration",
drivers/net/octeontx/octeontx_ethdev.c +0 -4
@@ -524,10 +524,6 @@ octeontx_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)struct rte_eth_dev_data *data = eth_dev->data;int rc =0 ; -/* Check if MTU is within the allowed range */ -if (frame_size <OCCTX_MIN_FRS || frame_size >OCCTX_MAX_FRS ) -return -EINVAL ; - buffsz = data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM ;/* Refuse MTU that requires the support of scattered packets
drivers/net/octeontx2/otx2_ethdev_ops.c +0 -4
@@ -20,10 +20,6 @@ otx2_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)if (dev->configured &&otx2_ethdev_is_ptp_en (dev)) frame_size +=NIX_TIMESYNC_RX_OFFSET ; -/* Check if MTU is within the allowed range */ -if (frame_size <NIX_MIN_FRS || frame_size >NIX_MAX_FRS ) -return -EINVAL ; - buffsz = data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM ;/* Refuse MTU that requires the support of scattered packets
drivers/net/qede/qede_ethdev.c +0 -12
@@ -2307,7 +2307,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) {struct qede_dev *qdev =QEDE_INIT_QDEV (dev);struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -struct rte_eth_dev_info dev_info = {0 };struct qede_fastpath *fp;uint32_t frame_size;uint16_t bufsz;
@@ -2315,19 +2314,8 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)int i, rc;PMD_INIT_FUNC_TRACE (edev); - rc =qede_dev_info_get (dev, &dev_info); -if (rc !=0 ) { -DP_ERR (edev,"Error during getting ethernet device info\n" ); -return rc; - } frame_size = mtu +QEDE_MAX_ETHER_HDR_LEN ; -if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) { -DP_ERR (edev,"MTU %u out of range, %u is maximum allowable\n" , - mtu, dev_info.max_rx_pktlen -RTE_ETHER_HDR_LEN - -QEDE_ETH_OVERHEAD ); -return -EINVAL ; - }if (!dev->data->scattered_rx && frame_size > dev->data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM ) { DP_INFO(edev, "MTU greater than minimum RX buffer size of %u\n",
drivers/net/thunderx/nicvf_ethdev.c +0 -6
@@ -154,12 +154,6 @@ nicvf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)PMD_INIT_FUNC_TRACE (); -if (frame_size >NIC_HW_MAX_FRS ) -return -EINVAL ; - -if (frame_size <NIC_HW_MIN_FRS ) -return -EINVAL ; - buffsz = dev->data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM ;/*
drivers/net/txgbe/txgbe_ethdev.c +0 -10
@@ -3459,18 +3459,8 @@ static int txgbe_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {struct txgbe_hw *hw =TXGBE_DEV_HW (dev); -struct rte_eth_dev_info dev_info;uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ;struct rte_eth_dev_data *dev_data = dev->data; -int ret; - - ret =txgbe_dev_info_get (dev, &dev_info); -if (ret !=0 ) -return ret; - -/* check that mtu is within the allowed range */ -if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) -return -EINVAL ;/* If device is started, refuse mtu that requires the support of * scattered packets when this feature has not been enabled before.
lib/ethdev/rte_ethdev.c +9 -0
@@ -3660,6 +3660,9 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)* which relies on dev->dev_ops->dev_infos_get. */ if (*dev->dev_ops->dev_infos_get !=NULL ) { +uint16_t overhead_len; +uint32_t frame_size; + ret =rte_eth_dev_info_get (port_id, &dev_info);if (ret !=0 )return ret;
@@ -3667,6 +3670,12 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu)return -EINVAL ; + overhead_len =eth_dev_get_overhead_len (dev_info.max_rx_pktlen, + dev_info.max_mtu); + frame_size = mtu + overhead_len; +if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) +return -EINVAL ; +if ((dev_info.rx_offload_capa &DEV_RX_OFFLOAD_JUMBO_FRAME ) !=0 ) is_jumbo_frame_capable =1 ; }
Signature · 1 line
2.31.1
PATCH v7 4/6 ethdev: remove jumbo offload flag
In reply to Ferruh YigitRemoving 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.
Instead of drivers announce this capability, application can deduct the capability by checking reported 'dev_info.max_mtu' or 'dev_info.max_rx_pktlen'.
And instead of application setting this flag explicitly to enable jumbo frames, this can be deduced by driver by comparing requested 'mtu' to 'RTE_ETHER_MTU'.
Removing this additional configuration for simplification.
--- app/test-eventdev/test_pipeline_common.c | 2 - app/test-pmd/cmdline.c | 2 +- app/test-pmd/config.c | 25 +--------- app/test-pmd/testpmd.c | 48 +------------------ app/test-pmd/testpmd.h | 2 +- doc/guides/howto/debug_troubleshoot.rst | 2 - doc/guides/nics/bnxt.rst | 1 - doc/guides/nics/features.rst | 3 +- drivers/net/atlantic/atl_ethdev.c | 1 - drivers/net/axgbe/axgbe_ethdev.c | 1 - drivers/net/bnx2x/bnx2x_ethdev.c | 1 - drivers/net/bnxt/bnxt.h | 1 - drivers/net/bnxt/bnxt_ethdev.c | 10 +--- drivers/net/bonding/rte_eth_bond_pmd.c | 8 ---- drivers/net/cnxk/cnxk_ethdev.h | 6 +-- drivers/net/cnxk/cnxk_ethdev_ops.c | 1 - drivers/net/cxgbe/cxgbe.h | 1 - drivers/net/cxgbe/cxgbe_ethdev.c | 8 ---- drivers/net/cxgbe/sge.c | 5 +- drivers/net/dpaa/dpaa_ethdev.c | 2 - drivers/net/dpaa2/dpaa2_ethdev.c | 2 - drivers/net/e1000/e1000_ethdev.h | 4 +- drivers/net/e1000/em_ethdev.c | 4 +- drivers/net/e1000/em_rxtx.c | 19 +++----- drivers/net/e1000/igb_rxtx.c | 3 +- drivers/net/ena/ena_ethdev.c | 1 - drivers/net/enetc/enetc_ethdev.c | 3 +- drivers/net/enic/enic_res.c | 1 - drivers/net/failsafe/failsafe_ops.c | 2 - drivers/net/fm10k/fm10k_ethdev.c | 1 - drivers/net/hinic/hinic_pmd_ethdev.c | 1 - drivers/net/hns3/hns3_ethdev.c | 1 - drivers/net/hns3/hns3_ethdev_vf.c | 1 - drivers/net/i40e/i40e_ethdev.c | 1 - drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/iavf/iavf_ethdev.c | 3 +- drivers/net/ice/ice_dcf_ethdev.c | 3 +- drivers/net/ice/ice_dcf_vf_representor.c | 1 - drivers/net/ice/ice_ethdev.c | 1 - drivers/net/ice/ice_rxtx.c | 3 +- drivers/net/igc/igc_ethdev.h | 1 - drivers/net/igc/igc_txrx.c | 2 +- drivers/net/ionic/ionic_ethdev.c | 1 - drivers/net/ipn3ke/ipn3ke_representor.c | 3 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_pf.c | 9 +--- drivers/net/ixgbe/ixgbe_rxtx.c | 3 +- drivers/net/mlx4/mlx4_rxq.c | 1 - drivers/net/mlx5/mlx5_rxq.c | 1 - drivers/net/mvneta/mvneta_ethdev.h | 3 +- drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/nfp/nfp_common.c | 6 +-- drivers/net/octeontx/octeontx_ethdev.h | 1 - drivers/net/octeontx2/otx2_ethdev.h | 1 - drivers/net/octeontx_ep/otx_ep_ethdev.c | 3 +- drivers/net/octeontx_ep/otx_ep_rxtx.c | 6 --- drivers/net/qede/qede_ethdev.c | 1 - drivers/net/sfc/sfc_rx.c | 2 - drivers/net/thunderx/nicvf_ethdev.h | 1 - drivers/net/txgbe/txgbe_rxtx.c | 1 - drivers/net/virtio/virtio_ethdev.c | 1 - drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 - examples/ip_fragmentation/main.c | 3 +- examples/ip_reassembly/main.c | 3 +- examples/ipsec-secgw/ipsec-secgw.c | 2 - examples/ipv4_multicast/main.c | 1 - examples/kni/main.c | 5 -- examples/l3fwd-acl/main.c | 4 +- examples/l3fwd-graph/main.c | 4 +- examples/l3fwd-power/main.c | 4 +- examples/l3fwd/main.c | 4 +- .../performance-thread/l3fwd-thread/main.c | 4 +- examples/vhost/main.c | 5 +- lib/ethdev/rte_ethdev.c | 26 +--------- lib/ethdev/rte_ethdev.h | 1 - 75 files changed, 48 insertions(+), 259 deletions(-)
app/test-eventdev/test_pipeline_common.c +0 -2
@@ -199,8 +199,6 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) port_conf.rxmode.mtu = opt->max_pkt_sz -RTE_ETHER_HDR_LEN -RTE_ETHER_CRC_LEN ; -if (port_conf.rxmode.mtu >RTE_ETHER_MTU ) - port_conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; t->internal_port =1 ;RTE_ETH_FOREACH_DEV (i) {
app/test-pmd/cmdline.c +1 -1
@@ -1911,7 +1911,7 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,return ; } -update_jumbo_frame_offload (port_id, res->value); +update_mtu_from_frame_size (port_id, res->value); }init_port_config ();
app/test-pmd/config.c +2 -23
@@ -1206,40 +1206,19 @@ port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t reg_v)void port_mtu_set (portid_t port_id,uint16_t mtu) { +struct rte_port *port = &ports[port_id];int diag; -struct rte_port *rte_port = &ports[port_id]; -struct rte_eth_dev_info dev_info; -int ret;if (port_id_is_invalid (port_id,ENABLED_WARN ))return ; - ret =eth_dev_info_get_print_err (port_id, &dev_info); -if (ret !=0 ) -return ; - -if (mtu > dev_info.max_mtu || mtu < dev_info.min_mtu) { -fprintf (stderr, -"Set MTU failed. MTU:%u is not in valid range, min:%u - max:%u\n" , - mtu, dev_info.min_mtu, dev_info.max_mtu); -return ; - } diag =rte_eth_dev_set_mtu (port_id, mtu);if (diag !=0 ) {fprintf (stderr,"Set MTU failed. diag=%d\n" , diag);return ; } - rte_port->dev_conf.rxmode.mtu = mtu; - -if (dev_info.rx_offload_capa &DEV_RX_OFFLOAD_JUMBO_FRAME ) { -if (mtu >RTE_ETHER_MTU ) - rte_port->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; -else - rte_port->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; - } + port->dev_conf.rxmode.mtu = mtu; }/* Generic flow management functions. */
app/test-pmd/testpmd.c +2 -46
78 lines not on this page · raw message
app/test-pmd/testpmd.h +1 -1
@@ -1045,7 +1045,7 @@ uint16_t tx_pkt_set_dynf(uint16_t port_id, __rte_unused uint16_t queue, __rte_unused void *user_param);void add_tx_dynf_callback (portid_t portid);void remove_tx_dynf_callback (portid_t portid); -int update_jumbo_frame_offload (portid_t portid,uint32_t max_rx_pktlen); +int update_mtu_from_frame_size (portid_t portid,uint32_t max_rx_pktlen);/* * Work-around of a compilation error with ICC on invocations of the
doc/guides/howto/debug_troubleshoot.rst +0 -2
@@ -71,8 +71,6 @@ RX Port and associated core :numref:`dtg_rx_rate`. * Identify if port Speed and Duplex is matching to desired values with ``rte_eth_link_get``. - * Check ``DEV_RX_OFFLOAD_JUMBO_FRAME`` is set with ``rte_eth_dev_info_get``. - * Check promiscuous mode if the drops do not occur for unique MAC address with ``rte_eth_promiscuous_get``.
doc/guides/nics/bnxt.rst +0 -1
@@ -885,7 +885,6 @@ processing. This improved performance is derived from a number of optimizations: DEV_RX_OFFLOAD_VLAN_STRIP DEV_RX_OFFLOAD_KEEP_CRC - DEV_RX_OFFLOAD_JUMBO_FRAME DEV_RX_OFFLOAD_IPV4_CKSUM DEV_RX_OFFLOAD_UDP_CKSUM DEV_RX_OFFLOAD_TCP_CKSUM
doc/guides/nics/features.rst +1 -2
@@ -165,8 +165,7 @@ Jumbo frame Supports Rx jumbo frames. -* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``. - ``dev_conf.rxmode.mtu``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``dev_conf.rxmode.mtu``. * **[related] rte_eth_dev_info**: ``max_rx_pktlen``. * **[related] API**: ``rte_eth_dev_set_mtu()``.
drivers/net/atlantic/atl_ethdev.c +0 -1
@@ -158,7 +158,6 @@ static struct rte_pci_driver rte_atl_pmd = { | DEV_RX_OFFLOAD_IPV4_CKSUM \ |DEV_RX_OFFLOAD_UDP_CKSUM \ |DEV_RX_OFFLOAD_TCP_CKSUM \ - |DEV_RX_OFFLOAD_JUMBO_FRAME \ |DEV_RX_OFFLOAD_MACSEC_STRIP \ | DEV_RX_OFFLOAD_VLAN_FILTER)
drivers/net/axgbe/axgbe_ethdev.c +0 -1
@@ -1217,7 +1217,6 @@ axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)DEV_RX_OFFLOAD_IPV4_CKSUM |DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_KEEP_CRC ;
drivers/net/bnx2x/bnx2x_ethdev.c +0 -1
@@ -535,7 +535,6 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_pktlen =BNX2X_MAX_RX_PKT_LEN ; dev_info->max_mac_addrs =BNX2X_MAX_MAC_ADDRS ; dev_info->speed_capa =ETH_LINK_SPEED_10G |ETH_LINK_SPEED_20G ; - dev_info->rx_offload_capa =DEV_RX_OFFLOAD_JUMBO_FRAME ; dev_info->rx_desc_lim.nb_max =MAX_RX_AVAIL ; dev_info->rx_desc_lim.nb_min =MIN_RX_SIZE_NONTPA ;
drivers/net/bnxt/bnxt.h +0 -1
@@ -595,7 +595,6 @@ struct bnxt_rep_info {DEV_RX_OFFLOAD_TCP_CKSUM | \DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ -DEV_RX_OFFLOAD_JUMBO_FRAME | \DEV_RX_OFFLOAD_KEEP_CRC | \DEV_RX_OFFLOAD_VLAN_EXTEND | \ DEV_RX_OFFLOAD_TCP_LRO | \
drivers/net/bnxt/bnxt_ethdev.c +2 -8
@@ -736,15 +736,10 @@ static int bnxt_start_nic(struct bnxt *bp)unsigned int i, j;int rc; -if (bp->eth_dev->data->mtu >RTE_ETHER_MTU ) { - bp->eth_dev->data->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; +if (bp->eth_dev->data->mtu >RTE_ETHER_MTU ) bp->flags |=BNXT_FLAG_JUMBO ; - }else { - bp->eth_dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; +else bp->flags &= ~BNXT_FLAG_JUMBO ; - }/* THOR does not support ring groups. * But we will use the array to save RSS context IDs.
@@ -1254,7 +1249,6 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) if (eth_dev->data->dev_conf.rxmode.offloads & ~(DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_KEEP_CRC | - DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM |
drivers/net/bonding/rte_eth_bond_pmd.c +0 -8
@@ -1724,14 +1724,6 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, slave_eth_dev->data->dev_conf.rxmode.mtu = bonded_eth_dev->data->dev_conf.rxmode.mtu; -if (bonded_eth_dev->data->dev_conf.rxmode.offloads & -DEV_RX_OFFLOAD_JUMBO_FRAME ) - slave_eth_dev->data->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; -else - slave_eth_dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; - nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; nb_tx_queues = bonded_eth_dev->data->nb_tx_queues;
drivers/net/cnxk/cnxk_ethdev.h +3 -3
@@ -78,9 +78,9 @@#define CNXK_NIX_RX_OFFLOAD_CAPA \ (DEV_RX_OFFLOAD_CHECKSUM | DEV_RX_OFFLOAD_SCTP_CKSUM | \ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_SCATTER | \ - DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \ - DEV_RX_OFFLOAD_RSS_HASH | DEV_RX_OFFLOAD_TIMESTAMP | \ - DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_SECURITY) + DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | DEV_RX_OFFLOAD_RSS_HASH | \ + DEV_RX_OFFLOAD_TIMESTAMP | DEV_RX_OFFLOAD_VLAN_STRIP | \ + DEV_RX_OFFLOAD_SECURITY)#define RSS_IPV4_ENABLE \ (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP | \
drivers/net/cnxk/cnxk_ethdev_ops.c +0 -1
@@ -92,7 +92,6 @@ cnxk_nix_rx_burst_mode_get(struct rte_eth_dev *eth_dev, uint16_t queue_id, {DEV_RX_OFFLOAD_HEADER_SPLIT, " Header Split,"}, {DEV_RX_OFFLOAD_VLAN_FILTER, " VLAN Filter,"}, {DEV_RX_OFFLOAD_VLAN_EXTEND, " VLAN Extend,"}, - {DEV_RX_OFFLOAD_JUMBO_FRAME, " Jumbo Frame,"}, {DEV_RX_OFFLOAD_SCATTER, " Scattered,"}, {DEV_RX_OFFLOAD_TIMESTAMP, " Timestamp,"}, {DEV_RX_OFFLOAD_SECURITY, " Security,"},
drivers/net/cxgbe/cxgbe.h +0 -1
@@ -51,7 +51,6 @@DEV_RX_OFFLOAD_IPV4_CKSUM | \DEV_RX_OFFLOAD_UDP_CKSUM | \DEV_RX_OFFLOAD_TCP_CKSUM | \ -DEV_RX_OFFLOAD_JUMBO_FRAME | \DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_RSS_HASH)
drivers/net/cxgbe/cxgbe_ethdev.c +0 -8
@@ -660,14 +660,6 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, rxq->rspq.size = temp_nb_desc; rxq->fl.size = temp_nb_desc; -/* Set to jumbo mode if necessary */ -if (eth_dev->data->mtu >RTE_ETHER_MTU ) - eth_dev->data->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; -else - eth_dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; - err = t4_sge_alloc_rxq(adapter, &rxq->rspq, false, eth_dev, msi_idx, &rxq->fl, NULL, is_pf4(adapter) ?
drivers/net/cxgbe/sge.c +1 -4
@@ -365,13 +365,10 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,struct rte_mbuf *buf_bulk[n];int ret, i;struct rte_pktmbuf_pool_private *mbp_priv; -u8 jumbo_en = rxq->rspq.eth_dev->data->dev_conf.rxmode.offloads & -DEV_RX_OFFLOAD_JUMBO_FRAME ;/* Use jumbo mtu buffers if mbuf data room size can fit jumbo data. */ mbp_priv =rte_mempool_get_priv (rxq->rspq.mb_pool); -if (jumbo_en && - ((mbp_priv->mbuf_data_room_size -RTE_PKTMBUF_HEADROOM ) >=9000 )) +if ((mbp_priv->mbuf_data_room_size -RTE_PKTMBUF_HEADROOM ) >=9000 ) buf_size_idx =RX_LARGE_MTU_BUF ; ret =rte_mempool_get_bulk (rxq->rspq.mb_pool, (void *)buf_bulk, n);
drivers/net/dpaa/dpaa_ethdev.c +0 -2
@@ -54,7 +54,6 @@/* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_SCATTER ;/* Rx offloads which cannot be disabled */
@@ -592,7 +591,6 @@ dpaa_dev_rx_burst_mode_get(struct rte_eth_dev *dev,uint64_t flags;const char *output; } rx_offload_map[] = { - {DEV_RX_OFFLOAD_JUMBO_FRAME, " Jumbo frame,"}, {DEV_RX_OFFLOAD_SCATTER, " Scattered,"}, {DEV_RX_OFFLOAD_IPV4_CKSUM, " IPV4 csum,"}, {DEV_RX_OFFLOAD_UDP_CKSUM, " UDP csum,"},
drivers/net/dpaa2/dpaa2_ethdev.c +0 -2
@@ -44,7 +44,6 @@ static uint64_t dev_rx_offloads_sup =DEV_RX_OFFLOAD_OUTER_UDP_CKSUM |DEV_RX_OFFLOAD_VLAN_STRIP |DEV_RX_OFFLOAD_VLAN_FILTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_TIMESTAMP ;/* Rx offloads which cannot be disabled */
@@ -298,7 +297,6 @@ dpaa2_dev_rx_burst_mode_get(struct rte_eth_dev *dev, {DEV_RX_OFFLOAD_OUTER_UDP_CKSUM, " Outer UDP csum,"}, {DEV_RX_OFFLOAD_VLAN_STRIP, " VLAN strip,"}, {DEV_RX_OFFLOAD_VLAN_FILTER, " VLAN filter,"}, - {DEV_RX_OFFLOAD_JUMBO_FRAME, " Jumbo frame,"}, {DEV_RX_OFFLOAD_TIMESTAMP, " Timestamp,"}, {DEV_RX_OFFLOAD_RSS_HASH, " RSS,"}, {DEV_RX_OFFLOAD_SCATTER, " Scattered,"}
drivers/net/e1000/e1000_ethdev.h +2 -2
@@ -465,8 +465,8 @@ void eth_em_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);void em_dev_clear_queues (struct rte_eth_dev *dev);void em_dev_free_queues (struct rte_eth_dev *dev); -uint64_t em_get_rx_port_offloads_capa (struct rte_eth_dev *dev); -uint64_t em_get_rx_queue_offloads_capa (struct rte_eth_dev *dev); +uint64_t em_get_rx_port_offloads_capa (void ); +uint64_t em_get_rx_queue_offloads_capa (void ); int eth_em_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id,
drivers/net/e1000/em_ethdev.c +2 -2
@@ -1081,8 +1081,8 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues =1 ; dev_info->max_tx_queues =1 ; - dev_info->rx_queue_offload_capa =em_get_rx_queue_offloads_capa (dev); - dev_info->rx_offload_capa =em_get_rx_port_offloads_capa (dev) | + dev_info->rx_queue_offload_capa =em_get_rx_queue_offloads_capa (); + dev_info->rx_offload_capa =em_get_rx_port_offloads_capa () | dev_info->rx_queue_offload_capa; dev_info->tx_queue_offload_capa =em_get_tx_queue_offloads_capa (dev); dev_info->tx_offload_capa = em_get_tx_port_offloads_capa(dev) |
drivers/net/e1000/em_rxtx.c +7 -12
@@ -1364,12 +1364,9 @@ em_reset_rx_queue(struct em_rx_queue *rxq) }uint64_t -em_get_rx_port_offloads_capa (struct rte_eth_dev *dev) +em_get_rx_port_offloads_capa (void ) {uint64_t rx_offload_capa; -uint32_t max_rx_pktlen; - - max_rx_pktlen =em_get_max_pktlen (dev); rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |
@@ -1379,14 +1376,12 @@ em_get_rx_port_offloads_capa(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_KEEP_CRC |DEV_RX_OFFLOAD_SCATTER ; -if (max_rx_pktlen >RTE_ETHER_MAX_LEN ) - rx_offload_capa |=DEV_RX_OFFLOAD_JUMBO_FRAME ;return rx_offload_capa; }uint64_t -em_get_rx_queue_offloads_capa (struct rte_eth_dev *dev) +em_get_rx_queue_offloads_capa (void ) {uint64_t rx_queue_offload_capa;
@@ -1395,7 +1390,7 @@ em_get_rx_queue_offloads_capa(struct rte_eth_dev *dev)* capability be same to per port queue offloading capability * for better convenience. */ - rx_queue_offload_capa =em_get_rx_port_offloads_capa (dev); + rx_queue_offload_capa =em_get_rx_port_offloads_capa ();return rx_queue_offload_capa; }
@@ -1826,7 +1821,7 @@ eth_em_rx_init(struct rte_eth_dev *dev)* to avoid splitting packets that don't fit into * one buffer. */ -if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME || +if (dev->data->mtu >RTE_ETHER_MTU || rctl_bsize <RTE_ETHER_MAX_LEN ) {if (!dev->data->scattered_rx)PMD_INIT_LOG (DEBUG ,"forcing scatter mode" );
@@ -1861,14 +1856,14 @@ eth_em_rx_init(struct rte_eth_dev *dev)if ((hw->mac.type == e1000_ich9lan || hw->mac.type == e1000_pch2lan || hw->mac.type == e1000_ich10lan) && - rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { + dev->data->mtu >RTE_ETHER_MTU ) {u32 rxdctl =E1000_READ_REG (hw,E1000_RXDCTL (0 ));E1000_WRITE_REG (hw,E1000_RXDCTL (0 ), rxdctl |3 );E1000_WRITE_REG (hw,E1000_ERT ,0x100 | (1 <<13 )); }if (hw->mac.type == e1000_pch2lan) { -if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) +if (dev->data->mtu >RTE_ETHER_MTU )e1000_lv_jumbo_workaround_ich8lan (hw, TRUE);else e1000_lv_jumbo_workaround_ich8lan (hw, FALSE);
@@ -1895,7 +1890,7 @@ eth_em_rx_init(struct rte_eth_dev *dev)/* * Configure support of jumbo frames, if any. */ -if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) +if (dev->data->mtu >RTE_ETHER_MTU ) rctl |=E1000_RCTL_LPE ;else rctl &= ~E1000_RCTL_LPE ;
drivers/net/e1000/igb_rxtx.c +1 -2
@@ -1645,7 +1645,6 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_IPV4_CKSUM |DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_KEEP_CRC |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_RSS_HASH ;
@@ -2332,7 +2331,7 @@ eth_igb_rx_init(struct rte_eth_dev *dev)* Configure support of jumbo frames, if any. */ max_len = dev->data->mtu +E1000_ETH_OVERHEAD ; -if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if ((dev->data->mtu &RTE_ETHER_MTU ) !=0 ) { rctl |=E1000_RCTL_LPE ;/*
drivers/net/ena/ena_ethdev.c +0 -1
@@ -1916,7 +1916,6 @@ static int ena_infos_get(struct rte_eth_dev *dev,DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM ; - rx_feat |=DEV_RX_OFFLOAD_JUMBO_FRAME ; tx_feat |=DEV_TX_OFFLOAD_MULTI_SEGS ;/* Inform framework about available features */
drivers/net/enetc/enetc_ethdev.c +1 -2
@@ -210,8 +210,7 @@ enetc_dev_infos_get(struct rte_eth_dev *dev __rte_unused, (DEV_RX_OFFLOAD_IPV4_CKSUM |DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM | -DEV_RX_OFFLOAD_KEEP_CRC | -DEV_RX_OFFLOAD_JUMBO_FRAME ); +DEV_RX_OFFLOAD_KEEP_CRC );return 0 ; }
drivers/net/enic/enic_res.c +0 -1
@@ -209,7 +209,6 @@ int enic_get_vnic_config(struct enic *enic)DEV_TX_OFFLOAD_TCP_TSO ; enic->rx_offload_capa =DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_STRIP |DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM |
drivers/net/failsafe/failsafe_ops.c +0 -2
@@ -1183,7 +1183,6 @@ fs_dev_infos_get(struct rte_eth_dev *dev,DEV_RX_OFFLOAD_HEADER_SPLIT |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_VLAN_EXTEND | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_TIMESTAMP | DEV_RX_OFFLOAD_SECURITY |
@@ -1201,7 +1200,6 @@ fs_dev_infos_get(struct rte_eth_dev *dev,DEV_RX_OFFLOAD_HEADER_SPLIT |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_VLAN_EXTEND | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_TIMESTAMP | DEV_RX_OFFLOAD_SECURITY |
drivers/net/fm10k/fm10k_ethdev.c +0 -1
@@ -1779,7 +1779,6 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_IPV4_CKSUM |DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_HEADER_SPLIT | DEV_RX_OFFLOAD_RSS_HASH); }
drivers/net/hinic/hinic_pmd_ethdev.c +0 -1
@@ -738,7 +738,6 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_TCP_LRO |DEV_RX_OFFLOAD_RSS_HASH ;
drivers/net/hns3/hns3_ethdev.c +0 -1
@@ -2686,7 +2686,6 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_VLAN_STRIP |DEV_RX_OFFLOAD_VLAN_FILTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_RSS_HASH | DEV_RX_OFFLOAD_TCP_LRO); info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
drivers/net/hns3/hns3_ethdev_vf.c +0 -1
@@ -944,7 +944,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_VLAN_STRIP |DEV_RX_OFFLOAD_VLAN_FILTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_RSS_HASH | DEV_RX_OFFLOAD_TCP_LRO); info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
drivers/net/i40e/i40e_ethdev.c +0 -1
@@ -3730,7 +3730,6 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_VLAN_EXTEND |DEV_RX_OFFLOAD_VLAN_FILTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_RSS_HASH ; dev_info->tx_queue_offload_capa =DEV_TX_OFFLOAD_MBUF_FAST_FREE ;
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -2901,7 +2901,7 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq) rxq->max_pkt_len =RTE_MIN (hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len, data->mtu +I40E_ETH_OVERHEAD ); -if (data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if (data->mtu >RTE_ETHER_MTU ) {if (rxq->max_pkt_len <=I40E_ETH_MAX_LEN || rxq->max_pkt_len >I40E_FRAME_SIZE_MAX ) { PMD_DRV_LOG(ERR, "maximum packet length must "
drivers/net/iavf/iavf_ethdev.c +1 -2
@@ -588,7 +588,7 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq)/* Check if the jumbo frame and maximum packet length are set * correctly. */ -if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if (dev->data->mtu &RTE_ETHER_MTU ) {if (max_pkt_len <=IAVF_ETH_MAX_LEN || max_pkt_len >IAVF_FRAME_SIZE_MAX ) { PMD_DRV_LOG(ERR, "maximum packet length must be "
@@ -968,7 +968,6 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_RSS_HASH ;
drivers/net/ice/ice_dcf_ethdev.c +1 -2
@@ -72,7 +72,7 @@ ice_dcf_init_rxq(struct rte_eth_dev *dev, struct ice_rx_queue *rxq)/* Check if the jumbo frame and maximum packet length are set * correctly. */ -if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if (dev_data->mtu >RTE_ETHER_MTU ) {if (max_pkt_len <=ICE_ETH_MAX_LEN || max_pkt_len >ICE_FRAME_SIZE_MAX ) { PMD_DRV_LOG(ERR, "maximum packet length must be "
@@ -681,7 +681,6 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev,DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_RSS_HASH ; dev_info->tx_offload_capa =
drivers/net/ice/ice_dcf_vf_representor.c +0 -1
@@ -149,7 +149,6 @@ ice_dcf_vf_repr_dev_info_get(struct rte_eth_dev *dev,DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_VLAN_EXTEND |DEV_RX_OFFLOAD_RSS_HASH ;
drivers/net/ice/ice_ethdev.c +0 -1
@@ -3676,7 +3676,6 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->rx_offload_capa =DEV_RX_OFFLOAD_VLAN_STRIP | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_KEEP_CRC |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_VLAN_FILTER ;
drivers/net/ice/ice_rxtx.c +1 -2
@@ -267,7 +267,6 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)struct ice_rlan_ctx rx_ctx;enum ice_status err;uint16_t buf_size; -struct rte_eth_rxmode *rxmode = &dev_data->dev_conf.rxmode;uint32_t rxdid =ICE_RXDID_COMMS_OVS ;uint32_t regval;struct ice_adapter *ad = rxq->vsi->adapter;
@@ -282,7 +281,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)RTE_MIN ((uint32_t )ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len, frame_size); -if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if (dev_data->mtu >RTE_ETHER_MTU ) {if (rxq->max_pkt_len <=ICE_ETH_MAX_LEN || rxq->max_pkt_len >ICE_FRAME_SIZE_MAX ) { PMD_DRV_LOG(ERR, "maximum packet length must "
drivers/net/igc/igc_ethdev.h +0 -1
@@ -73,7 +73,6 @@ extern "C" {DEV_RX_OFFLOAD_UDP_CKSUM | \DEV_RX_OFFLOAD_TCP_CKSUM | \DEV_RX_OFFLOAD_SCTP_CKSUM | \ -DEV_RX_OFFLOAD_JUMBO_FRAME | \DEV_RX_OFFLOAD_KEEP_CRC | \DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_RSS_HASH)
drivers/net/igc/igc_txrx.c +1 -1
@@ -1080,7 +1080,7 @@ igc_rx_init(struct rte_eth_dev *dev)IGC_WRITE_REG (hw,IGC_RCTL , rctl & ~IGC_RCTL_EN );/* Configure support of jumbo frames, if any. */ -if ((offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) !=0 ) +if (dev->data->mtu &RTE_ETHER_MTU ) rctl |=IGC_RCTL_LPE ;else rctl &= ~IGC_RCTL_LPE ;
drivers/net/ionic/ionic_ethdev.c +0 -1
@@ -414,7 +414,6 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,DEV_RX_OFFLOAD_IPV4_CKSUM |DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_SCATTER |
drivers/net/ipn3ke/ipn3ke_representor.c +1 -2
@@ -74,8 +74,7 @@ ipn3ke_rpst_dev_infos_get(struct rte_eth_dev *ethdev,DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |DEV_RX_OFFLOAD_VLAN_EXTEND | -DEV_RX_OFFLOAD_VLAN_FILTER | -DEV_RX_OFFLOAD_JUMBO_FRAME ; +DEV_RX_OFFLOAD_VLAN_FILTER ; dev_info->tx_queue_offload_capa =DEV_TX_OFFLOAD_MBUF_FAST_FREE ; dev_info->tx_offload_capa =
drivers/net/ixgbe/ixgbe_ethdev.c +1 -4
@@ -6040,7 +6040,6 @@ ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t tx_rate) {struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); -struct rte_eth_rxmode *rxmode;uint32_t rf_dec, rf_int;uint32_t bcnrc_val;uint16_t link_speed = dev->data->dev_link.link_speed;
@@ -6062,14 +6061,12 @@ ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, bcnrc_val =0 ; } - rxmode = &dev->data->dev_conf.rxmode;/* * Set global transmit compensation time to the MMW_SIZE in RTTBCNRM * register. MMW_SIZE=0x014 if 9728-byte jumbo is supported, otherwise * set as 0x4. */ -if ((rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) && - (dev->data->mtu +IXGBE_ETH_OVERHEAD >=IXGBE_MAX_JUMBO_FRAME_SIZE )) +if (dev->data->mtu +IXGBE_ETH_OVERHEAD >=IXGBE_MAX_JUMBO_FRAME_SIZE )IXGBE_WRITE_REG (hw,IXGBE_RTTBCNRM ,IXGBE_MMW_SIZE_JUMBO_FRAME );else IXGBE_WRITE_REG (hw,IXGBE_RTTBCNRM ,IXGBE_MMW_SIZE_DEFAULT );
drivers/net/ixgbe/ixgbe_pf.c +2 -7
@@ -597,15 +597,10 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT;if (max_frs < max_frame) { hlreg0 =IXGBE_READ_REG (hw,IXGBE_HLREG0 ); -if (max_frame >IXGBE_ETH_MAX_LEN ) { - dev->data->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; +if (max_frame >IXGBE_ETH_MAX_LEN ) hlreg0 |=IXGBE_HLREG0_JUMBOEN ; - }else { - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; +else hlreg0 &= ~IXGBE_HLREG0_JUMBOEN ; - }IXGBE_WRITE_REG (hw,IXGBE_HLREG0 , hlreg0); max_frs = max_frame <<IXGBE_MHADD_MFS_SHIFT ;
drivers/net/ixgbe/ixgbe_rxtx.c +1 -2
@@ -3036,7 +3036,6 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_KEEP_CRC | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_RSS_HASH ;
@@ -5079,7 +5078,7 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)/* * Configure jumbo frame support, if any. */ -if (rx_conf->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) { +if ((dev->data->mtu &RTE_ETHER_MTU ) !=0 ) { hlreg0 |=IXGBE_HLREG0_JUMBOEN ; maxfrs =IXGBE_READ_REG (hw,IXGBE_MAXFRS ); maxfrs &=0x0000FFFF ;
drivers/net/mlx4/mlx4_rxq.c +0 -1
@@ -684,7 +684,6 @@ mlx4_get_rx_queue_offloads(struct mlx4_priv *priv) {uint64_t offloads =DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_KEEP_CRC | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_RSS_HASH ;if (priv->hw_csum)
drivers/net/mlx5/mlx5_rxq.c +0 -1
@@ -335,7 +335,6 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)struct mlx5_dev_config *config = &priv->config;uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |DEV_RX_OFFLOAD_TIMESTAMP | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_RSS_HASH );if (!config->mprq.enabled)
drivers/net/mvneta/mvneta_ethdev.h +1 -2
@@ -54,8 +54,7 @@#define MRVL_NETA_MRU_TO_MTU (mru) ((mru) - MRVL_NETA_HDRS_LEN)/** Rx offloads capabilities */ -#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \ - DEV_RX_OFFLOAD_CHECKSUM) +#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_CHECKSUM)/** Tx offloads capabilities */ #define MVNETA_TX_OFFLOAD_CHECKSUM (DEV_TX_OFFLOAD_IPV4_CKSUM | \
drivers/net/mvpp2/mrvl_ethdev.c +0 -1
@@ -59,7 +59,6 @@/** Port Rx offload capabilities */ #define MRVL_RX_OFFLOADS (DEV_RX_OFFLOAD_VLAN_FILTER | \ - DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_CHECKSUM)/** Port Tx offloads capabilities */
drivers/net/nfp/nfp_common.c +1 -5
@@ -369,8 +369,7 @@ nfp_check_offloads(struct rte_eth_dev *dev) ctrl |=NFP_NET_CFG_CTRL_RXVLAN ; } -if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) - hw->mtu = dev->data->mtu; + hw->mtu = dev->data->mtu;if (txmode->offloads &DEV_TX_OFFLOAD_VLAN_INSERT ) ctrl |=NFP_NET_CFG_CTRL_TXVLAN ;
@@ -757,9 +756,6 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) .nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG, }; -/* All NFP devices support jumbo frames */ - dev_info->rx_offload_capa |=DEV_RX_OFFLOAD_JUMBO_FRAME ; -if (hw->cap &NFP_NET_CFG_CTRL_RSS ) { dev_info->rx_offload_capa |=DEV_RX_OFFLOAD_RSS_HASH ;
drivers/net/octeontx/octeontx_ethdev.h +0 -1
@@ -60,7 +60,6 @@ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_SCATTER | \ -DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_VLAN_FILTER)#define OCTEONTX_TX_OFFLOADS ( \
drivers/net/octeontx2/otx2_ethdev.h +0 -1
@@ -148,7 +148,6 @@DEV_RX_OFFLOAD_SCTP_CKSUM | \DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \DEV_RX_OFFLOAD_SCATTER | \ -DEV_RX_OFFLOAD_JUMBO_FRAME | \DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \
drivers/net/octeontx_ep/otx_ep_ethdev.c +1 -2
@@ -39,8 +39,7 @@ otx_ep_dev_info_get(struct rte_eth_dev *eth_dev, devinfo->min_rx_bufsize =OTX_EP_MIN_RX_BUF_SIZE ; devinfo->max_rx_pktlen =OTX_EP_MAX_PKT_SZ ; - devinfo->rx_offload_capa =DEV_RX_OFFLOAD_JUMBO_FRAME ; - devinfo->rx_offload_capa |=DEV_RX_OFFLOAD_SCATTER ; + devinfo->rx_offload_capa =DEV_RX_OFFLOAD_SCATTER ; devinfo->tx_offload_capa =DEV_TX_OFFLOAD_MULTI_SEGS ; devinfo->max_mac_addrs =OTX_EP_MAX_MAC_ADDRS ;
drivers/net/octeontx_ep/otx_ep_rxtx.c +0 -6
@@ -953,12 +953,6 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep, droq_pkt->l3_len = hdr_lens.l3_len; droq_pkt->l4_len = hdr_lens.l4_len; -if ((droq_pkt->pkt_len > (RTE_ETHER_MAX_LEN +OTX_CUST_DATA_LEN )) && - !(otx_ep->rx_offloads &DEV_RX_OFFLOAD_JUMBO_FRAME )) { -rte_pktmbuf_free (droq_pkt); - goto oq_read_fail; - } -if (droq_pkt->nb_segs >1 && !(otx_ep->rx_offloads &DEV_RX_OFFLOAD_SCATTER )) {rte_pktmbuf_free (droq_pkt);
drivers/net/qede/qede_ethdev.c +0 -1
@@ -1392,7 +1392,6 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,DEV_RX_OFFLOAD_TCP_LRO |DEV_RX_OFFLOAD_KEEP_CRC |DEV_RX_OFFLOAD_SCATTER | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_RSS_HASH);
drivers/net/sfc/sfc_rx.c +0 -2
@@ -941,8 +941,6 @@ sfc_rx_get_dev_offload_caps(struct sfc_adapter *sa) {uint64_t caps = sa->priv.dp_rx->dev_offload_capa; - caps |=DEV_RX_OFFLOAD_JUMBO_FRAME ; -return caps &sfc_rx_get_offload_mask (sa); }
drivers/net/thunderx/nicvf_ethdev.h +0 -1
@@ -40,7 +40,6 @@#define NICVF_RX_OFFLOAD_CAPA ( \ DEV_RX_OFFLOAD_CHECKSUM | \ DEV_RX_OFFLOAD_VLAN_STRIP | \ - DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_RSS_HASH)
drivers/net/txgbe/txgbe_rxtx.c +0 -1
@@ -1974,7 +1974,6 @@ txgbe_get_rx_port_offloads(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_UDP_CKSUM |DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_KEEP_CRC | -DEV_RX_OFFLOAD_JUMBO_FRAME |DEV_RX_OFFLOAD_VLAN_FILTER |DEV_RX_OFFLOAD_RSS_HASH |DEV_RX_OFFLOAD_SCATTER ;
drivers/net/virtio/virtio_ethdev.c +0 -1
@@ -2547,7 +2547,6 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) host_features =VIRTIO_OPS (hw)->get_features (hw); dev_info->rx_offload_capa =DEV_RX_OFFLOAD_VLAN_STRIP ; - dev_info->rx_offload_capa |=DEV_RX_OFFLOAD_JUMBO_FRAME ;if (host_features & (1ULL <<VIRTIO_NET_F_MRG_RXBUF )) dev_info->rx_offload_capa |=DEV_RX_OFFLOAD_SCATTER ;if (host_features & (1ULL <<VIRTIO_NET_F_GUEST_CSUM )) {
drivers/net/vmxnet3/vmxnet3_ethdev.c +0 -1
@@ -54,7 +54,6 @@ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_TCP_LRO | \ - DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_RSS_HASH)int vmxnet3_segs_dynfield_offset =-1 ;
examples/ip_fragmentation/main.c +1 -2
@@ -150,8 +150,7 @@ static struct rte_eth_conf port_conf = { RTE_ETHER_CRC_LEN, .split_hdr_size = 0, .offloads = (DEV_RX_OFFLOAD_CHECKSUM | -DEV_RX_OFFLOAD_SCATTER | - DEV_RX_OFFLOAD_JUMBO_FRAME), + DEV_RX_OFFLOAD_SCATTER), }, .txmode = { .mq_mode = ETH_MQ_TX_NONE,
examples/ip_reassembly/main.c +1 -2
@@ -165,8 +165,7 @@ static struct rte_eth_conf port_conf = { .mtu = JUMBO_FRAME_MAX_SIZE - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN, .split_hdr_size = 0, - .offloads = (DEV_RX_OFFLOAD_CHECKSUM | - DEV_RX_OFFLOAD_JUMBO_FRAME), + .offloads = DEV_RX_OFFLOAD_CHECKSUM, }, .rx_adv_conf = { .rss_conf = {
examples/ipsec-secgw/ipsec-secgw.c +0 -2
@@ -2209,8 +2209,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)printf ("Creating queues: nb_rx_queue=%d nb_tx_queue=%u...\n" , nb_rx_queue, nb_tx_queue); -if (mtu_size >RTE_ETHER_MTU ) - local_port_conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; local_port_conf.rxmode.mtu = mtu_size;if (multi_seg_required ()) {
examples/ipv4_multicast/main.c +0 -1
@@ -113,7 +113,6 @@ static struct rte_eth_conf port_conf = { .mtu = JUMBO_FRAME_MAX_SIZE - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN, .split_hdr_size = 0, - .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE,
examples/kni/main.c +0 -5
@@ -790,11 +790,6 @@ kni_change_mtu_(uint16_t port_id, unsigned int new_mtu) }memcpy (&conf, &port_conf,sizeof (conf)); -/* Set new MTU */ -if (new_mtu >RTE_ETHER_MTU ) - conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; -else - conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME ; conf.rxmode.mtu = new_mtu; ret =rte_eth_dev_configure (port_id,1 ,1 , &conf);
examples/l3fwd-acl/main.c +1 -3
@@ -2003,10 +2003,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, dev_info->max_mtu); conf->rxmode.mtu = max_pkt_len - overhead_len; -if (conf->rxmode.mtu >RTE_ETHER_MTU ) { +if (conf->rxmode.mtu >RTE_ETHER_MTU ) conf->txmode.offloads |=DEV_TX_OFFLOAD_MULTI_SEGS ; - conf->rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; - }return 0 ; }
examples/l3fwd-graph/main.c +1 -3
@@ -730,10 +730,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, dev_info->max_mtu); conf->rxmode.mtu = max_pkt_len - overhead_len; -if (conf->rxmode.mtu >RTE_ETHER_MTU ) { +if (conf->rxmode.mtu >RTE_ETHER_MTU ) conf->txmode.offloads |=DEV_TX_OFFLOAD_MULTI_SEGS ; - conf->rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; - }return 0 ; }
examples/l3fwd-power/main.c +1 -3
@@ -2509,10 +2509,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, dev_info->max_mtu); conf->rxmode.mtu = max_pkt_len - overhead_len; -if (conf->rxmode.mtu >RTE_ETHER_MTU ) { +if (conf->rxmode.mtu >RTE_ETHER_MTU ) conf->txmode.offloads |=DEV_TX_OFFLOAD_MULTI_SEGS ; - conf->rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; - }return 0 ; }
examples/l3fwd/main.c +1 -3
@@ -987,10 +987,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, dev_info->max_mtu); conf->rxmode.mtu = max_pkt_len - overhead_len; -if (conf->rxmode.mtu >RTE_ETHER_MTU ) { +if (conf->rxmode.mtu >RTE_ETHER_MTU ) conf->txmode.offloads |=DEV_TX_OFFLOAD_MULTI_SEGS ; - conf->rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; - }return 0 ; }
examples/performance-thread/l3fwd-thread/main.c +1 -3
@@ -3493,10 +3493,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, dev_info->max_mtu); conf->rxmode.mtu = max_pkt_len - overhead_len; -if (conf->rxmode.mtu >RTE_ETHER_MTU ) { +if (conf->rxmode.mtu >RTE_ETHER_MTU ) conf->txmode.offloads |=DEV_TX_OFFLOAD_MULTI_SEGS ; - conf->rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; - }return 0 ; }
examples/vhost/main.c +1 -4
@@ -631,11 +631,8 @@ us_vhost_parse_args(int argc, char **argv)return -1 ; } mergeable = !!ret; -if (ret) { - vmdq_conf_default.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; +if (ret) vmdq_conf_default.rxmode.mtu =MAX_MTU ; - }break ;case OPT_STATS_NUM :
lib/ethdev/rte_ethdev.c +1 -25
@@ -121,7 +121,6 @@ static const struct {RTE_RX_OFFLOAD_BIT2STR (HEADER_SPLIT ),RTE_RX_OFFLOAD_BIT2STR (VLAN_FILTER ),RTE_RX_OFFLOAD_BIT2STR (VLAN_EXTEND ), -RTE_RX_OFFLOAD_BIT2STR (JUMBO_FRAME ),RTE_RX_OFFLOAD_BIT2STR (SCATTER ),RTE_RX_OFFLOAD_BIT2STR (TIMESTAMP ), RTE_RX_OFFLOAD_BIT2STR(SECURITY),
@@ -1476,13 +1475,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } -if ((dev_conf->rxmode.offloads &DEV_RX_OFFLOAD_JUMBO_FRAME ) ==0 ) { -if (dev->data->dev_conf.rxmode.mtu <RTE_ETHER_MIN_MTU || - dev->data->dev_conf.rxmode.mtu >RTE_ETHER_MTU ) -/* Use default value */ - dev->data->dev_conf.rxmode.mtu =RTE_ETHER_MTU ; - } - dev->data->mtu = dev->data->dev_conf.rxmode.mtu;/*
@@ -3647,7 +3639,6 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)int ret;struct rte_eth_dev_info dev_info;struct rte_eth_dev *dev; -int is_jumbo_frame_capable =0 ;RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); dev = &rte_eth_devices[port_id];
@@ -3675,27 +3666,12 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) frame_size = mtu + overhead_len;if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen)return -EINVAL ; - -if ((dev_info.rx_offload_capa &DEV_RX_OFFLOAD_JUMBO_FRAME ) !=0 ) - is_jumbo_frame_capable =1 ; } -if (mtu >RTE_ETHER_MTU && is_jumbo_frame_capable ==0 ) -return -EINVAL ; - ret = (*dev->dev_ops->mtu_set)(dev, mtu); -if (ret ==0 ) { +if (ret ==0 ) dev->data->mtu = mtu; -/* switch to jumbo mode if needed */ -if (mtu >RTE_ETHER_MTU ) - dev->data->dev_conf.rxmode.offloads |= -DEV_RX_OFFLOAD_JUMBO_FRAME ; -else - dev->data->dev_conf.rxmode.offloads &= - ~DEV_RX_OFFLOAD_JUMBO_FRAME ; - } -return eth_err (port_id, ret); }
lib/ethdev/rte_ethdev.h +0 -1
@@ -1356,7 +1356,6 @@ struct rte_eth_conf {#define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100#define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200#define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400 -#define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800#define DEV_RX_OFFLOAD_SCATTER 0x00002000/** * Timestamp is set by the driver in RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
Signature · 1 line
2.31.1
Re: [dpdk-dev] [PATCH v7 4/6] ethdev: remove jumbo offload flag
18/10/2021 15:48, Ferruh Yigit:
Quoted 1 line
Removing '
DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.
[...]
doc/guides/nics/features.rst Jumbo frame · line 168
Quoted 9 lines
doc/guides/nics/features.rst +1
-2@@ -165,8 +165,7 @@ Jumbo frame Supports Rx jumbo frames. -* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``. - ``dev_conf.rxmode.mtu``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``dev_conf.rxmode.mtu``.
So we keep announcing the feature "Jumbo frame" in the doc for MTU specific values?
Re: [dpdk-dev] [PATCH v7 4/6] ethdev: remove jumbo offload flag
Quoted 7 lines · Thomas Monjalon
18/10/2021 15:48, Ferruh Yigit:
Quoted 1 line
Removing '
DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.[...]
Quoted 4 lines
doc/guides/nics/features.rst +0
-0@@ -165,8 +165,7 @@ Jumbo frame
Quoted 8 lines
doc/guides/nics/features.rst Jumbo frame · line 168
Quoted 5 lines
doc/guides/nics/features.rst +1
-2Supports Rx jumbo frames. -* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``. - ``dev_conf.rxmode.mtu``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``dev_conf.rxmode.mtu``.So we keep announcing the feature "Jumbo frame" in the doc for MTU specific values?
It is there mainly I missed to remove all, still it is an option to keep feature to let PMDs document capability, but since there is not flag/offload for it, I am for removing feature completely.
Re: [dpdk-dev] [PATCH v7 4/6] ethdev: remove jumbo offload flag
Quoted 17 lines · Ferruh Yigit
Quoted 15 lines · Thomas Monjalon
18/10/2021 15:48, Ferruh Yigit:
Quoted 1 line
Removing '
DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.[...]
Quoted 8 lines
doc/guides/nics/features.rst +0
-0@@ -165,8 +165,7 @@ Jumbo frameSupports Rx jumbo frames.
-* **[uses] rte_eth_rxconf,rte_eth_rxmode**:
``offloads:DEV_RX_OFFLOAD_JUMBO_FRAME``.
- ``dev_conf.rxmode.mtu``.
+* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``dev_conf.rxmode.mtu``.So we keep announcing the feature "Jumbo frame" in the doc for MTU specific values?
Quoted 5 lines
It is there mainly I missed to remove all, still it is an option to keep feature
to let PMDs document capability, but since there is not flag/offload for it, I
am for removing feature completely.
+1
PATCH v7 5/6 ethdev: unify MTU checks
In reply to Ferruh YigitBoth 'rte_eth_dev_configure()' & 'rte_eth_dev_set_mtu()' sets MTU but have slightly different checks. Like one checks min MTU against RTE_ETHER_MIN_MTU and other RTE_ETHER_MIN_LEN.
Checks moved into common function to unify the checks. Also this has benefit to have common error logs.
Default 'dev_info->min_mtu' (the one set by ethdev if driver doesn't provide one), changed to ('RTE_ETHER_MIN_LEN' - overhead). Previously it was 'RTE_ETHER_MIN_MTU' which is min MTU for IPv4 packets. Since the intention is to provide min MTU corresponding minimum frame size, new default value suits better.
--- lib/ethdev/rte_ethdev.c | 91 +++++++++++++++++++++++++---------------- lib/ethdev/rte_ethdev.h | 2 +- 2 files changed, 57 insertions(+), 36 deletions(-)
lib/ethdev/rte_ethdev.c +56 -35
@@ -1327,6 +1327,47 @@ eth_dev_get_overhead_len(uint32_t max_rx_pktlen, uint16_t max_mtu)return overhead_len; } +/* rte_eth_dev_info_get() should be called prior to this function */ +static int +eth_dev_validate_mtu (uint16_t port_id,struct rte_eth_dev_info *dev_info, +uint16_t mtu) +{ +uint32_t overhead_len; +uint32_t frame_size; + +if (mtu < dev_info->min_mtu) { +RTE_ETHDEV_LOG (ERR , +"MTU (%u) < device min MTU (%u) for port_id %u\n" , + mtu, dev_info->min_mtu, port_id); +return -EINVAL ; + } +if (mtu > dev_info->max_mtu) { +RTE_ETHDEV_LOG (ERR , +"MTU (%u) > device max MTU (%u) for port_id %u\n" , + mtu, dev_info->max_mtu, port_id); +return -EINVAL ; + } + + overhead_len =eth_dev_get_overhead_len (dev_info->max_rx_pktlen, + dev_info->max_mtu); + frame_size = mtu + overhead_len; +if (frame_size <RTE_ETHER_MIN_LEN ) { +RTE_ETHDEV_LOG (ERR , +"Frame size (%u) < min frame size (%u) for port_id %u\n" , + frame_size,RTE_ETHER_MIN_LEN , port_id); +return -EINVAL ; + } + +if (frame_size > dev_info->max_rx_pktlen) { +RTE_ETHDEV_LOG (ERR , +"Frame size (%u) > device max frame size (%u) for port_id %u\n" , + frame_size, dev_info->max_rx_pktlen, port_id); +return -EINVAL ; + } + +return 0 ; +} +int rte_eth_dev_configure (uint16_t port_id,uint16_t nb_rx_q,uint16_t nb_tx_q,const struct rte_eth_conf *dev_conf)
@@ -1334,8 +1375,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,struct rte_eth_dev *dev;struct rte_eth_dev_info dev_info;struct rte_eth_conf orig_conf; -uint32_t max_rx_pktlen; -uint32_t overhead_len;int diag;int ret;uint16_t old_mtu;
@@ -1384,10 +1423,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,if (ret !=0 ) goto rollback; -/* Get the real Ethernet overhead length */ - overhead_len =eth_dev_get_overhead_len (dev_info.max_rx_pktlen, - dev_info.max_mtu); -/* If number of queues specified by application for both Rx and Tx is * zero, use driver preferred values. This cannot be done individually * as it is valid for either Tx or Rx (but not both) to be zero.
@@ -1454,26 +1489,13 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, goto rollback; } -/* -* Check that the maximum RX packet length is supported by the -* configured device. -*/ if (dev_conf->rxmode.mtu ==0 ) dev->data->dev_conf.rxmode.mtu =RTE_ETHER_MTU ; - max_rx_pktlen = dev->data->dev_conf.rxmode.mtu + overhead_len; -if (max_rx_pktlen > dev_info.max_rx_pktlen) { -RTE_ETHDEV_LOG (ERR , -"Ethdev port_id=%u max_rx_pktlen %u > max valid value %u\n" , - port_id, max_rx_pktlen, dev_info.max_rx_pktlen); - ret = -EINVAL ; - goto rollback; - }else if (max_rx_pktlen <RTE_ETHER_MIN_LEN ) { -RTE_ETHDEV_LOG (ERR , -"Ethdev port_id=%u max_rx_pktlen %u < min valid value %u\n" , - port_id, max_rx_pktlen,RTE_ETHER_MIN_LEN ); - ret = -EINVAL ; + + ret =eth_dev_validate_mtu (port_id, &dev_info, + dev->data->dev_conf.rxmode.mtu); +if (ret !=0 ) goto rollback; - } dev->data->mtu = dev->data->dev_conf.rxmode.mtu;
@@ -1482,6 +1504,12 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,* size is supported by the configured device. */ if (dev_conf->rxmode.offloads &DEV_RX_OFFLOAD_TCP_LRO ) { +uint32_t max_rx_pktlen; +uint32_t overhead_len; + + overhead_len =eth_dev_get_overhead_len (dev_info.max_rx_pktlen, + dev_info.max_mtu); + max_rx_pktlen = dev->data->dev_conf.rxmode.mtu + overhead_len;if (dev_conf->rxmode.max_lro_pkt_size ==0 ) dev->data->dev_conf.rxmode.max_lro_pkt_size = max_rx_pktlen; ret = eth_dev_check_lro_pkt_size(port_id,
@@ -3400,7 +3428,8 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->rx_desc_lim = lim; dev_info->tx_desc_lim = lim; dev_info->device = dev->device; - dev_info->min_mtu =RTE_ETHER_MIN_MTU ; + dev_info->min_mtu =RTE_ETHER_MIN_LEN -RTE_ETHER_HDR_LEN - +RTE_ETHER_CRC_LEN ; dev_info->max_mtu =UINT16_MAX ;RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->dev_infos_get, -ENOTSUP );
@@ -3651,21 +3680,13 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)* which relies on dev->dev_ops->dev_infos_get. */ if (*dev->dev_ops->dev_infos_get !=NULL ) { -uint16_t overhead_len; -uint32_t frame_size; - ret =rte_eth_dev_info_get (port_id, &dev_info);if (ret !=0 )return ret; -if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu) -return -EINVAL ; - - overhead_len =eth_dev_get_overhead_len (dev_info.max_rx_pktlen, - dev_info.max_mtu); - frame_size = mtu + overhead_len; -if (mtu <RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) -return -EINVAL ; + ret =eth_dev_validate_mtu (port_id, &dev_info, mtu); +if (ret !=0 ) +return ret; } ret = (*dev->dev_ops->mtu_set)(dev, mtu);
lib/ethdev/rte_ethdev.h +1 -1
@@ -3050,7 +3050,7 @@ int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma,* }; * * device = dev->device -* min_mtu = RTE_ETHER_MIN_MTU +* min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN * max_mtu = UINT16_MAX * * The following fields will be populated if support for dev_infos_get()
Signature · 1 line
2.31.1
PATCH v7 6/6 examples/ip_reassembly: remove unused parameter
In reply to Ferruh YigitRemove 'max-pkt-len' parameter.
--- examples/ip_reassembly/main.c | 2 -- 1 file changed, 2 deletions(-)
examples/ip_reassembly/main.c +0 -2
@@ -516,7 +516,6 @@ static void print_usage(const char *prgname) {printf ("%s [EAL options] -- -p PORTMASK [-q NQ]" -" [--max-pkt-len PKTLEN]" " [--maxflows=<flows>] [--flowttl=<ttl>[(s|ms)]]\n" " -p PORTMASK: hexadecimal bitmask of ports to configure\n" " -q NQ: number of RX queues per lcore\n"
@@ -618,7 +617,6 @@ parse_args(int argc, char **argv)int option_index;char *prgname = argv[0 ];static struct option lgopts[] = { - {"max-pkt-len" ,1 ,0 ,0 }, {"maxflows" ,1 ,0 ,0 }, {"flowttl" ,1 ,0 ,0 }, {NULL ,0 ,0 ,0 }
Signature · 1 line
2.31.1
Quoted 48 lines · Ferruh Yigit
There is a confusion on setting max Rx packet length, this patch aims to clarify it.
'
rte_eth_dev_configure()' API accepts max Rx packet size via 'uint32_tmax_rx_pkt_len' field of the config struct 'structrte_eth_conf'.Also '
rte_eth_dev_set_mtu()' API can be used to set the MTU, and result stored into '(struct rte_eth_dev)->data->mtu'.These two APIs are related but they work in a disconnected way, they store the set values in different variables which makes hard to figure out which one to use, also having two different method for a related functionality is confusing for the users.
Other issues causing confusion is:
* maximum transmission unit (MTU) is payload of the Ethernet frame. And 'max_rx_pkt_len' is the size of the Ethernet frame. Difference is Ethernet frame overhead, and this overhead may be different from device to device based on what device supports, like VLAN and QinQ.
* 'max_rx_pkt_len' is only valid when application requested jumbo frame, which adds additional confusion and some APIs and PMDs already discards this documented behavior.
* For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory field, this adds configuration complexity for application.As solution, both APIs gets MTU as parameter, and both saves the result in same variable '(struct rte_eth_dev)->data->mtu'. For this '
max_rx_pkt_len' updated as 'mtu', and it is always valid independent from jumbo frame.For '
rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user request and it should be used only within configure function and result should be stored to '(struct rte_eth_dev)->data->mtu'. After that point both application and PMD uses MTU from this variable.When application doesn't provide an MTU during '
rte_eth_dev_configure()' default 'RTE_ETHER_MTU' value is used.Additional clarification done on scattered Rx configuration, in relation to MTU and Rx buffer size.
MTU is used to configure the device for physical Rx/Tx size limitation, Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer size as Rx buffer size.
PMDs compare MTU against Rx buffer size to decide enabling scattered Rx or not. If scattered Rx is not supported by device, MTU bigger than Rx buffer size should fail.
Quoted 8 lines
Signed-off-by Ferruh Yigit <[email protected]>Acked-by Ajit Khaparde <[email protected]>Acked-by Somnath Kotur <[email protected]>Acked-by Huisong Li <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Rosen Xu <[email protected]>Acked-by Hyong Youb Kim <[email protected]>
Series applied to dpdk-next-net/main, thanks.
Quoted 58 lines · Ferruh Yigit
Quoted 48 lines · Ferruh Yigit
There is a confusion on setting max Rx packet length, this patch aims to clarify it.
'
rte_eth_dev_configure()' API accepts max Rx packet size via 'uint32_tmax_rx_pkt_len' field of the config struct 'structrte_eth_conf'.Also '
rte_eth_dev_set_mtu()' API can be used to set the MTU, and result stored into '(struct rte_eth_dev)->data->mtu'.These two APIs are related but they work in a disconnected way, they store the set values in different variables which makes hard to figure out which one to use, also having two different method for a related functionality is confusing for the users.
Other issues causing confusion is:
* maximum transmission unit (MTU) is payload of the Ethernet frame. And 'max_rx_pkt_len' is the size of the Ethernet frame. Difference is Ethernet frame overhead, and this overhead may be different from device to device based on what device supports, like VLAN and QinQ.
* 'max_rx_pkt_len' is only valid when application requested jumbo frame, which adds additional confusion and some APIs and PMDs already discards this documented behavior.
* For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory field, this adds configuration complexity for application.As solution, both APIs gets MTU as parameter, and both saves the result in same variable '(struct rte_eth_dev)->data->mtu'. For this '
max_rx_pkt_len' updated as 'mtu', and it is always valid independent from jumbo frame.For '
rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user request and it should be used only within configure function and result should be stored to '(struct rte_eth_dev)->data->mtu'. After that point both application and PMD uses MTU from this variable.When application doesn't provide an MTU during '
rte_eth_dev_configure()' default 'RTE_ETHER_MTU' value is used.Additional clarification done on scattered Rx configuration, in relation to MTU and Rx buffer size.
MTU is used to configure the device for physical Rx/Tx size limitation, Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer size as Rx buffer size.
PMDs compare MTU against Rx buffer size to decide enabling scattered Rx or not. If scattered Rx is not supported by device, MTU bigger than Rx buffer size should fail.Quoted 8 lines
Signed-off-by Ferruh Yigit <[email protected]>Acked-by Ajit Khaparde <[email protected]>Acked-by Somnath Kotur <[email protected]>Acked-by Huisong Li <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Rosen Xu <[email protected]>Acked-by Hyong Youb Kim <[email protected]>
Quoted 2 lines
Series applied to dpdk-next-net/main, thanks.
Hi Ferruh,
I noticed that no cc stable in this this "fix" patch, do you expect it to be part of LTS?
Thanks,
Xueming
Quoted 59 lines · Xueming(Steven) Li
Quoted 58 lines · Ferruh Yigit
Quoted 56 lines · Ferruh Yigit
There is a confusion on setting max Rx packet length, this patch aims to clarify it.
'
rte_eth_dev_configure()' API accepts max Rx packet size via 'uint32_tmax_rx_pkt_len' field of the config struct 'structrte_eth_conf'.Also '
rte_eth_dev_set_mtu()' API can be used to set the MTU, and result stored into '(struct rte_eth_dev)->data->mtu'.These two APIs are related but they work in a disconnected way, they store the set values in different variables which makes hard to figure out which one to use, also having two different method for a related functionality is confusing for the users.
Other issues causing confusion is:
* maximum transmission unit (MTU) is payload of the Ethernet frame. And 'max_rx_pkt_len' is the size of the Ethernet frame. Difference is Ethernet frame overhead, and this overhead may be different from device to device based on what device supports, like VLAN and QinQ.
* 'max_rx_pkt_len' is only valid when application requested jumbo frame, which adds additional confusion and some APIs and PMDs already discards this documented behavior.
* For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory field, this adds configuration complexity for application.As solution, both APIs gets MTU as parameter, and both saves the result in same variable '(struct rte_eth_dev)->data->mtu'. For this '
max_rx_pkt_len' updated as 'mtu', and it is always valid independent from jumbo frame.For '
rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user request and it should be used only within configure function and result should be stored to '(struct rte_eth_dev)->data->mtu'. After that point both application and PMD uses MTU from this variable.When application doesn't provide an MTU during '
rte_eth_dev_configure()' default 'RTE_ETHER_MTU' value is used.Additional clarification done on scattered Rx configuration, in relation to MTU and Rx buffer size.
MTU is used to configure the device for physical Rx/Tx size limitation, Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer size as Rx buffer size.
PMDs compare MTU against Rx buffer size to decide enabling scattered Rx or not. If scattered Rx is not supported by device, MTU bigger than Rx buffer size should fail.Signed-off-by Ferruh Yigit <[email protected]>Acked-by Ajit Khaparde <[email protected]>Acked-by Somnath Kotur <[email protected]>Acked-by Huisong Li <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Rosen Xu <[email protected]>Acked-by Hyong Youb Kim <[email protected]>
Quoted 8 lines
Quoted 2 lines
Series applied to dpdk-next-net/main, thanks.
Hi Ferruh,
I noticed that no cc stable in this this "fix" patch, do you expect it to be part of LTS?
Hi Xueming,
I didn't put it intentionally, patch changes how frame size / MTU configured, not exactly a fix, I think not suitable for backport.