From: "Coulson, Ken" <kcoulson@ciena.com>
To: "dev@dpdk.org" <dev@dpdk.org>, "users@dpdk.org" <users@dpdk.org>
Subject: [dpdk-users] Question about driver/controller MTU enforcement with MTU less than jumbo frame size
Date: Tue, 9 May 2017 21:02:24 +0000 [thread overview]
Message-ID: <D5377C6E.251BB%kcoulson@ciena.com> (raw)
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 8.2.3.22.13, 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
509-242-9273
Ciena
next reply other threads:[~2017-05-09 21:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 21:02 Coulson, Ken [this message]
2017-05-10 8:36 ` [dpdk-users] [dpdk-dev] " Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D5377C6E.251BB%kcoulson@ciena.com \
--to=kcoulson@ciena.com \
--cc=dev@dpdk.org \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).