[v1,02/12] net/e1000: fix the jumbo frame flag condition for mtu set
Checks
Commit Message
The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition, but
the Ether overhead is larger than 18 when it supports VLAN tag. That
will cause the jumbo flag rx offload is wrong when MTU size is
'RTE_ETHER_MTU'.
This fix will change the boundary condition with 'RTE_ETHER_MTU'.
Fixes: ef990fb56e55 ("net/e1000: convert to new Rx offloads API")
Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -1816,7 +1816,7 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
rctl = E1000_READ_REG(hw, E1000_RCTL);
/* switch to jumbo mode if needed */
- if (frame_size > RTE_ETHER_MAX_LEN) {
+ if (mtu > RTE_ETHER_MTU) {
dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
rctl |= E1000_RCTL_LPE;
@@ -4369,7 +4369,7 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
rctl = E1000_READ_REG(hw, E1000_RCTL);
/* switch to jumbo mode if needed */
- if (frame_size > RTE_ETHER_MAX_LEN) {
+ if (mtu > RTE_ETHER_MTU) {
dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
rctl |= E1000_RCTL_LPE;