Skip to content

Commit

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

The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
but the Ether overhead is larger than 18 when it supports dual VLAN tags.
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: 200645a ("net/qede: 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 bluca committed Feb 4, 2021
1 parent 297cbb2 commit e51e029
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/qede/qede_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
fp->rxq->rx_buf_size = rc;
}
}
if (max_rx_pkt_len > RTE_ETHER_MAX_LEN)
if (frame_size > QEDE_ETH_MAX_LEN)
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
1 change: 1 addition & 0 deletions drivers/net/qede/qede_rxtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
+ (QEDE_LLC_SNAP_HDR_LEN) + 2)

#define QEDE_MAX_ETHER_HDR_LEN (RTE_ETHER_HDR_LEN + QEDE_ETH_OVERHEAD)
#define QEDE_ETH_MAX_LEN (RTE_ETHER_MTU + QEDE_MAX_ETHER_HDR_LEN)

#define QEDE_RSS_OFFLOAD_ALL (ETH_RSS_IPV4 |\
ETH_RSS_NONFRAG_IPV4_TCP |\
Expand Down

0 comments on commit e51e029

Please sign in to comment.