[PATCH net-next 6/7] net: stmmac: Enable RX via AF_XDP zero-copy

Ong, Boon Leong boon.leong.ong at intel.com
Tue Apr 13 08:58:14 BST 2021


>+	/* synchronize_rcu() needed for pending XDP buffers to drain */
>+	for (queue = 0; queue < rx_queues_cnt; queue++) {
>+		rx_q = &priv->rx_queue[queue];
>+		if (rx_q->xsk_pool) {
>+			synchronize_rcu();
>
>Are you sure this is safe here, especially via the ->ndo_setup_tc() code path?
>
Thanks for the feedback.
Will fix this in v2 by introducing below:

Introduce __stmmac_disable_all_queues() to contain the original code that
does napi_disable() and then make stmmac_setup_tc_block_cb(0 to call this.

Add stmmac_disable_all_queues() to perform synchronize_rcu() if
there is preregistered XSK pool before subsequently call 
__stmmac_disable_all_queues() to perform napi_disable(). 

After this, both stmmac_release() and stmmac_suspend() will use
stmmac_disable_all_queues().

Thx



More information about the linux-arm-kernel mailing list