Re: [PATCH net-next v5 8/9] net: ethernet: ti: am65-cpsw: add network flow classification support

From: Jakub Kicinski

Date: Tue Oct 28 2025 - 22:08:02 EST


On Fri, 24 Oct 2025 23:46:07 +0300 Roger Quadros wrote:

> +/* rxnfc_lock must be held */
> +static void am65_cpsw_del_rule(struct am65_cpsw_port *port,
> + struct am65_cpsw_rxnfc_rule *rule)
> +{
> + int loc;
> +
> + /* reverse location as higher locations have higher priority
> + * but ethtool expects lower locations to have higher priority
> + */
> + loc = port->rxnfc_max - rule->location - 1;
> +
> + cpsw_ale_policer_clr_entry(port->common->ale, loc,
> + &rule->cfg);
> + list_del(&rule->list);
> + port->rxnfc_count--;
> + port->policer_in_use_bitmask &= ~BIT(rule->location);

__clear_bit()
Please use bitmap helpers everywhere, especially for scanning
the bitmap to find unused bits

> + struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
> + struct am65_cpsw_port *port = am65_ndev_to_port(ndev);
> +
> + switch (rxnfc->cmd) {
> + case ETHTOOL_GRXRINGS:

please implement ::get_rx_ring_count instead
--
pw-bot: cr