From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BF883A034E for ; Mon, 21 Feb 2022 16:38:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9C4441147; Mon, 21 Feb 2022 16:38:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 361924013F for ; Mon, 21 Feb 2022 16:38:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0yQdCK3YqG3/eE8FR4KYKpNTkyuOGyVfQDwIubNaM1Y=; b=gthCyGtvplnyNa6UewUuyjz5Ek486MKi5fPVz3YU7PMwsyFnu/0hfXNHpvqZpXnTVU7KA6 +EZ6Yp2wzbmD/cRq/aMLTedpmOxGeAiwDhi8FRsH/OEegSEmxVpfLd7+cvHIaaWosCYEu7 UPz87geAxf+0cBAkRMfH5PDQSts07Dg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-gr_KoOM4Mz6wZUZ2K3GcCg-1; Mon, 21 Feb 2022 10:38:05 -0500 X-MC-Unique: gr_KoOM4Mz6wZUZ2K3GcCg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0287F801AC5; Mon, 21 Feb 2022 15:38:04 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 669157E2EF; Mon, 21 Feb 2022 15:38:02 +0000 (UTC) From: Kevin Traynor To: Bin Zheng Cc: Leyi Rong , Haiyue Wang , Liang Ma , dpdk stable Subject: patch 'net/ixgbe: add vector Rx parameter check' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:33:49 +0000 Message-Id: <20220221153625.152324-40-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.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/26/22. 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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/0832935bf59487e7f9db2f9f7b9df322d2919f2d Thanks. Kevin --- >From 0832935bf59487e7f9db2f9f7b9df322d2919f2d Mon Sep 17 00:00:00 2001 From: Bin Zheng Date: Fri, 10 Dec 2021 16:22:09 +0800 Subject: [PATCH] net/ixgbe: add vector Rx parameter check [ upstream commit c59f93d9a1e09e21e27f5bde7d8632a4d0503582 ] Under the circumstance that `rx_tail` wrap back to zero and the advance speed of `rx_tail` is greater than `rxrearm_start`, `rx_tail` will catch up with `rxrearm_start` and surpass it. This may cause some mbufs be reused by application. So we need to make some restrictions to ensure that `rx_tail` will not exceed `rxrearm_start`. e.g. RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959 RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991 RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023 RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0 RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88 RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95 ... RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895 RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927 RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959 RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994 when `rx_tail` catches up with `rxrearm_start`, 2(994 - 992) mbufs be reused by application ! Bugzilla ID: 882 Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx") Signed-off-by: Bin Zheng Acked-by: Leyi Rong Reviewed-by: Haiyue Wang Reviewed-by: Liang Ma --- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c index c56f76b368..bb34b27168 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c @@ -365,4 +365,15 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, uint16_t udp_p_flag = 0; /* Rx Descriptor UDP header present */ + /* + * Under the circumstance that `rx_tail` wrap back to zero + * and the advance speed of `rx_tail` is greater than `rxrearm_start`, + * `rx_tail` will catch up with `rxrearm_start` and surpass it. + * This may cause some mbufs be reused by application. + * + * So we need to make some restrictions to ensure that + * `rx_tail` will not exceed `rxrearm_start`. + */ + nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_RXQ_REARM_THRESH); + /* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:45.521119992 +0000 +++ 0040-net-ixgbe-add-vector-Rx-parameter-check.patch 2022-02-21 15:22:44.086704114 +0000 @@ -1 +1 @@ -From c59f93d9a1e09e21e27f5bde7d8632a4d0503582 Mon Sep 17 00:00:00 2001 +From 0832935bf59487e7f9db2f9f7b9df322d2919f2d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c59f93d9a1e09e21e27f5bde7d8632a4d0503582 ] + @@ -33 +34,0 @@ -Cc: stable@dpdk.org