[dpdk-users] Question about driver/controller MTU enforcement with MTU less than jumbo frame size

Coulson, Ken kcoulson at ciena.com
Tue May 9 23:02:24 CEST 2017

Is it possible to have an MTU enforced on rx that is less than jumbo size frames?
>From the DPDK driver code snippet for ixgbe if MTU < 1518 then the jumbo_frame control bit in the chip is set to 0.
The controller manual says the maximum frame size is only meaningful when the jumbo_frame control bit is 1.
Does it work to leave jumbo_frame set to 1 but set max frame size to something smaller than the jumbo size of 1518?

>From 82559 10 GbE Controller manual, section, page 669, Max Frame Size:

   This field defines the maximum frame size in bytes units from Ethernet MAC
   addresses up to inclusive the CRC.  Frames received that are larger than this
   value are dropped.  This field is meaningful when jumbo frames are enabled
   (HLREG0.JUMBOEN = 1b).  When jumbo frames are not enabled the 82599 uses a
   hardwired value of 1518 for this field.  The MFS does not include the 4 bytes of
   the VLAN header. Packets with VLAN header can be as large as MFS + 4. When
   double VLAN is enabled, the device adds 8 to the MFS for any packets.  This
   value has no effect on transmit frames; it is the responsibility of software to
   limit the size of transmit frames.

10G driver dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:

   ixgbe_dev_mtu_set(struct rte_ethd_dev *dev, uint16_t mtu)
      uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;  /* + 18 */
      ETHER_MAX_LEN = 1518

      /* switch to jumbo mode if needed */
      if (frame_size > ETHER_MAX_LEN) {
             dev->data->dev_conf.rxmode.jumbo_frame = 1;
             hlreg0 |= IXGBE_HLREG0_JUMBOEN;
      } else {
             dev->data->dev_conf.rxmode.jumbo_frame = 0;
             hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
      IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);

      /* update max frame size */
      dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;

      maxfrs = IXGBE_READ_REG(hw, IXGBE_MAXFRS);
      maxfrs &= 0x0000FFFF;
      maxfrs |= (dev->data->dev_conf.rxmode.max_rx_pkt_len << 16);
      IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, maxfrs);

Ken Coulson
Software Engineer

More information about the users mailing list