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

2021-04-13 Thread Ong, Boon Leong
>+ /* 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, especi

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

2021-04-12 Thread David Miller
+ /* 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, especial

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

2021-04-12 Thread Ong Boon Leong
This patch adds the support for receiving packet via AF_XDP zero-copy mechanism. XDP ZC uses 1:1 mapping of XDP buffer to receive packet, therefore the use of split header is not used currently. The 'xdp_buff' is declared as union together with a struct that contains 'page', 'addr' and 'page_offse