Re: [PATCH net-next v5 07/11] net: ti: prueth: Adds support for network filters for traffic control supported by PRU-ICSS

Simon Horman
2025-04-15T19:58:05Z

On Mon, Apr 14, 2025 at 06:32:33PM +0530, Parvathi Pudi wrote:
> From: Roger Quadros <rogerq@ti.com>
>
> Driver updates to enable/disable network filters and traffic control
> features supported by the firmware running on PRU-ICSS.
>
> Control of the following features are now supported:
> 1. Promiscuous mode
> 2. Network Storm prevention
> 3. Multicast filtering and
> 4. VLAN filtering
>
> Firmware running on PRU-ICSS will go through all these filter checks
> prior to sending the rx packets to the host.
>
> Ethtool or dev ioctl can be used to enable/disable these features from
> the user space.
>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
> Signed-off-by: Parvathi Pudi <parvathi@couthit.com>

...

> diff --git a/drivers/net/ethernet/ti/icssm/icssm_prueth_dos.c b/drivers/net/ethernet/ti/icssm/icssm_prueth_dos.c

...

> +static int icssm_emac_configure_clsflower(struct prueth_emac *emac,
> + struct flow_cls_offload *cls)
> +{
> + struct flow_rule *rule = flow_cls_offload_flow_rule(cls);
> + struct netlink_ext_ack *extack = cls->common.extack;
> + const struct flow_action_entry *act;
> + int i;
> +
> + flow_action_for_each(i, act, &rule->action) {
> + switch (act->id) {
> + case FLOW_ACTION_POLICE:
> + return icssm_emac_flower_parse_policer
> + (emac, extack, cls,
> + act->police.rate_bytes_ps);
> + default:
> + NL_SET_ERR_MSG_MOD(extack,
> + "Action not supported");
> + return -EOPNOTSUPP;
> + }
> + }
> + return -EOPNOTSUPP;

nit: This line cannot be reached.
I think you can just remove it.

Flagged by Smatch.

> +}

...