Skip to content

Commit

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

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: 70d6b7f ("net/ipn3ke: add representor")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
  • Loading branch information
Steve Yang authored and bluca committed Feb 4, 2021
1 parent 54fcc7f commit 1cad5ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/ipn3ke/ipn3ke_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ ipn3ke_tm_ops_get(struct rte_eth_dev *ethdev,
*/
#define IPN3KE_ETH_OVERHEAD \
(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + IPN3KE_VLAN_TAG_SIZE * 2)
#define IPN3KE_ETH_MAX_LEN (RTE_ETHER_MTU + IPN3KE_ETH_OVERHEAD)

#define IPN3KE_MAC_FRAME_SIZE_MAX 9728
#define IPN3KE_MAC_RX_FRAME_MAXLENGTH 0x00AE
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ipn3ke/ipn3ke_representor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2801,7 +2801,7 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu)
return -EBUSY;
}

if (frame_size > RTE_ETHER_MAX_LEN)
if (frame_size > IPN3KE_ETH_MAX_LEN)
dev_data->dev_conf.rxmode.offloads |=
(uint64_t)(DEV_RX_OFFLOAD_JUMBO_FRAME);
else
Expand Down

0 comments on commit 1cad5ab

Please sign in to comment.