diff options
author | Edward Cree <ecree.xilinx@gmail.com> | 2022-11-03 15:27:31 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-04 19:54:24 -0700 |
commit | 5d1d24da00dba75f94f1640717b3fd2a243e4b5f (patch) | |
tree | 1ce633fe7b1d3133c47eb6f73275f316700e2fc3 /drivers/net/ethernet/sfc/mae.c | |
parent | 5ca7ef293866f034c9a21a567a498dadfd1d57a8 (diff) |
sfc: add Layer 4 matches to ef100 TC offload
Support matching on UDP/TCP source and destination ports and TCP flags,
with masking if supported by the hardware.
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sfc/mae.c')
-rw-r--r-- | drivers/net/ethernet/sfc/mae.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c index e24436ba699c..1e605e2a08c5 100644 --- a/drivers/net/ethernet/sfc/mae.c +++ b/drivers/net/ethernet/sfc/mae.c @@ -311,6 +311,9 @@ int efx_mae_match_check_caps(struct efx_nic *efx, CHECK(SRC_IP6, src_ip6) || CHECK(DST_IP6, dst_ip6) || #endif + CHECK(L4_SPORT, l4_sport) || + CHECK(L4_DPORT, l4_dport) || + CHECK(TCP_FLAGS, tcp_flags) || CHECK_BIT(IS_IP_FRAG, ip_frag) || CHECK_BIT(IP_FIRST_FRAG, ip_firstfrag) || CHECK(RECIRC_ID, recirc_id)) @@ -559,6 +562,18 @@ static int efx_mae_populate_match_criteria(MCDI_DECLARE_STRUCT_PTR(match_crit), memcpy(MCDI_STRUCT_PTR(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_DST_IP6_BE_MASK), &match->mask.dst_ip6, sizeof(struct in6_addr)); #endif + MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_L4_SPORT_BE, + match->value.l4_sport); + MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_L4_SPORT_BE_MASK, + match->mask.l4_sport); + MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_L4_DPORT_BE, + match->value.l4_dport); + MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_L4_DPORT_BE_MASK, + match->mask.l4_dport); + MCDI_STRUCT_SET_WORD_BE(match_crit, MAE_FIELD_MASK_VALUE_PAIRS_V2_TCP_FLAGS_BE, + 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); return 0; } |