[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c34af6e-9cd0-4a2a-b49a-823be099df55@tuxon.dev>
Date: Sat, 26 Jul 2025 15:29:23 +0300
From: "claudiu beznea (tuxon)" <claudiu.beznea@...on.dev>
To: Vineeth Karumanchi <vineeth.karumanchi@....com>,
nicolas.ferre@...rochip.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: git@....com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 5/6] net: macb: Implement TAPRIO TC offload
command interface
On 7/22/25 18:41, Vineeth Karumanchi wrote:
> Add Traffic Control offload infrastructure with command routing for
> TAPRIO qdisc operations:
>
> - macb_setup_taprio(): TAPRIO command dispatcher
> - macb_setup_tc(): TC_SETUP_QDISC_TAPRIO entry point
> - Support for REPLACE/DESTROY command mapping
>
> Provides standardized TC interface for time-gated scheduling control.
>
> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@....com>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 33 ++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 6b3eff28a842..cc33491930e3 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4267,6 +4267,38 @@ static void macb_taprio_destroy(struct net_device *ndev)
> spin_unlock_irqrestore(&bp->lock, flags);
> }
>
> +static int macb_setup_taprio(struct net_device *ndev,
> + struct tc_taprio_qopt_offload *taprio)
> +{
> + int err = 0;
> +
> + switch (taprio->cmd) {
> + case TAPRIO_CMD_REPLACE:
> + err = macb_taprio_setup_replace(ndev, taprio);
> + break;
> + case TAPRIO_CMD_DESTROY:
> + macb_taprio_destroy(ndev);
macb_taprio_setup_replace() along with macb_taprio_destroy() touch HW registers.
Could macb_setup_taprio() be called when the interface is runtime suspended?
> + break;
> + default:
> + err = -EOPNOTSUPP;
> + }
> +
> + return err;
> +}
> +
> +static int macb_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data)
> +{
> + if (!dev || !type_data)
> + return -EINVAL;
> +
> + switch (type) {
> + case TC_SETUP_QDISC_TAPRIO:
> + return macb_setup_taprio(dev, type_data);
Same here.
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
> +
> static const struct net_device_ops macb_netdev_ops = {
> .ndo_open = macb_open,
> .ndo_stop = macb_close,
> @@ -4284,6 +4316,7 @@ static const struct net_device_ops macb_netdev_ops = {
> .ndo_features_check = macb_features_check,
> .ndo_hwtstamp_set = macb_hwtstamp_set,
> .ndo_hwtstamp_get = macb_hwtstamp_get,
> + .ndo_setup_tc = macb_setup_tc,
This patch (or parts of it) should be merged with the previous ones. Otherwise
you introduce patches with code that is unused.
Thank you,
Claudiu
> };
>
> /* Configure peripheral capabilities according to device tree
Powered by blists - more mailing lists