[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZB7jApAGT9q3ntjL@corigine.com>
Date: Sat, 25 Mar 2023 13:03:14 +0100
From: Simon Horman <simon.horman@...igine.com>
To: edward.cree@....com
Cc: linux-net-drivers@....com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com,
Edward Cree <ecree.xilinx@...il.com>, netdev@...r.kernel.org,
habetsm.xilinx@...il.com, michal.swiatkowski@...ux.intel.com
Subject: Re: [PATCH net-next v2 2/6] sfc: add notion of match on enc keys to
MAE machinery
Hi Edward,
Looks good to me.
A few minor comments inline.
On Thu, Mar 23, 2023 at 08:45:10PM +0000, edward.cree@....com wrote:
> From: Edward Cree <ecree.xilinx@...il.com>
>
> Extend the MAE caps check to validate that the hardware supports used
> outer-header matches.
s/used// ?
> Extend efx_mae_populate_match_criteria() to fill in the outer rule ID
> and VNI match fields.
> Nothing yet populates these match fields, nor creates outer rules.
>
> Signed-off-by: Edward Cree <ecree.xilinx@...il.com>
...
> int efx_mae_allocate_counter(struct efx_nic *efx, struct efx_tc_counter *cnt)
> {
> MCDI_DECLARE_BUF(outbuf, MC_CMD_MAE_COUNTER_ALLOC_OUT_LEN(1));
> @@ -941,6 +1011,29 @@ static int efx_mae_populate_match_criteria(MCDI_DECLARE_STRUCT_PTR(match_crit),
> match->value.tcp_flags);
> MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_TCP_FLAGS_BE_MASK,
> match->mask.tcp_flags);
> + /* enc-keys are handled indirectly, through encap_match ID */
> + if (match->encap) {
> + MCDI_STRUCT_SET_DWORD(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_OUTER_RULE_ID,
> + match->encap->fw_id);
> + MCDI_STRUCT_SET_DWORD(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_OUTER_RULE_ID_MASK,
> + U32_MAX);
> + /* enc_keyid (VNI/VSID) is not part of the encap_match */
> + MCDI_STRUCT_SET_DWORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_ENC_VNET_ID_BE,
> + match->value.enc_keyid);
> + MCDI_STRUCT_SET_DWORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_ENC_VNET_ID_BE_MASK,
> + match->mask.enc_keyid);
Is it intentional that value.enc_keyid is used as the mask.
Perhaps naively I would have expected something more like U32_MAX.
> + } else if (WARN_ON_ONCE(match->mask.enc_src_ip) ||
> + WARN_ON_ONCE(match->mask.enc_dst_ip) ||
> + WARN_ON_ONCE(!ipv6_addr_any(&match->mask.enc_src_ip6)) ||
> + WARN_ON_ONCE(!ipv6_addr_any(&match->mask.enc_dst_ip6)) ||
> + WARN_ON_ONCE(match->mask.enc_ip_tos) ||
> + WARN_ON_ONCE(match->mask.enc_ip_ttl) ||
> + WARN_ON_ONCE(match->mask.enc_sport) ||
> + WARN_ON_ONCE(match->mask.enc_dport) ||
> + WARN_ON_ONCE(match->mask.enc_keyid)) {
> + /* No enc-keys should appear in a rule without an encap_match */
> + return -EOPNOTSUPP;
> + }
> return 0;
> }
Powered by blists - more mailing lists