From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 17791A0553 for ; Mon, 17 Feb 2020 18:46:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 112371DA12; Mon, 17 Feb 2020 18:46:43 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id DB0DD1DA12 for ; Mon, 17 Feb 2020 18:46:41 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id u6so20853091wrt.0 for ; Mon, 17 Feb 2020 09:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nv146RUoP2WbMLj8ZyPT5DawB+NZg5Ls1PN72aa5TPg=; b=BjJ03uLkvp+lZCdvsdyb7T3WwyPuk5jVBPZBb+/U0j86pIvQodADk4gYa8P/ejI8ff ztBUd6fWqrN8DjsbNoE/7NrfrzN3GjwDz0O2lYW6a50Z0Q2RSvS+myKRbO1NeUiBtUtI kRcZFi1Ydi/B3kx53RZ3g4LrVxYYmDCNJKKk2DRS5sRKry5nr9Kgh0EJV8VQJKb27ZkH KA4RFNfDJrNWItGuu7hqMxsKrAsIXYZ9AO5c77qHKLm0KeKm1jWptoBieESDd+JBGbec Nk2ZW1TEYMTQOmK4FTmnQfmE60Tm8ReVovJ9ZqkPQscJLB55fzKF3aeMnOA/HH3oiyvS aETw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nv146RUoP2WbMLj8ZyPT5DawB+NZg5Ls1PN72aa5TPg=; b=pbQhm16Z3KcaTsYa/fMfHJMFyVZeTIa/JH+eqVPORekLgA4GE/Ofjp65sPe1Xwi+Ki mWw0OVTux2dyc/XON1xli2Et63mMLqdTQkA1Doq6N1Ph0o+nerfNnoqLrN79yIsBmBxc qpDPfJnOr2/McgcExxCL4csggLjgu0XRyLeBzMZbA1VEuBqcTcFjUpuQxtm8B2Mn8BVT qzF7CUj9DwkxcJEVKIvzfHWUm+oHqH8ModNAL9tKE0QDf/tCxUIaNEhSm/QVgaQGAmWd wFZW1TwGe7SfHpJuVZTk1LCVF/ZZrTUiwSdeHGy8aI9acWARIvY/njx3UMlYDiAfed2K ixSg== X-Gm-Message-State: APjAAAUOVizB5axaV9Ssl30KS/TH5AVBwxX30O0njv3fhLUhPm5X56pM xM9WP4iFC+Zi2bu5sqz6LU8= X-Google-Smtp-Source: APXvYqzljxUA2xTFtTs6lWWh6vgNS3fMD6IYETPPgTpYTAmvNr4R6GD85CJnXWUD6IELVLajlUbHCw== X-Received: by 2002:adf:e68d:: with SMTP id r13mr23037240wrm.349.1581961601649; Mon, 17 Feb 2020 09:46:41 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id n3sm179831wmc.27.2020.02.17.09.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:41 -0800 (PST) From: luca.boccassi@gmail.com To: Ciara Loftus Cc: Xiaolong Ye , dpdk stable Date: Mon, 17 Feb 2020 17:45:24 +0000 Message-Id: <20200217174546.25334-32-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/af_xdp: fix maximum MTU' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 4517e8b0bee0870ca82fb76d93c0ff0d914e2e63 Mon Sep 17 00:00:00 2001 From: Ciara Loftus Date: Thu, 13 Feb 2020 08:49:14 +0000 Subject: [PATCH] net/af_xdp: fix maximum MTU [ upstream commit 1668e87d4d51e9f4c333dcafa0c3e189b1eaee35 ] The maximum MTU for af_xdp zero copy is equal to the page size less the frame overhead introduced by AF_XDP (XDP HR = 256) and DPDK (frame headroom = 320). The patch updates this value to reflect this. This change also makes it possible to remove unneeded constants for both zero-copy and copy mode. Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") Signed-off-by: Ciara Loftus Reviewed-by: Xiaolong Ye --- drivers/net/af_xdp/rte_eth_af_xdp.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 24c70473c3..d75281c10d 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -59,13 +59,6 @@ static int af_xdp_logtype; #define ETH_AF_XDP_FRAME_SIZE 2048 #define ETH_AF_XDP_NUM_BUFFERS 4096 -#ifdef XDP_UMEM_UNALIGNED_CHUNK_FLAG -#define ETH_AF_XDP_MBUF_OVERHEAD 128 /* sizeof(struct rte_mbuf) */ -#define ETH_AF_XDP_DATA_HEADROOM \ - (ETH_AF_XDP_MBUF_OVERHEAD + RTE_PKTMBUF_HEADROOM) -#else -#define ETH_AF_XDP_DATA_HEADROOM 0 -#endif #define ETH_AF_XDP_DFLT_NUM_DESCS XSK_RING_CONS__DEFAULT_NUM_DESCS #define ETH_AF_XDP_DFLT_START_QUEUE_IDX 0 #define ETH_AF_XDP_DFLT_QUEUE_COUNT 1 @@ -602,7 +595,14 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_tx_queues = internals->queue_cnt; dev_info->min_mtu = RTE_ETHER_MIN_MTU; - dev_info->max_mtu = ETH_AF_XDP_FRAME_SIZE - ETH_AF_XDP_DATA_HEADROOM; +#if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) + dev_info->max_mtu = getpagesize() - + sizeof(struct rte_mempool_objhdr) - + sizeof(struct rte_mbuf) - + RTE_PKTMBUF_HEADROOM - XDP_PACKET_HEADROOM; +#else + dev_info->max_mtu = ETH_AF_XDP_FRAME_SIZE - XDP_PACKET_HEADROOM; +#endif dev_info->default_rxportconf.nb_queues = 1; dev_info->default_txportconf.nb_queues = 1; @@ -804,7 +804,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, .fill_size = ETH_AF_XDP_DFLT_NUM_DESCS, .comp_size = ETH_AF_XDP_DFLT_NUM_DESCS, .frame_size = ETH_AF_XDP_FRAME_SIZE, - .frame_headroom = ETH_AF_XDP_DATA_HEADROOM }; + .frame_headroom = 0 }; char ring_name[RTE_RING_NAMESIZE]; char mz_name[RTE_MEMZONE_NAMESIZE]; int ret; @@ -829,8 +829,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, for (i = 0; i < ETH_AF_XDP_NUM_BUFFERS; i++) rte_ring_enqueue(umem->buf_ring, - (void *)(i * ETH_AF_XDP_FRAME_SIZE + - ETH_AF_XDP_DATA_HEADROOM)); + (void *)(i * ETH_AF_XDP_FRAME_SIZE)); snprintf(mz_name, sizeof(mz_name), "af_xdp_umem_%s_%u", internals->if_name, rxq->xsk_queue_idx); @@ -939,7 +938,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, /* Now get the space available for data in the mbuf */ buf_size = rte_pktmbuf_data_room_size(mb_pool) - RTE_PKTMBUF_HEADROOM; - data_size = ETH_AF_XDP_FRAME_SIZE - ETH_AF_XDP_DATA_HEADROOM; + data_size = ETH_AF_XDP_FRAME_SIZE; if (data_size > buf_size) { AF_XDP_LOG(ERR, "%s: %d bytes will not fit in mbuf (%d bytes)\n", -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.219819347 +0000 +++ 0032-net-af_xdp-fix-maximum-MTU.patch 2020-02-17 17:00:15.347951022 +0000 @@ -1,8 +1,10 @@ -From 1668e87d4d51e9f4c333dcafa0c3e189b1eaee35 Mon Sep 17 00:00:00 2001 +From 4517e8b0bee0870ca82fb76d93c0ff0d914e2e63 Mon Sep 17 00:00:00 2001 From: Ciara Loftus Date: Thu, 13 Feb 2020 08:49:14 +0000 Subject: [PATCH] net/af_xdp: fix maximum MTU +[ upstream commit 1668e87d4d51e9f4c333dcafa0c3e189b1eaee35 ] + The maximum MTU for af_xdp zero copy is equal to the page size less the frame overhead introduced by AF_XDP (XDP HR = 256) and DPDK (frame headroom = 320). The patch updates this value to reflect this. @@ -11,7 +13,6 @@ zero-copy and copy mode. Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") -Cc: stable@dpdk.org Signed-off-by: Ciara Loftus Reviewed-by: Xiaolong Ye @@ -20,10 +21,10 @@ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c -index a0edfc3cd3..06124ba789 100644 +index 24c70473c3..d75281c10d 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c -@@ -58,13 +58,6 @@ static int af_xdp_logtype; +@@ -59,13 +59,6 @@ static int af_xdp_logtype; #define ETH_AF_XDP_FRAME_SIZE 2048 #define ETH_AF_XDP_NUM_BUFFERS 4096 @@ -37,7 +38,7 @@ #define ETH_AF_XDP_DFLT_NUM_DESCS XSK_RING_CONS__DEFAULT_NUM_DESCS #define ETH_AF_XDP_DFLT_START_QUEUE_IDX 0 #define ETH_AF_XDP_DFLT_QUEUE_COUNT 1 -@@ -601,7 +594,14 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) +@@ -602,7 +595,14 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_tx_queues = internals->queue_cnt; dev_info->min_mtu = RTE_ETHER_MIN_MTU; @@ -53,7 +54,7 @@ dev_info->default_rxportconf.nb_queues = 1; dev_info->default_txportconf.nb_queues = 1; -@@ -803,7 +803,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, +@@ -804,7 +804,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, .fill_size = ETH_AF_XDP_DFLT_NUM_DESCS, .comp_size = ETH_AF_XDP_DFLT_NUM_DESCS, .frame_size = ETH_AF_XDP_FRAME_SIZE, @@ -62,7 +63,7 @@ char ring_name[RTE_RING_NAMESIZE]; char mz_name[RTE_MEMZONE_NAMESIZE]; int ret; -@@ -828,8 +828,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, +@@ -829,8 +829,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals, for (i = 0; i < ETH_AF_XDP_NUM_BUFFERS; i++) rte_ring_enqueue(umem->buf_ring, @@ -72,7 +73,7 @@ snprintf(mz_name, sizeof(mz_name), "af_xdp_umem_%s_%u", internals->if_name, rxq->xsk_queue_idx); -@@ -938,7 +937,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, +@@ -939,7 +938,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, /* Now get the space available for data in the mbuf */ buf_size = rte_pktmbuf_data_room_size(mb_pool) - RTE_PKTMBUF_HEADROOM;