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 B4D8AA034C for ; Fri, 25 Feb 2022 18:16:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF507410FD; Fri, 25 Feb 2022 18:16:29 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 9A833410FD for ; Fri, 25 Feb 2022 18:16:28 +0100 (CET) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 33DEF3FCA6 for ; Fri, 25 Feb 2022 17:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809388; bh=pGoDb4VlU/ZLhg+aqNlzdpd4VTlqlVJVbzjKJq+7GMY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pmOhaZe7YPUKP9SnV9E9wUSK0DJJFCGqBmsRwIwix1dK4WaZddb0s+exUjLAIqQhD JvrLRYoHsDTDbe6Uo/ELUL/8CbY7KJpbJz+G6iQqP1baes6kL5s639wzWCe5Ss9tfk m+KHhjvhoL4DAZIW3eLpLGWpcZ0v+aFRl5XFwLv6xDvsWDO2zn128+CWjhOXgHnWOq ailUbBo8L68c2w4dUr13Pm5v3v/uJ11aNGXg0JeTKnyQol70XWOR63O17uXyWXyBGR g67FizL+XyPPw31f1pA6nBXBPcsOlVh8uUAEhwgojwvtuulIfk3OB7iGa/Pn7+/Hle oq50Vkn1rBsqA== Received: by mail-wm1-f70.google.com with SMTP id c5-20020a1c3505000000b0034a0dfc86aaso1833932wma.6 for ; Fri, 25 Feb 2022 09:16:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pGoDb4VlU/ZLhg+aqNlzdpd4VTlqlVJVbzjKJq+7GMY=; b=xTjUPaIEVP36n8dv1yoSzKKvO2up6sA1d/CODpCbz8HIWtc1NxKEEDuZpMm5STJI+m iWMHNhLp+NqpVse2TQPLfa+g8R7sMDUBW4mvrWHyazRuhgYAd9sj9stGtj65pIyYazhT 0y9dPSmLSVzYlKjILk46ZFliEk5EKxRKs1POVVBGAE7Po/3YmlUJtvokVAjulOIPqOuU D751Tb7zCqvP5TSBIVJCiKjx9Wd1x+NH5gNv1r0LrFwBuQJ6/pKvrl1Z1GxezicGvHJC DPt9io99BI4lnLokEX4w+mxqZN7LYL9k2bFZqVZiIWC3YNV86cZup5+eLedDrLpYZJVm 0OkA== X-Gm-Message-State: AOAM531XtLpQQraPWgn6PWH+CkvLb2x1hbUf0yj9ERza1sJbzoqKN6tG pq0OiDTC4DKd37ZPvnTJRz/XA2CTXBpLpSkBxkfAHPFbSJG+wk1innYFjNrvVPOoEhTdUUHAddG w49L3owDtUP/qmzcidgQhnRE+ X-Received: by 2002:a1c:4604:0:b0:381:139:e54e with SMTP id t4-20020a1c4604000000b003810139e54emr3522241wma.151.1645809387821; Fri, 25 Feb 2022 09:16:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBEXrwpHONqdF94JSlQhi47BgwFHO4QUn6doQK7gG7TEacU8TYYyvn53wSibBKiEm72bmKYA== X-Received: by 2002:a1c:4604:0:b0:381:139:e54e with SMTP id t4-20020a1c4604000000b003810139e54emr3522225wma.151.1645809387541; Fri, 25 Feb 2022 09:16:27 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003811fab7f3esm3466378wmq.30.2022.02.25.09.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:16:27 -0800 (PST) From: christian.ehrhardt@canonical.com 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 19.11.12 Date: Fri, 25 Feb 2022 18:15:04 +0100 Message-Id: <20220225171550.3499040-11-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 19.11.12 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/27/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/21d32d597349c70abf8e390cb51eb8921ef3cca5 Thanks. Christian Ehrhardt --- >From 21d32d597349c70abf8e390cb51eb8921ef3cca5 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 414845f2d7..ac7bcb59c3 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c @@ -364,6 +364,17 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, uint8_t vlan_flags; 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.35.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-25 16:58:44.714689296 +0100 +++ 0011-net-ixgbe-add-vector-Rx-parameter-check.patch 2022-02-25 16:58:44.200990377 +0100 @@ -1 +1 @@ -From c59f93d9a1e09e21e27f5bde7d8632a4d0503582 Mon Sep 17 00:00:00 2001 +From 21d32d597349c70abf8e390cb51eb8921ef3cca5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c59f93d9a1e09e21e27f5bde7d8632a4d0503582 ] + @@ -33 +34,0 @@ -Cc: stable@dpdk.org @@ -44 +45 @@ -index c56f76b368..bb34b27168 100644 +index 414845f2d7..ac7bcb59c3 100644