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 F1DD9A04DD for ; Wed, 28 Oct 2020 11:55:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA54FCA90; Wed, 28 Oct 2020 11:55:07 +0100 (CET) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by dpdk.org (Postfix) with ESMTP id 8C30DCA62 for ; Wed, 28 Oct 2020 11:55:04 +0100 (CET) Received: by mail-wm1-f53.google.com with SMTP id k21so3006158wmi.1 for ; Wed, 28 Oct 2020 03:55:04 -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=xLzWwawwQBbM/gxP81WqPzvYMBgszCrMlkeUEsxS7FI=; b=Ksf2fGwBGIhfaPaDf48K/P9W58lKAFm7kNj0RSkTShth/ScDxfdEdjbH7aevxyqpm3 DmKM76XKHLN075v7lAoVWY8yOB/dE98AAHbc7E/Dbg2MwU1oDTJ6pzQLYdbegLVG1i/n 4jDwcfW4gQ8fiHQMuFDQy7XWOpPaus7gGru9gzN6fmnErYgVBU9T38VQxuvGrW+W/jRs YbuTnVUFmVQz0dda2AFBDyqp2Zc8lpv8+gkLRF1iKi7OkCcOuGo9Rdpxo4YFuhkRzW5J O/6VoneEsONbjftPyLwi/6y+KCq38ntjtwnPuNi+9VuQqB3DXc7hhgmLSksIc/cN8dnE i5YQ== 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=xLzWwawwQBbM/gxP81WqPzvYMBgszCrMlkeUEsxS7FI=; b=jKobs5K1q7YmeaDesXsu1oiO1CbBi/S7rZItsHo5HxpuRs/DsYiSlC9Sk/Eyp1S+lQ SIGn2TUM7iD9W+18doS3IFLK4HrNC97ZvKAfgTIGGCKtUCfO4O/QAFTaANgCEddDTmfw UXfJbvL7iRRL9dQlh1hXSlFoBPS1uDiF7QZJWE9b3iJhP6TR7FBgR2AR9IJLmLxvO1lP FvbJkLdG8DTwAaTMZ8Re2xPIVE46gczIkRns4XK87w06GvNeyrbzcwlMDzwn3Xx004JT WI+MV0VWSFeEIsLcO+TQJRScpEjrPVhIntVo4hXOCGVpyCa/F8NFiExRBtMXgz80zXqS xa1Q== X-Gm-Message-State: AOAM532tIxdT39JwjugBX3tokY6ftdHmejCjdMdDYh48wTW0doezADl4 wtewVpplIq9sJTcPfvYyJPk= X-Google-Smtp-Source: ABdhPJyjcoxZAJ9WsdanwC9P9Yc3Ym19zQQrwSqyiQ+IAXKh/9kPEDYgWPuQJ1zN0jVJie1SDjMMdA== X-Received: by 2002:a7b:c451:: with SMTP id l17mr7653821wmi.127.1603882504336; Wed, 28 Oct 2020 03:55:04 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 66sm1218894wmb.3.2020.10.28.03.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:55:03 -0700 (PDT) From: luca.boccassi@gmail.com To: Honnappa Nagarahalli Cc: Phil Yang , Ruifeng Wang , Jakub Grajciar , dpdk stable Date: Wed, 28 Oct 2020 10:45:27 +0000 Message-Id: <20201028104606.3504127-168-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/memif: do not update local copy of tail in Tx' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/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 0f3cfad7f4a430d876a9c8470f58d8fb93bb00f6 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Mon, 28 Sep 2020 14:03:27 -0500 Subject: [PATCH] net/memif: do not update local copy of tail in Tx [ upstream commit 7fff1d311372d5dc850abbc5d09fe5cfc966538c ] In the case of S2M queues, the receiver synchronizes with the sender (i.e. informs of the packets it has received) using ring->tail. Hence, the sender does not need to update last_tail. In the case of M2S queues, the receiver uses last_tail to keep track of the descriptors it has received. The sender is not required to update the last_tail. Updating the last_tail makes it a shared variable between the transmitter and receiver affecting the performance. Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") Signed-off-by: Honnappa Nagarahalli Reviewed-by: Phil Yang Reviewed-by: Ruifeng Wang Reviewed-by: Jakub Grajciar --- drivers/net/memif/rte_eth_memif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index aa83df3652..1c41988069 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -561,12 +561,10 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ring_size = 1 << mq->log2_ring_size; mask = ring_size - 1; - n_free = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE) - mq->last_tail; - mq->last_tail += n_free; - if (type == MEMIF_RING_S2M) { slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE); - n_free = ring_size - slot + mq->last_tail; + n_free = ring_size - slot + + __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE); } else { slot = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE); n_free = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE) - slot; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:16.941435084 +0000 +++ 0168-net-memif-do-not-update-local-copy-of-tail-in-Tx.patch 2020-10-28 10:35:11.772833968 +0000 @@ -1,8 +1,10 @@ -From 7fff1d311372d5dc850abbc5d09fe5cfc966538c Mon Sep 17 00:00:00 2001 +From 0f3cfad7f4a430d876a9c8470f58d8fb93bb00f6 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Mon, 28 Sep 2020 14:03:27 -0500 Subject: [PATCH] net/memif: do not update local copy of tail in Tx +[ upstream commit 7fff1d311372d5dc850abbc5d09fe5cfc966538c ] + In the case of S2M queues, the receiver synchronizes with the sender (i.e. informs of the packets it has received) using ring->tail. Hence, the sender does not need to update last_tail. @@ -14,7 +16,6 @@ transmitter and receiver affecting the performance. Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD") -Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Phil Yang @@ -25,10 +26,10 @@ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c -index ff8a58081f..d749b5b16c 100644 +index aa83df3652..1c41988069 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c -@@ -580,12 +580,10 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -561,12 +561,10 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ring_size = 1 << mq->log2_ring_size; mask = ring_size - 1;