On Fri, Jul 16, 2021 at 4:20 AM Ivan Malov <ivan.ma...@oktetlabs.ru> wrote: > > Extra log statements will provide more details to the user > in the case of errors discovered in the pattern or actions. > > Signed-off-by: Ivan Malov <ivan.ma...@oktetlabs.ru> > Reviewed-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> > Reviewed-by: Andy Moreton <amore...@xilinx.com> > --- > drivers/net/sfc/sfc_mae.c | 92 +++++++++++++++++++++++++++++++-------- > 1 file changed, 74 insertions(+), 18 deletions(-) > > diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c > index 61e795db9b..56b949ddf7 100644 > --- a/drivers/net/sfc/sfc_mae.c > +++ b/drivers/net/sfc/sfc_mae.c > @@ -752,6 +752,8 @@ sfc_mae_rule_process_pattern_data(struct > sfc_mae_parse_ctx *ctx, > > for (ethertype_idx = 0; > ethertype_idx < pdata->nb_vlan_tags; ++ethertype_idx) { > + rte_be16_t tpid_v = ethertypes[ethertype_idx].value; > + rte_be16_t tpid_m = ethertypes[ethertype_idx].mask; > unsigned int tpid_idx; > > /*
Probably missing this hunk for consistency: @@ -919,7 +919,7 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx, */ enforce_tag_presence[0] = B_FALSE; - if (ethertypes[ethertype_idx].mask == RTE_BE16(0)) { + if (tpid_m == RTE_BE16(0)) { if (pdata->tci_masks[ethertype_idx] == RTE_BE16(0)) enforce_tag_presence[ethertype_idx] = B_TRUE; > @@ -771,19 +773,22 @@ sfc_mae_rule_process_pattern_data(struct > sfc_mae_parse_ctx *ctx, > } > > /* Exact match is supported only. */ > - if (ethertypes[ethertype_idx].mask != RTE_BE16(0xffff)) { > + if (tpid_m != RTE_BE16(0xffff)) { > + sfc_info(ctx->sa, "TPID mask must be 0x0 or 0xffff; > got 0x%04x", > + rte_be_to_cpu_16(tpid_m)); Is there a reason for marking some logs as info only while others are err level? > rc = EINVAL; > goto fail; > } > -- David Marchand