On Tue, Dec 16, 2025 at 07:57:54AM -0800, Haiyang Zhang wrote:
> From: Haiyang Zhang <[email protected]>
> 
> Our NIC can have up to 4 RX packets on 1 CQE. To support this feature,
> check and process the type CQE_RX_COALESCED_4. The default setting is
> disabled, to avoid possible regression on latency.
> 
> And add ethtool handler to switch this feature. To turn it on, run:
>   ethtool -C <nic> rx-frames 4
> To turn it off:
>   ethtool -C <nic> rx-frames 1
> 
> Signed-off-by: Haiyang Zhang <[email protected]>

...

> diff --git a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c 
> b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> index 0e2f4343ac67..1b9ed5c9bbff 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> @@ -397,6 +397,58 @@ static void mana_get_channels(struct net_device *ndev,
>       channel->combined_count = apc->num_queues;
>  }
>  
> +static int mana_get_coalesce(struct net_device *ndev,
> +                          struct ethtool_coalesce *ec,
> +                          struct kernel_ethtool_coalesce *kernel_coal,
> +                          struct netlink_ext_ack *extack)

...

> +     if (err) {
> +             netdev_err(ndev, "Set rx-frames to %u failed:%d\n",
> +                        ec->rx_max_coalesced_frames, err);
> +             NL_SET_ERR_MSG_FMT(extack, "Set rx-frames to %u failed:%d\n",
> +                                ec->rx_max_coalesced_frames, err);

nit: I don't think the trailing '\n' is necessary here.

     Flagged by coccinelle.

> +
> +             apc->cqe_coalescing_enable = saved_cqe_coalescing_enable;
> +     }
> +
> +     return err;
> +}

...

Reply via email to