Re: [PATCH net-next 07/11] net: devmem: support TX over NETMEM_TX_NO_DMA devices

Jakub Kicinski
2026-05-01T00:57:27Z

On Tue, 28 Apr 2026 15:42:04 -0700 Bobby Eshleman wrote:
> shinfo = skb_shinfo(skb);
> + if (shinfo->nr_frags == 0)
> + goto out;

Feels tempting to cover the NETMEM_TX_NO_DMA / NETMEM_TX_NONE
cases here before we even look at the frags?

> - if (shinfo->nr_frags > 0) {
> - niov = netmem_to_net_iov(skb_frag_netmem(&shinfo->frags[0]));
> - if (net_is_devmem_iov(niov) &&
> - READ_ONCE(net_devmem_iov_binding(niov)->dev) != dev)
> + niov = netmem_to_net_iov(skb_frag_netmem(&shinfo->frags[0]));
> + if (!net_is_devmem_iov(niov))
> + goto out;
> +
> + binding = net_devmem_iov_binding(niov);
> +
> + switch (dev->netmem_tx) {
> + case NETMEM_TX_DMA:
> + if (READ_ONCE(binding->dev) != dev)
> goto out_free;
> + break;
> + case NETMEM_TX_NO_DMA:
> + break;
> + default: /* NETMEM_TX_NONE */
> + goto out_free;
> }