Subject: Re: [PATCH net-next 7/7] sfc: offload left-hand side rules for conntrack

From: Simon Horman <[email-masked]>
Date: Fri, 4 Aug 2023 15:43:15 +0200

On Thu, Aug 03, 2023 at 12:56:23PM +0100, [email-masked] wrote:

...

> +static bool efx_tc_rule_is_lhs_rule(struct flow_rule *fr,
> +				    struct efx_tc_match *match)
> +{
> +	const struct flow_action_entry *fa;
> +	int i;
> +
> +	flow_action_for_each(i, fa, &fr->action) {
> +		switch (fa->id) {
> +		case FLOW_ACTION_GOTO:
> +			return true;
> +		case FLOW_ACTION_CT:
> +			/* If rule is -trk, or doesn't mention trk at all, then
> +			 * a CT action implies a conntrack lookup (hence it's an
> +			 * LHS rule).  If rule is +trk, then a CT action could
> +			 * just be ct(nat) or even ct(commit) (though the latter
> +			 * can't be offloaded).
> +			 */
> +			if (!match->mask.ct_state_trk || !match->value.ct_state_trk)
> +				return true;

Hi Ed,

I think that to keep static analysers happy there ought to be a
break statement, or a fallthrough annotation here.

Otherwise the series looks good to me.

> +		default:
> +			break;
> +		}
> +	}
> +	return false;
> +}

...