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 87E19A0524 for ; Fri, 5 Feb 2021 12:20:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EDA74067B; Fri, 5 Feb 2021 12:20:56 +0100 (CET) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mails.dpdk.org (Postfix) with ESMTP id 210D94067B for ; Fri, 5 Feb 2021 12:20:55 +0100 (CET) Received: by mail-wr1-f51.google.com with SMTP id c4so7228318wru.9 for ; Fri, 05 Feb 2021 03:20:55 -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=wbgdhskYu+o6NhP8HJSN2HfJlYcgz0TdoOtG8AHM+/k=; b=Fmb+JFKoauSu+/J3VFCElgTm32ik0duKHKmdsVBvMuVWKZY+5UmNrY556ObYbqjUtu kavm9PeBJhvUAvW5g7iYce/EmcRrBButTmVmFaocPV3gT6GFoRVq1RZ8J1uSTyLzkgmw P0/xgONY3CAZ8AxkBmp4isZY9I818mmiTy4Rx27vtQCxcdqn6a3vfnxoIuRc6Mt+hWXA OKnWJbb5cwjWZc0AavqaZ0iEgDoj6/GvYtZirFtaVf4/yeXvhBTe2CN0LQ2G/RgHDO5G nVqDzZV2XDlkeSgGPXUH1p6bEM6p5mh3+XHFC6H6BhUL1zQWpBLsBg+W67a6jrR3Rzrc AT2g== 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=wbgdhskYu+o6NhP8HJSN2HfJlYcgz0TdoOtG8AHM+/k=; b=O0abw6yCqt4ljXtBE4YVGxnR85EwaeXfQyW3wx6u1lEijMr/u1Jxm2PwPv6ypugOFE d5VVA5CVcFRCvlObE/fpjCgueyuvdDZ3PyI8QC58AM24pWCwf/S7tIzIe/TV8QHyQcXA SYv9e8KTQIoJLEXlrnLMkCGzMNWIxIbRk8QPFA3ZycLK/nyXdREXHc7peP8DZCJbu7JV xeweOjWzRxN1G2hr9WjlKFmqhFz/7In1n0WAewY+3r9ZPABW2+eavKgHXmhXLctnH2y5 mAn4K7SAloniuWgo8QI6ETuTENYp4L3b/djjl2eHsPHDUCHS6qVhu1TN5MMIds75gLCo Mkdw== X-Gm-Message-State: AOAM531OE7NsKlKK3N51HSsjh/ksmpOwFWH8raGhJ2NmlFtDbHQDGmTc S9EEwTSU5Zdz6vtqftrUY2U= X-Google-Smtp-Source: ABdhPJwALWLJnpS3wqYzO9eP27qcf9JtGZ4NUeTzdm533Qag8wCXBXzwfwWLVpGUU/WnsxqefQL4cQ== X-Received: by 2002:a5d:68c6:: with SMTP id p6mr4516679wrw.332.1612524054877; Fri, 05 Feb 2021 03:20:54 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id h1sm11591032wrr.73.2021.02.05.03.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:20:54 -0800 (PST) From: luca.boccassi@gmail.com To: Ivan Malov Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Date: Fri, 5 Feb 2021 11:15:14 +0000 Message-Id: <20210205111920.1272063-28-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: support alternative MAE match fields' 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/101617a60789f23b9d1807281e0771a0cd5800e2 Thanks. Luca Boccassi --- >From 101617a60789f23b9d1807281e0771a0cd5800e2 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Tue, 1 Dec 2020 10:30:10 +0300 Subject: [PATCH] common/sfc_efx/base: support alternative MAE match fields [ upstream commit 429ed2f9ec7a0a0c48cbc90d7ab25185a36c1a85 ] If MAE slice is configured without conntrack support, outer rules must match on IP SRC/DST. This isn't reported clearly by the FW because IPv4 and IPv6 have separate SRC/DST pairs. The FW reports status ALWAYS for all these four fields, and having an all-zeros mask for either field prevents the spec from being certified by the existing spec validation method. Extend the spec validation to take the "alternative" fields into account so that legitimate specs don't get turned down. Fixes: ed15d7f8e064 ("common/sfc_efx/base: validate and compare outer match specs") Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx_mae.c | 52 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 2f5b167275..a54d5f6e6c 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -463,6 +463,10 @@ typedef enum efx_mae_field_endianness_e { * The information in it is meant to be used internally by * APIs for addressing a given field in a mask-value pairs * structure and for validation purposes. + * + * A field may have an alternative one. This structure + * has additional members to reference the alternative + * field's mask. See efx_mae_match_spec_is_valid(). */ typedef struct efx_mae_mv_desc_s { efx_mae_field_cap_id_t emmd_field_cap_id; @@ -472,6 +476,14 @@ typedef struct efx_mae_mv_desc_s { size_t emmd_mask_size; size_t emmd_mask_offset; + /* + * Having the alternative field's mask size set to 0 + * means that there's no alternative field specified. + */ + size_t emmd_alt_mask_size; + size_t emmd_alt_mask_offset; + + /* Primary field and the alternative one are of the same endianness. */ efx_mae_field_endianness_t emmd_endianness; } efx_mae_mv_desc_t; @@ -485,6 +497,7 @@ static const efx_mae_mv_desc_t __efx_mae_action_rule_mv_desc_set[] = { MAE_FIELD_MASK_VALUE_PAIRS_##_name##_OFST, \ MAE_FIELD_MASK_VALUE_PAIRS_##_name##_MASK_LEN, \ MAE_FIELD_MASK_VALUE_PAIRS_##_name##_MASK_OFST, \ + 0, 0 /* no alternative field */, \ _endianness \ } @@ -522,6 +535,21 @@ static const efx_mae_mv_desc_t __efx_mae_outer_rule_mv_desc_set[] = { MAE_ENC_FIELD_PAIRS_##_name##_OFST, \ MAE_ENC_FIELD_PAIRS_##_name##_MASK_LEN, \ MAE_ENC_FIELD_PAIRS_##_name##_MASK_OFST, \ + 0, 0 /* no alternative field */, \ + _endianness \ + } + +/* Same as EFX_MAE_MV_DESC(), but also indicates an alternative field. */ +#define EFX_MAE_MV_DESC_ALT(_name, _alt_name, _endianness) \ + [EFX_MAE_FIELD_##_name] = \ + { \ + EFX_MAE_FIELD_ID_##_name, \ + MAE_ENC_FIELD_PAIRS_##_name##_LEN, \ + MAE_ENC_FIELD_PAIRS_##_name##_OFST, \ + MAE_ENC_FIELD_PAIRS_##_name##_MASK_LEN, \ + MAE_ENC_FIELD_PAIRS_##_name##_MASK_OFST, \ + MAE_ENC_FIELD_PAIRS_##_alt_name##_MASK_LEN, \ + MAE_ENC_FIELD_PAIRS_##_alt_name##_MASK_OFST, \ _endianness \ } @@ -533,16 +561,17 @@ static const efx_mae_mv_desc_t __efx_mae_outer_rule_mv_desc_set[] = { EFX_MAE_MV_DESC(ENC_VLAN0_PROTO_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_VLAN1_TCI_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_VLAN1_PROTO_BE, EFX_MAE_FIELD_BE), - EFX_MAE_MV_DESC(ENC_SRC_IP4_BE, EFX_MAE_FIELD_BE), - EFX_MAE_MV_DESC(ENC_DST_IP4_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC_ALT(ENC_SRC_IP4_BE, ENC_SRC_IP6_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC_ALT(ENC_DST_IP4_BE, ENC_DST_IP6_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_IP_PROTO, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_IP_TOS, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_IP_TTL, EFX_MAE_FIELD_BE), - EFX_MAE_MV_DESC(ENC_SRC_IP6_BE, EFX_MAE_FIELD_BE), - EFX_MAE_MV_DESC(ENC_DST_IP6_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC_ALT(ENC_SRC_IP6_BE, ENC_SRC_IP4_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC_ALT(ENC_DST_IP6_BE, ENC_DST_IP4_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_L4_SPORT_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(ENC_L4_DPORT_BE, EFX_MAE_FIELD_BE), +#undef EFX_MAE_MV_DESC_ALT #undef EFX_MAE_MV_DESC }; @@ -848,7 +877,9 @@ efx_mae_match_spec_is_valid( ++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 *alt_m_buf = mvp + descp->emmd_alt_mask_offset; const uint8_t *m_buf = mvp + descp->emmd_mask_offset; + size_t alt_m_size = descp->emmd_alt_mask_size; size_t m_size = descp->emmd_mask_size; if (m_size == 0) @@ -870,6 +901,19 @@ efx_mae_match_spec_is_valid( break; case MAE_FIELD_SUPPORTED_MATCH_ALWAYS: is_valid = efx_mask_is_all_ones(m_size, m_buf); + + if ((is_valid == B_FALSE) && (alt_m_size != 0)) { + /* + * This field has an alternative one. The FW + * reports ALWAYS for both implying that one + * of them is required to have all-ones mask. + * + * The primary field's mask is incorrect; go + * on to check that of the alternative field. + */ + is_valid = efx_mask_is_all_ones(alt_m_size, + alt_m_buf); + } break; case MAE_FIELD_SUPPORTED_MATCH_NEVER: case MAE_FIELD_UNSUPPORTED: -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:30.559506970 +0000 +++ 0028-common-sfc_efx-base-support-alternative-MAE-match-fi.patch 2021-02-05 11:18:28.634687837 +0000 @@ -1 +1 @@ -From 429ed2f9ec7a0a0c48cbc90d7ab25185a36c1a85 Mon Sep 17 00:00:00 2001 +From 101617a60789f23b9d1807281e0771a0cd5800e2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 429ed2f9ec7a0a0c48cbc90d7ab25185a36c1a85 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org