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 C565141D4F for ; Thu, 23 Feb 2023 10:38:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEDD443158; Thu, 23 Feb 2023 10:38:29 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 12C1443152 for ; Thu, 23 Feb 2023 10:38:28 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id p3-20020a05600c358300b003e206711347so7649026wmq.0 for ; Thu, 23 Feb 2023 01:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DxJ9FfMHObh2Vn779M6aB9MU6r3SEdOKh5ft35wg4zo=; b=WXPaI4MBheU/HLawRQK1/U7jSKQ64MTmQT3BPfSveOtItK01E97JsDn3PO0k0Q2t0j eEw5ppZvqXL4zzDWfYBp3pVxjt2GqXRdZmXh2i8Vg5eE91QDJyYK8zTQV/7Eg9b5Y/u/ lQEEELW1SM+3ZT4O7FrkOrLgOxkN6mEkRwH+g8R1xEbyzmKexWljkmCVDdJsZ5CMCRYZ iIcmr5+cExO2+vlsxpbmFyQ1BrKYnOpabkyOrJjQK4VTuMWbhKtr2NvtcDrbMrr7i7ar IUdGCLUI9mDpdr0AxJ6JnTdQy+F8t569ocZRvdFNcyOjPX+R6psYF+fNWVfC4/8MhbDe aUjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DxJ9FfMHObh2Vn779M6aB9MU6r3SEdOKh5ft35wg4zo=; b=2WZDMWeOXv4agBxaJSLtulB2aXFyXNeS3ZlU3lwcjWgAXKvtssJULUkbsN/6YrNxRT 18aFtUvGiX5V/Vmwzs+DL8uQUWYJ6nCYg4tXO4ozLPZ3saERJB2sScIjWFyVWBZnjTX3 v1X/2iB4bgABWm5ng194gr7/hu/IyhItLPF+RZX1eO54LHfMAOp5XB1sLRZBQa3SdGg5 fQxOfkn+KLMPwFi3Tu8wYUJS+LTqjMnzimwmCUGID5foP/ZZAKYdKpYLSxfqYNMBzIt3 ZMJtjHczd6eOCkilmGsBE8jfYkP3m3dYllpcjkUvzqqq6MRI9XYaTfxhD2g8sBA7qKBy 9nOQ== X-Gm-Message-State: AO0yUKX56/vN0zhgh8XnKbI8wYMYGI0ywuPaLXL9K/h1ZXembj75BbR7 5YpMvMpyhGrpLpZMpyv3g+8= X-Google-Smtp-Source: AK7set/HxLqJ3hgvKW4EwqsFFMs/krkFvaPFLF+PYrbomGz414fmZsQYSpmVcrUraRldk/TVms1q3g== X-Received: by 2002:a05:600c:4395:b0:3dd:daac:d99d with SMTP id e21-20020a05600c439500b003dddaacd99dmr1992920wmn.36.1677145107815; Thu, 23 Feb 2023 01:38:27 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id r189-20020a1c2bc6000000b003d9aa76dc6asm2874097wmr.0.2023.02.23.01.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:38:27 -0800 (PST) From: luca.boccassi@gmail.com To: Michael Baum Cc: Akhil Goyal , dpdk stable Subject: patch 'compressdev: fix end of driver list' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:36:26 +0000 Message-Id: <20230223093715.3926893-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.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 20.11.8 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/25/23. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/d734d76db5885a7c2399474ffb87b3077bd22158 Thanks. Luca Boccassi --- >From d734d76db5885a7c2399474ffb87b3077bd22158 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 1 Feb 2023 17:35:30 +0200 Subject: [PATCH] compressdev: fix end of driver list [ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ] The "rte_compressdev_info_get()" function retrieves the contextual information of a device. The output structure "dev_info" contains a list of devices supported capabilities for each supported algorithm. In this function description, it says the element after the last valid element has op field set to "RTE_COMP_ALGO_LIST_END". On the other hand, when this function used by "rte_compressdev_capability_get()" function, it uses "RTE_COMP_ALGO_UNSPECIFIED" as end of list as same as the "RTE_COMP_END_OF_CAPABILITIES_LIST()". The mlx5 and qat PMDs use "RTE_COMP_ALGO_LIST_END" as the end of capabilities list. When "rte_compressdev_capability_get()" function is called with unsupported algorithm, it might read memory out of bound. This patch change the "rte_compressdev_info_get()" function description to say using "RTE_COMP_ALGO_UNSPECIFIED" as the end of capabilities list. In addition, it moves both mlx5 and qat PMDs to use "RTE_COMP_ALGO_UNSPECIFIED" through "RTE_COMP_END_OF_CAPABILITIES_LIST()" macro. Fixes: 5d432f364078 ("compressdev: add device capabilities") Fixes: 2d148597ce76 ("compress/qat: add gen-specific implementation") Fixes: 384bac8d6555 ("compress/mlx5: add supported capabilities") Signed-off-by: Michael Baum Acked-by: Akhil Goyal --- drivers/compress/qat/qat_comp_pmd.c | 2 +- lib/librte_compressdev/rte_compressdev.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index 4b8594d76c..31d561a808 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -30,7 +30,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = { RTE_COMP_FF_OOP_LB_IN_SGL_OUT | RTE_COMP_FF_STATEFUL_DECOMPRESSION, .window_size = {.min = 15, .max = 15, .increment = 0} }, - {RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } }; + RTE_COMP_END_OF_CAPABILITIES_LIST() }; static void qat_comp_stats_get(struct rte_compressdev *dev, diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h index 2840c27c6c..d9b2fe40dc 100644 --- a/lib/librte_compressdev/rte_compressdev.h +++ b/lib/librte_compressdev/rte_compressdev.h @@ -353,7 +353,7 @@ rte_compressdev_stats_reset(uint8_t dev_id); * @note The capabilities field of dev_info is set to point to the first * element of an array of struct rte_compressdev_capabilities. * The element after the last valid element has it's op field set to - * RTE_COMP_ALGO_LIST_END. + * RTE_COMP_ALGO_UNSPECIFIED. */ __rte_experimental void -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:29.165615397 +0000 +++ 0022-compressdev-fix-end-of-driver-list.patch 2023-02-23 09:36:28.218169792 +0000 @@ -1 +1 @@ -From 33b84a2efca7ac188def108ba8b981daa7572b9a Mon Sep 17 00:00:00 2001 +From d734d76db5885a7c2399474ffb87b3077bd22158 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ] + @@ -32 +33,0 @@ -Cc: stable@dpdk.org @@ -37,26 +38,9 @@ - drivers/compress/mlx5/mlx5_compress.c | 4 +--- - drivers/compress/qat/dev/qat_comp_pmd_gen1.c | 2 +- - drivers/compress/qat/dev/qat_comp_pmd_gen4.c | 2 +- - lib/compressdev/rte_compressdev.h | 2 +- - 4 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c -index fb2bda9745..459e4b5e8a 100644 ---- a/drivers/compress/mlx5/mlx5_compress.c -+++ b/drivers/compress/mlx5/mlx5_compress.c -@@ -96,9 +96,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = { - RTE_COMP_FF_HUFFMAN_DYNAMIC, - .window_size = {.min = 10, .max = 15, .increment = 1}, - }, -- { -- .algo = RTE_COMP_ALGO_LIST_END, -- } -+ RTE_COMP_END_OF_CAPABILITIES_LIST() - }; - - static void -diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c -index 12d9d89072..3a8484eef1 100644 ---- a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c -+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c -@@ -26,7 +26,7 @@ const struct rte_compressdev_capabilities qat_gen1_comp_capabilities[] = { + drivers/compress/qat/qat_comp_pmd.c | 2 +- + lib/librte_compressdev/rte_compressdev.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c +index 4b8594d76c..31d561a808 100644 +--- a/drivers/compress/qat/qat_comp_pmd.c ++++ b/drivers/compress/qat/qat_comp_pmd.c +@@ -30,7 +30,7 @@ static const struct rte_compressdev_capabilities qat_comp_gen_capabilities[] = { @@ -69,19 +53,6 @@ - static int - qat_comp_dev_config_gen1(struct rte_compressdev *dev, -diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c -index 79b2ceb414..05906f13e0 100644 ---- a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c -+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c -@@ -25,7 +25,7 @@ qat_gen4_comp_capabilities[] = { - RTE_COMP_FF_OOP_SGL_IN_LB_OUT | - RTE_COMP_FF_OOP_LB_IN_SGL_OUT, - .window_size = {.min = 15, .max = 15, .increment = 0} }, -- {RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } }; -+ RTE_COMP_END_OF_CAPABILITIES_LIST() }; - - static int - qat_comp_dev_config_gen4(struct rte_compressdev *dev, -diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h -index 42bda9fc79..7eb5c58798 100644 ---- a/lib/compressdev/rte_compressdev.h -+++ b/lib/compressdev/rte_compressdev.h + static void + qat_comp_stats_get(struct rte_compressdev *dev, +diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h +index 2840c27c6c..d9b2fe40dc 100644 +--- a/lib/librte_compressdev/rte_compressdev.h ++++ b/lib/librte_compressdev/rte_compressdev.h