Skip to content

Commit

Permalink
net/nfp: fix jumbo frame flag condition for MTU set
Browse files Browse the repository at this point in the history
[ upstream commit a36974f ]

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition.
If 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',
that perhaps impacts the cases of the jumbo frame related.

Fixes: d4a27a3 ("nfp: add basic features")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
Steve Yang authored and cpaelzer committed Feb 3, 2021
1 parent 440d466 commit 0fcce7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/nfp/nfp_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
}

/* switch to jumbo mode if needed */
if ((uint32_t)mtu > RTE_ETHER_MAX_LEN)
if ((uint32_t)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;
Expand Down

0 comments on commit 0fcce7e

Please sign in to comment.