Skip to content

Commit

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

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 normalize the boundary condition with 'RTE_ETHER_MTU'
and overhead even though current overhead is 18.

Fixes: 9f1c002 ("net/liquidio: add API to set MTU")

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 0fcce7e commit 14dbe4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/liquidio/lio_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ lio_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
return -1;
}

if (frame_len > RTE_ETHER_MAX_LEN)
if (frame_len > LIO_ETH_MAX_LEN)
eth_dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
else
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/liquidio/lio_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#define LIO_LSC_TIMEOUT 100000 /* 100000us (100ms) */
#define LIO_MAX_CMD_TIMEOUT 10000 /* 10000ms (10s) */

/* The max frame size with default MTU */
#define LIO_ETH_MAX_LEN (RTE_ETHER_MTU + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)

#define LIO_DEV(_eth_dev) ((_eth_dev)->data->dev_private)

/* LIO Response condition variable */
Expand Down

0 comments on commit 14dbe4a

Please sign in to comment.