netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "claudiu beznea (tuxon)" <claudiu.beznea@tuxon.dev>
To: Vineeth Karumanchi <vineeth.karumanchi@amd.com>,
	nicolas.ferre@microchip.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: git@amd.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 5/6] net: macb: Implement TAPRIO TC offload command interface
Date: Sat, 26 Jul 2025 15:29:23 +0300	[thread overview]
Message-ID: <8c34af6e-9cd0-4a2a-b49a-823be099df55@tuxon.dev> (raw)
In-Reply-To: <20250722154111.1871292-6-vineeth.karumanchi@amd.com>



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@amd.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


  reply	other threads:[~2025-07-26 12:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22 15:41 [PATCH net-next 0/6] net: macb: Add TAPRIO traffic scheduling support Vineeth Karumanchi
2025-07-22 15:41 ` [PATCH net-next 1/6] net: macb: Define ENST hardware registers for time-aware scheduling Vineeth Karumanchi
2025-07-26 12:23   ` claudiu beznea (tuxon)
2025-07-22 15:41 ` [PATCH net-next 2/6] net: macb: Integrate ENST timing parameters and hardware unit conversion Vineeth Karumanchi
2025-07-26 12:24   ` claudiu beznea (tuxon)
2025-07-22 15:41 ` [PATCH net-next 3/6] net: macb: Add IEEE 802.1Qbv TAPRIO REPLACE command offload support Vineeth Karumanchi
2025-07-23 10:02   ` kernel test robot
2025-07-26 12:25   ` claudiu beznea (tuxon)
2025-07-26 15:32     ` Andrew Lunn
2025-07-29  8:59     ` Karumanchi, Vineeth
2025-07-31  9:07       ` Claudiu Beznea
2025-07-22 15:41 ` [PATCH net-next 4/6] net: macb: Implement TAPRIO DESTROY command offload for gate cleanup Vineeth Karumanchi
2025-07-26 12:26   ` claudiu beznea (tuxon)
2025-07-22 15:41 ` [PATCH net-next 5/6] net: macb: Implement TAPRIO TC offload command interface Vineeth Karumanchi
2025-07-26 12:29   ` claudiu beznea (tuxon) [this message]
2025-07-29  9:38     ` Karumanchi, Vineeth
2025-07-31  9:07       ` Claudiu Beznea
2025-07-28 16:31   ` kernel test robot
2025-07-22 15:41 ` [PATCH net-next 6/6] net: macb: Add MACB_CAPS_QBV capability flag for IEEE 802.1Qbv support Vineeth Karumanchi
2025-07-23 19:05   ` Simon Horman
2025-07-29  9:42     ` Karumanchi, Vineeth
2025-07-24  0:46   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c34af6e-9cd0-4a2a-b49a-823be099df55@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=git@amd.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=vineeth.karumanchi@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).