From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id D246029CA for ; Mon, 24 Oct 2016 10:11:05 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from root@r-aa-dragon7.rdmz.labs.mlnx) with ESMTPS (AES256-SHA encrypted); 24 Oct 2016 10:11:01 +0200 Received: from r-aa-dragon7.rdmz.labs.mlnx (r-aa-dragon7.rdmz.labs.mlnx [10.224.14.90]) by filer02.rdmz.labs.mlnx (8.13.8/8.13.8) with ESMTP id u9O8B1WX019365; Mon, 24 Oct 2016 11:11:01 +0300 Received: from r-aa-dragon7.rdmz.labs.mlnx (localhost [127.0.0.1]) by r-aa-dragon7.rdmz.labs.mlnx (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u9O8B2WP014317; Mon, 24 Oct 2016 11:11:02 +0300 Received: (from root@localhost) by r-aa-dragon7.rdmz.labs.mlnx (8.14.4/8.14.4/Submit) id u9O8B1w6014316; Mon, 24 Oct 2016 11:11:01 +0300 From: Raslan Darawsheh To: dev@dpdk.org Cc: Raslan Darawsheh , Adrien Mazarguil Date: Mon, 24 Oct 2016 11:10:59 +0300 Message-Id: <937aac679e571c4fff8ab720f4dd910fe10a283e.1477296585.git.rasland@mellanox.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix handling of small mbuf sizes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 08:11:06 -0000 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 --- drivers/net/mlx5/mlx5_rxq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 4dc5cc3..62253ed 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -946,6 +946,12 @@ 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))) { -- 1.9.1