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 E2159A0553 for ; Mon, 17 Feb 2020 18:46:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD2231DA12; Mon, 17 Feb 2020 18:46:39 +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 EEAF21DABA for ; Mon, 17 Feb 2020 18:46:38 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id z3so20841491wru.3 for ; Mon, 17 Feb 2020 09:46:38 -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=fRxbxYXsrwOE+QWaXOCQLW9yoJFsUmoQmZQTPz8PieY=; b=FZ15keVTz2yzoWzN/5aDYkDRs2/W+6SYXNvjQSWwie4ACoBzrl52Dfz1l3wIaQEisX cN1sFV11Rp71UtBSHg+8iKNxQAGUSDScRxK5mMgk0UQIXAeDi1h17+t8Nnf62dZT6z5F +PV3FbHYfVjY38pVVZuUh2bR0B60G89sb2CjrwTnSeF3mUPU5Cfj+rPRFhqsnzOU3igL fTDPS5v8NHsE4y5O/u7Z5lD+DO7y7x4BJ2e7K9/PwGJxaPlXQab8NsxRYPXB2AGneqhI o0+LJMulxRyn6oxBVX3fdAv2rltgvuhTlYuA4ddBFIZQ6wZwKFIW6X0PKQJlBv1GpP9A JBhQ== 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=fRxbxYXsrwOE+QWaXOCQLW9yoJFsUmoQmZQTPz8PieY=; b=lxAM6ftmGcEGVBZFN/CCeZ4Nt3WsMTkPHvyWjVJ2+jwfxEnRpppNSgyDEW3Mm3EtXg etVNA/9OWNhYYXzKzFKMbDr2GdP1UtS4DGHjP8zPJ3lBYmIYLQ2KzQ1ubXF0pO9JtWko WGvxllvSrI0zqNnRvMAQNN4nVdF+8yM8deeiwkukg51CwYBydYlWkdDkElTLCq4X1LIB K71fBIF/p86xOIpSPgGJUrTuSh0A/nuF7QCL8qJNPrVFKrX8HSuISRSgQ31O9fg6lJgK gEgR+qWLTtCDhTcJR4aYHqYl2s+llIkXvzMy29kcypeYqqPlbZQbywi3PVGwfzt08UYY 9Nmw== X-Gm-Message-State: APjAAAWi5T/zZQwpnChoO0cTU2sBrHPVhiJi3UzNZKGaBnYOI66y17Wh v04qaaCGG5bCzNevOmgfVZM= X-Google-Smtp-Source: APXvYqwsMrK8t3zWP1ONbbGp2NbROtOTpRu2U38NaPvw4BUG5fFMLp5YiP2pYGHjgpezRvIpNYaDog== X-Received: by 2002:adf:b351:: with SMTP id k17mr23143192wrd.199.1581961598731; Mon, 17 Feb 2020 09:46:38 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id y131sm223411wmc.13.2020.02.17.09.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:38 -0800 (PST) From: luca.boccassi@gmail.com To: Ciara Loftus Cc: Xiaolong Ye , dpdk stable Date: Mon, 17 Feb 2020 17:45:22 +0000 Message-Id: <20200217174546.25334-30-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 umem frame size and headroom' 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 4f343be652008ae7b7006c4a9b916668c186de00 Mon Sep 17 00:00:00 2001 From: Ciara Loftus Date: Thu, 13 Feb 2020 08:49:12 +0000 Subject: [PATCH] net/af_xdp: fix umem frame size and headroom [ upstream commit b79ae90c78a143605610ed5c7d59d42c0846847f ] The previous frame size calculation incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size. Instead of performing a manual calculation, use the rte_mempool_calc_obj_size API to determine the frame size. The previous frame headroom calculation also incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size or the mbuf priv size. Fix this. 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index d903e6c28a..348dbde5e6 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -755,11 +756,13 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals __rte_unused, void *base_addr = NULL; struct rte_mempool *mb_pool = rxq->mb_pool; - usr_config.frame_size = rte_pktmbuf_data_room_size(mb_pool) + - ETH_AF_XDP_MBUF_OVERHEAD + - mb_pool->private_data_size; - usr_config.frame_headroom = ETH_AF_XDP_DATA_HEADROOM + - mb_pool->private_data_size; + usr_config.frame_size = rte_mempool_calc_obj_size(mb_pool->elt_size, + mb_pool->flags, + NULL); + usr_config.frame_headroom = mb_pool->header_size + + sizeof(struct rte_mbuf) + + rte_pktmbuf_priv_size(mb_pool) + + RTE_PKTMBUF_HEADROOM; umem = rte_zmalloc_socket("umem", sizeof(*umem), 0, rte_socket_id()); if (umem == NULL) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.169058692 +0000 +++ 0030-net-af_xdp-fix-umem-frame-size-and-headroom.patch 2020-02-17 17:00:15.347951022 +0000 @@ -1,8 +1,10 @@ -From b79ae90c78a143605610ed5c7d59d42c0846847f Mon Sep 17 00:00:00 2001 +From 4f343be652008ae7b7006c4a9b916668c186de00 Mon Sep 17 00:00:00 2001 From: Ciara Loftus Date: Thu, 13 Feb 2020 08:49:12 +0000 Subject: [PATCH] net/af_xdp: fix umem frame size and headroom +[ upstream commit b79ae90c78a143605610ed5c7d59d42c0846847f ] + The previous frame size calculation incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size. Instead of performing a manual calculation, use the @@ -13,7 +15,6 @@ the mbuf priv size. Fix this. Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") -Cc: stable@dpdk.org Signed-off-by: Ciara Loftus Reviewed-by: Xiaolong Ye @@ -22,10 +23,10 @@ 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c -index ed784dff19..111ab000cc 100644 +index d903e6c28a..348dbde5e6 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c -@@ -33,6 +33,7 @@ +@@ -34,6 +34,7 @@ #include #include #include @@ -33,7 +34,7 @@ #include #include #include -@@ -754,11 +755,13 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals __rte_unused, +@@ -755,11 +756,13 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals __rte_unused, void *base_addr = NULL; struct rte_mempool *mb_pool = rxq->mb_pool;