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 C9B7EA0093 for ; Tue, 19 May 2020 15:10:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C07E91D6A4; Tue, 19 May 2020 15:10:50 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 4D56A1D6F3 for ; Tue, 19 May 2020 15:10:49 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id n5so3524306wmd.0 for ; Tue, 19 May 2020 06:10:49 -0700 (PDT) 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=RFLJkf0E9uH9AGvwnyEQ7TZBoGCHtRii8AhSQyCIGPA=; b=pH5lL5bhLEWVlsFk0G+Y3yWx3MPd2gCQGXqOUHa7zL2zi38F0NPe5zYWvJv9OtCILm jhv1dJ5qy5NfHOqAfjazy6syrB37m5CIlXP7s+pM1BBxGTlOXx5+603hTJ2WV03KInjN DPpNE0GMfziiw3M3q09J+PmaQGGI/CEkY+oi8buE6K0jcLxE4qHHG4r1npW9L0V2yih9 +d87q72lu2Isghgwr40ffxzbT7K3DY8G46E3s+u9Zz8k16BEO+EcuwUg6GEy2hS49bkV QX/DAd+4LgDOVT8mcodak5kcM9J5UqLSsYeWnQhMOyt9ZdrtDG9pjO1vj48wom/7NBlS 6NLw== 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=RFLJkf0E9uH9AGvwnyEQ7TZBoGCHtRii8AhSQyCIGPA=; b=i2GB5kUAC3Owk1QzHZ/DXCugQxeBzQtNeckExnGkPz3OY8JaQ90z17GAbc2HOc+6I9 jFyLo91Gv7SIsVC+MWBSla9hDNtKPSrwBA3C7ShRn8QAOD3eqr1Gzb3OB3Jq6XqBl+vl S5mAyjD5B12DetPiFG+B+8TBoOkK8rfx22UIZVUl2ZDmzI++08Rpf+2xdlrY2DTl1ChI z8hIIQ26U6vEnwd+iEyAicdWIg/mNztQrTeTyN4QvrH7YelaFNRXUDc+rSoBBUewqh5t 5/CXGKFmL6R1REYt16aovylItn0wCRHLuSb4pwtvkiQnt6wCC8Xh7ucJ1MZWVI7TMQfO mB4A== X-Gm-Message-State: AOAM530uPN+EoByGbPWAcepdyjEKIUUoFefomIvSDlY09sn8rJIdxYFN kIlydBpMGy2WZfy3o74kEMA= X-Google-Smtp-Source: ABdhPJzOIZAc3slsc2DmhaEkbd/646b5gcTHIcA1LeSkluw6D+kFHAkl2EGq1IJnavEardoab+IxPA== X-Received: by 2002:a05:600c:29a:: with SMTP id 26mr5783432wmk.151.1589893849087; Tue, 19 May 2020 06:10:49 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p17sm3938415wmi.3.2020.05.19.06.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:10:48 -0700 (PDT) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: Ferruh Yigit , Stephen Hemminger , dpdk stable Date: Tue, 19 May 2020 14:03:50 +0100 Message-Id: <20200519130549.112823-95-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/tap: fix check for mbuf number of segment' has been queued to stable release 19.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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 2b74a885aafea68be58f6ad98cc2acf7af7ce086 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Thu, 16 Apr 2020 11:04:35 +0800 Subject: [PATCH] net/tap: fix check for mbuf number of segment [ upstream commit cc6cf04f59ec20757990b3e8586b7c3a7f497720 ] Now the rxq->pool is mbuf concatenation, but its nb_segs is 1. When conducting some sanity checks on the mbuf with debug enabled, it fails. Fixes: 0781f5762cfe ("net/tap: support segmented mbufs") Signed-off-by: Yunjian Wang Reviewed-by: Ferruh Yigit Acked-by: Stephen Hemminger --- drivers/net/tap/rte_eth_tap.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 9c88b9268e..2846ce0d3e 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -338,6 +338,23 @@ tap_rx_offload_get_queue_capa(void) DEV_RX_OFFLOAD_TCP_CKSUM; } +static void +tap_rxq_pool_free(struct rte_mbuf *pool) +{ + struct rte_mbuf *mbuf = pool; + uint16_t nb_segs = 1; + + if (mbuf == NULL) + return; + + while (mbuf->next) { + mbuf = mbuf->next; + nb_segs++; + } + pool->nb_segs = nb_segs; + rte_pktmbuf_free(pool); +} + /* Callback to handle the rx burst of packets to the correct interface and * file descriptor(s) in a multi-queue setup. */ @@ -388,7 +405,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) goto end; seg->next = NULL; - rte_pktmbuf_free(mbuf); + tap_rxq_pool_free(mbuf); goto end; } @@ -1035,7 +1052,7 @@ tap_dev_close(struct rte_eth_dev *dev) rxq = &internals->rxq[i]; close(process_private->rxq_fds[i]); process_private->rxq_fds[i] = -1; - rte_pktmbuf_free(rxq->pool); + tap_rxq_pool_free(rxq->pool); rte_free(rxq->iovecs); rxq->pool = NULL; rxq->iovecs = NULL; @@ -1074,7 +1091,7 @@ tap_rx_queue_release(void *queue) if (process_private->rxq_fds[rxq->queue_id] > 0) { close(process_private->rxq_fds[rxq->queue_id]); process_private->rxq_fds[rxq->queue_id] = -1; - rte_pktmbuf_free(rxq->pool); + tap_rxq_pool_free(rxq->pool); rte_free(rxq->iovecs); rxq->pool = NULL; rxq->iovecs = NULL; @@ -1484,7 +1501,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev, return 0; error: - rte_pktmbuf_free(rxq->pool); + tap_rxq_pool_free(rxq->pool); rxq->pool = NULL; rte_free(rxq->iovecs); rxq->iovecs = NULL; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:48.345034391 +0100 +++ 0095-net-tap-fix-check-for-mbuf-number-of-segment.patch 2020-05-19 14:04:44.304649968 +0100 @@ -1,13 +1,14 @@ -From cc6cf04f59ec20757990b3e8586b7c3a7f497720 Mon Sep 17 00:00:00 2001 +From 2b74a885aafea68be58f6ad98cc2acf7af7ce086 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Thu, 16 Apr 2020 11:04:35 +0800 Subject: [PATCH] net/tap: fix check for mbuf number of segment +[ upstream commit cc6cf04f59ec20757990b3e8586b7c3a7f497720 ] + Now the rxq->pool is mbuf concatenation, but its nb_segs is 1. When conducting some sanity checks on the mbuf with debug enabled, it fails. Fixes: 0781f5762cfe ("net/tap: support segmented mbufs") -Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Reviewed-by: Ferruh Yigit