lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f16ace1-f1e7-41b0-bc7d-f358cd043271@tuxon.dev>
Date: Sat, 26 Jul 2025 15:26:28 +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 4/6] net: macb: Implement TAPRIO DESTROY command
 offload for gate cleanup



On 7/22/25 18:41, Vineeth Karumanchi wrote:
> Add hardware offload support for "tc qdisc destroy" operations to safely
> remove IEEE 802.1Qbv time-gated scheduling configuration and restore
> default queue behavior.
> 
> Cleanup sequence:
> - Reset network device TC configuration state
> - Disable Enhanced Network Scheduling and Timing for all queues
> - Clear all ENST timing control registers (START_TIME, ON_TIME, OFF_TIME)
> - Atomic register programming with proper synchronization
> 
> This ensures complete removal of time-aware scheduling state, returning
> the controller to standard FIFO queue operation without residual timing
> constraints
> 
> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@....com>
> ---
>   drivers/net/ethernet/cadence/macb_main.c | 28 ++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 4518b59168d5..6b3eff28a842 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4239,6 +4239,34 @@ static int macb_taprio_setup_replace(struct net_device *ndev,
>   	return err;
>   }
>   
> +static void macb_taprio_destroy(struct net_device *ndev)

This function is unused in this patch. Nothing mentions it.

> +{
> +	struct macb *bp = netdev_priv(ndev);
> +	struct macb_queue *queue;
> +	unsigned long flags;
> +	u32 enst_disable_mask;
> +	u8 i;

unsigned int

> +
> +	netdev_reset_tc(ndev);
> +	enst_disable_mask = GENMASK(bp->num_queues - 1, 0) << GEM_ENST_DISABLE_QUEUE_OFFSET;

You can use GEM_BF(GENMASK(...), ENST_DISABLE_QUEUE) if you 
GEM_ENST_DISABLE_QUEUE_SIZE is defined

> +	netdev_dbg(ndev, "TAPRIO destroy: disabling all gates\n");
> +
> +	spin_lock_irqsave(&bp->lock, flags);

guard()

> +
> +	/* Single disable command for all queues */
> +	gem_writel(bp, ENST_CONTROL, enst_disable_mask);
> +
> +	/* Clear all queue ENST registers in batch */
> +	for (i = 0; i < bp->num_queues; i++) {

You can follow the pattern across macb_main.c and replace it with:

         for (unsigned int q = 0, queue = &bp->queues[q]; q < bp->num_queues; 
++q, ++queue)

> +		queue = &bp->queues[i];

And drop this line

Thank you,
Claudiu

> +		queue_writel(queue, ENST_START_TIME, 0);
> +		queue_writel(queue, ENST_ON_TIME, 0);
> +		queue_writel(queue, ENST_OFF_TIME, 0);
> +	}
> +
> +	spin_unlock_irqrestore(&bp->lock, flags);
> +}
> +
>   static const struct net_device_ops macb_netdev_ops = {
>   	.ndo_open		= macb_open,
>   	.ndo_stop		= macb_close,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ