From: Raslan Darawsheh Date: Mon, 24 Oct 2016 08:10:59 +0000 (+0300) Subject: net/mlx5: fix handling of small mbuf sizes X-Git-Tag: spdx-start~5364 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4827cbff602aef4d9afcc19742841063a0ecd08f;p=dpdk.git net/mlx5: fix handling of small mbuf sizes When mbufs are smaller than MRU, multi-segment support must be enabled to default set when not in promiscuous or allmulticast modes. Fixes: 9964b965ad69 ("net/mlx5: re-add Rx scatter support") Signed-off-by: Raslan Darawsheh Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 4dc5cc3916..28e93d3ee0 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -946,6 +946,11 @@ rxq_ctrl_setup(struct rte_eth_dev *dev, struct rxq_ctrl *rxq_ctrl, (void)conf; /* Thresholds configuration (ignored). */ /* Enable scattered packets support for this queue if necessary. */ assert(mb_len >= RTE_PKTMBUF_HEADROOM); + /* If smaller than MRU, multi-segment support must be enabled. */ + if (mb_len < (priv->mtu > dev->data->dev_conf.rxmode.max_rx_pkt_len ? + dev->data->dev_conf.rxmode.max_rx_pkt_len : + priv->mtu)) + dev->data->dev_conf.rxmode.jumbo_frame = 1; if ((dev->data->dev_conf.rxmode.jumbo_frame) && (dev->data->dev_conf.rxmode.max_rx_pkt_len > (mb_len - RTE_PKTMBUF_HEADROOM))) {