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 98DFDA0524 for ; Fri, 5 Feb 2021 12:32:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92D8740682; Fri, 5 Feb 2021 12:32:42 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id B17A140682 for ; Fri, 5 Feb 2021 12:32:41 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id c12so7292129wrc.7 for ; Fri, 05 Feb 2021 03:32:41 -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=tBhRIf+aPIKMqzyqO4cFPpuk41omJ4A9tN6odBd/hT4=; b=gBZ37NzT0OZALPnYLIGY1dUpNDio/tcgoMfVeYT1nds47Y2xp0papQj1uRyhM20QlS kqOdMOZn6s5jZ6r678a9vyeJ6G0hto6tbPLWYTudOtaXpr7mGPjGRmMANhDGWLZrrN0w NRcFnAu099xiinn2PT5nFBpIAh8US8Av7m0Xtm+OU63CaCN0NHsMnCYALOF0i33cfO2G b6WQAEbDxXHWRd/vrnUVRk/nu4jrToxWiZiqHdckXSBGviF0f2KLlPPkoAiUqEotTPJ1 u8j46PYeJpvI+FEY0PT/gxgDDrs2pQli5gqnoFRB7oLZa7ZKtS7k+Jg4wZ/lx32lzWfd Idtw== 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=tBhRIf+aPIKMqzyqO4cFPpuk41omJ4A9tN6odBd/hT4=; b=dg/tiP21GDNJO+k5ws41A8yTs0bf3o2toHyGGQHrOYdoAIjhdGlsGKw3u3z4FVw2xI yoCLkyfS+LPItcXb0rx6BP8aAEf9IiEOPyfU7jouWZaPtIhid8iQgrDUL/Tz/D+QBoa5 Ujvju1Ul2Qo65i4jZ5G30LBXwmLNRpo1ZkYr0/2yA8e+LxheyQC9fcFApGVT3DHP99Xf oehiCwywl1X2u3AcjLBJBAumMdJtpa705bNGg1qPmmngrQ8CyIWbltZAsP6eJ6uYgCOy 8xP0nca7QB4NZsDZnOE5D9wnVJ/f1MY1n70PolIuaGTIS4oKJbCRoAly63DEp7WHznQL kLXQ== X-Gm-Message-State: AOAM532ZSs30c0OdEh2wGw2YG/Y8IkZDKWGPHV2clWWv07qme6r+5n2n DnaCoI+jQQpT7e/sQFDbs1Y= X-Google-Smtp-Source: ABdhPJyM/2I3WiONJ2Aull66fobEQJ/zC6aC4cg1jlo9hKOl0ycAPTTzC91d+zOWoUtdkXaC5Kvysg== X-Received: by 2002:a5d:4528:: with SMTP id j8mr4631052wra.352.1612524761463; Fri, 05 Feb 2021 03:32:41 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j14sm13700494wrd.36.2021.02.05.03.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:32:40 -0800 (PST) From: luca.boccassi@gmail.com To: Ivan Malov Cc: Andy Moreton , Andrew Rybchenko , dpdk stable Date: Fri, 5 Feb 2021 11:17:07 +0000 Message-Id: <20210205111920.1272063-141-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: fix MAE match spec class comparison API' 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/ccae4e808af42dffdfb7064bb1cd984eda4d22d6 Thanks. Luca Boccassi --- >From ccae4e808af42dffdfb7064bb1cd984eda4d22d6 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Wed, 6 Jan 2021 13:06:00 +0300 Subject: [PATCH] common/sfc_efx/base: fix MAE match spec class comparison API [ upstream commit 76631541aa2de49562e262af085f9e4afdeb1baf ] The helper exits once it encounters a field which hasn't its capability status reported by the FW. Handle the corner case when the two mask-value pairs match for the field, which, in the absence of capability information, is sufficient to deem the class unaffected by the field. Explain this in a comment. Fixes: bb71f7e0a35a ("common/sfc_efx/base: add match specs class comparison API") Reviewed-by: Andy Moreton Reviewed-by: Andrew Rybchenko Signed-off-by: Ivan Malov --- drivers/common/sfc_efx/base/efx.h | 5 +++++ drivers/common/sfc_efx/base/efx_mae.c | 32 ++++++++++++++++++--------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 3b40e28b4e..ccf9c7ab8a 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4283,6 +4283,11 @@ efx_mae_action_set_specs_equal( * Conduct a comparison to check whether two match specifications * of equal rule type (action / outer) and priority would map to * the very same rule class from the firmware's standpoint. + * + * For match specification fields that are not supported by firmware, + * the rule class only matches if the mask/value pairs for that field + * are equal. Clients should use efx_mae_match_spec_is_valid() before + * calling this API to detect usage of unsupported fields. */ LIBEFX_API extern __checkReturn efx_rc_t diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 7fd42218f6..eb91753ec5 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -1426,18 +1426,32 @@ efx_mae_match_specs_class_cmp( ++field_id) { const efx_mae_mv_desc_t *descp = &desc_setp[field_id]; efx_mae_field_cap_id_t field_cap_id = descp->emmd_field_cap_id; + const uint8_t *lmaskp = mvpl + descp->emmd_mask_offset; + const uint8_t *rmaskp = mvpr + descp->emmd_mask_offset; + size_t mask_size = descp->emmd_mask_size; + const uint8_t *lvalp = mvpl + descp->emmd_value_offset; + const uint8_t *rvalp = mvpr + descp->emmd_value_offset; + size_t value_size = descp->emmd_value_size; - if (descp->emmd_mask_size == 0) + if (mask_size == 0) continue; /* Skip array gap */ - if ((unsigned int)field_cap_id >= field_ncaps) - break; + if ((unsigned int)field_cap_id >= field_ncaps) { + /* + * The FW has not reported capability status for this + * field. It's unknown whether any difference between + * the two masks / values affects the class. The only + * case when the class must be the same is when these + * mask-value pairs match. Otherwise, report mismatch. + */ + if ((memcmp(lmaskp, rmaskp, mask_size) == 0) && + (memcmp(lvalp, rvalp, value_size) == 0)) + continue; + else + break; + } if (field_caps[field_cap_id].emfc_mask_affects_class) { - const uint8_t *lmaskp = mvpl + descp->emmd_mask_offset; - const uint8_t *rmaskp = mvpr + descp->emmd_mask_offset; - size_t mask_size = descp->emmd_mask_size; - if (memcmp(lmaskp, rmaskp, mask_size) != 0) { have_same_class = B_FALSE; break; @@ -1445,10 +1459,6 @@ efx_mae_match_specs_class_cmp( } if (field_caps[field_cap_id].emfc_match_affects_class) { - const uint8_t *lvalp = mvpl + descp->emmd_value_offset; - const uint8_t *rvalp = mvpr + descp->emmd_value_offset; - size_t value_size = descp->emmd_value_size; - if (memcmp(lvalp, rvalp, value_size) != 0) { have_same_class = B_FALSE; break; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:35.458044857 +0000 +++ 0141-common-sfc_efx-base-fix-MAE-match-spec-class-compari.patch 2021-02-05 11:18:29.026695300 +0000 @@ -1 +1 @@ -From 76631541aa2de49562e262af085f9e4afdeb1baf Mon Sep 17 00:00:00 2001 +From ccae4e808af42dffdfb7064bb1cd984eda4d22d6 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 76631541aa2de49562e262af085f9e4afdeb1baf ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org