From: Jiaqi Min Date: Mon, 4 Nov 2019 15:33:32 +0000 (+0000) Subject: net/ice: fix setting max frame size X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1161029318a94eba01ea3e23553bb2106cab4056;p=dpdk.git net/ice: fix setting max frame size Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue. Fixes: 50370662b727 ("net/ice: support device and queue ops") Cc: stable@dpdk.org Signed-off-by: Jiaqi Min Reviewed-by: Xiaolong Ye --- diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index d746758421..9d2210a45e 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2657,6 +2657,7 @@ ice_dev_start(struct rte_eth_dev *dev) struct ice_vsi *vsi = pf->main_vsi; uint16_t nb_rxq = 0; uint16_t nb_txq, i; + uint16_t max_frame_size; int mask, ret; /* program Tx queues' context in hardware */ @@ -2724,6 +2725,14 @@ ice_dev_start(struct rte_eth_dev *dev) pf->adapter_stopped = false; + /* Set the max frame size to default value*/ + max_frame_size = pf->dev_data->dev_conf.rxmode.max_rx_pkt_len ? + pf->dev_data->dev_conf.rxmode.max_rx_pkt_len : + ICE_FRAME_SIZE_MAX; + + /* Set the max frame size to HW*/ + ice_aq_set_mac_cfg(hw, max_frame_size, NULL); + return 0; /* stop the started queues if failed to start all queues */