Skip to content

Commit

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

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' and
overhead, that perhaps impacts the cases of the jumbo frame related.

Fixes: e164084 ("net/dpaa2: configure jumbo frames")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  • Loading branch information
Steve Yang authored and cpaelzer committed Feb 3, 2021
1 parent b54feaf commit 5ded122
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dpaa2/dpaa2_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
if (mtu < RTE_ETHER_MIN_MTU || frame_size > DPAA2_MAX_RX_PKT_LEN)
return -EINVAL;

if (frame_size > RTE_ETHER_MAX_LEN)
if (frame_size > DPAA2_ETH_MAX_LEN)
dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
else
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/dpaa2/dpaa2_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#define MAX_TX_QUEUES 16
#define MAX_DPNI 8

#define DPAA2_ETH_MAX_LEN (RTE_ETHER_MTU + \
RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + \
VLAN_TAG_SIZE)

/*default tc to be used for ,congestion, distribution etc configuration. */
#define DPAA2_DEF_TC 0

Expand Down

0 comments on commit 5ded122

Please sign in to comment.