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 1CAC1A0524 for ; Fri, 5 Feb 2021 12:34:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13F31188A12; Fri, 5 Feb 2021 12:34:25 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 96AD7188A05 for ; Fri, 5 Feb 2021 12:34:23 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id g10so7347805wrx.1 for ; Fri, 05 Feb 2021 03:34:23 -0800 (PST) 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=lBLE0PcO9RR+x0e/mVpxj3x0+YjropsZxwik9ER0HT8=; b=HOrzEC2n244zB0bKBjUCR7Ubt4fXN8VSrlHvIvkj8XE4bHOW8owf20Lgmdb3juewle OPZ5IVtuO7MfNeZj+wD8JreZPdsWNDqeldJH3AEqfMN+tiqHxsUGTjwJt5nVP7NhQLDK PXvBSzbp3t0UyUzxjTE2rnl/HrYFzPDwzpZgnSA/cybFKOmOiIFeLSuAuDb8l2DX0qmP 7xaYLtQntvKgepuhRFeELts4KQHVYv8hq+Ft79DAl+u41M4MI3twnh9Cx2yKSJHDeDEp idK7A3Q7S5BWYhaFTwfhHZBumiiYBe9L8evsR5d6DFTjS9nVNrcMoUvrIuQcGTNWDE7l y+jw== 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=lBLE0PcO9RR+x0e/mVpxj3x0+YjropsZxwik9ER0HT8=; b=OgFj5a2LglBW5yUYl5aDttnrjhOqz0HDDAcn+juBZiY1kaueQUVxuYOvdG+igs1WoT XY6BgJY6puDfPIubUJNy+I1gzWMW1fKcMo9Z2bYMSi0+sLagkS91k9915Tt3HGzFpv4l bJ2Zipp9NUSf81CKQM6qfONLxsZ5s2nfeIF1m6XLphahIsVQu4VX0ifdQmAFh9Sbif8R hW7ije/VMg+BM0VOjFVq/INvphwpoGrAfmUfR69RYYoyWOnFjwC0W9gggpw8ZPs+sQQT KIARJfGFOGR91EAECBhO72zVBljk4c1X1UNQZoY2MLifsHbAbd1yVKRDLZ/K2Rq0bYzY ZJrA== X-Gm-Message-State: AOAM532aGPC+zhCG2iiHA57UQJEAmItX7vaJLxffzMsPlSC6HdCBW6Bb eTnKX179Krc856zIn8FHwDs= X-Google-Smtp-Source: ABdhPJz+YzELYCOEAQVP4+S7a+xt1D1R5DB/nx/ah+BmEfq72WXnRjCQ3vjQdmcX8BPSSeSuERsPQA== X-Received: by 2002:adf:e7d0:: with SMTP id e16mr4640227wrn.363.1612524863429; Fri, 05 Feb 2021 03:34:23 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b2sm9179279wmd.41.2021.02.05.03.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:34:22 -0800 (PST) From: luca.boccassi@gmail.com To: Ivan Malov Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Date: Fri, 5 Feb 2021 11:17:40 +0000 Message-Id: <20210205111920.1272063-174-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'common/sfc_efx/base: apply mask to value on match field set' has been queued to stable release 20.11.1 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.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/07/21. 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/f2a58ea165c68c17130a54e810622266b771fb82 Thanks. Luca Boccassi --- >From f2a58ea165c68c17130a54e810622266b771fb82 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Mon, 18 Jan 2021 01:21:11 +0300 Subject: [PATCH] common/sfc_efx/base: apply mask to value on match field set [ upstream commit f80487b9c79cc0cc3710c28e3115a348da022772 ] An application may submit all-zeros masks for a given field to be used in two given specifications and, in the meantime, use different unmasked values. Later on, when compared, the two specifications will prove unequal, and, if the rules in question are outer, the client driver will have to allocate a separate rule for the second specification. Provided that all other match criteria are the same, the HW will deem the two outer rules being duplicates, which is in fact the case. Apply masks to values in efx_mae_match_spec_field_set() API to fix the issue and avoid duplicate outer rule allocations. Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec") Reported-by: Andrew Rybchenko Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx_mae.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index cc5d8cfc4f..338a0013f9 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -707,12 +707,32 @@ efx_mae_match_spec_field_set( } if (descp->emmd_endianness == EFX_MAE_FIELD_BE) { + unsigned int i; + /* * The mask/value are in network (big endian) order. * The MCDI request field is also big endian. */ - memcpy(mvp + descp->emmd_value_offset, value, value_size); - memcpy(mvp + descp->emmd_mask_offset, mask, mask_size); + + EFSYS_ASSERT3U(value_size, ==, mask_size); + + for (i = 0; i < value_size; ++i) { + uint8_t *v_bytep = mvp + descp->emmd_value_offset + i; + uint8_t *m_bytep = mvp + descp->emmd_mask_offset + i; + + /* + * Apply the mask (which may be all-zeros) to the value. + * + * If this API is provided with some value to set for a + * given field in one specification and with some other + * value to set for this field in another specification, + * then, if the two masks are all-zeros, the field will + * avoid being counted as a mismatch when comparing the + * specifications using efx_mae_match_specs_equal() API. + */ + *v_bytep = value[i] & mask[i]; + *m_bytep = mask[i]; + } } else { efx_dword_t dword; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:37.032120708 +0000 +++ 0174-common-sfc_efx-base-apply-mask-to-value-on-match-fie.patch 2021-02-05 11:18:29.130697280 +0000 @@ -1 +1 @@ -From f80487b9c79cc0cc3710c28e3115a348da022772 Mon Sep 17 00:00:00 2001 +From f2a58ea165c68c17130a54e810622266b771fb82 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f80487b9c79cc0cc3710c28e3115a348da022772 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org