Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-06 Thread Mina Almasry
On Thu, Mar 6, 2025 at 1:40 PM Jakub Kicinski wrote: > > On Tue, 4 Mar 2025 17:39:37 -0800 Mina Almasry wrote: > > > > Yes, great idea. I don't see why it wouldn't work. > > > > > > > > We don't expect mixing of net_iovs and pages in the same skb, but > > > > netdevsim could create one net_iov skb

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-06 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Thu, 6 Mar 2025 14:44:41 -0800 Mina Almasry wrote: > > > Meaning it doesn't currently do anything special, or you can't make it > > > do anything special with netdevsim? > > > > Meaning it currently doesn't do anything special with netdevsim. I > > imagine we may be able

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-06 Thread Jakub Kicinski
On Thu, 6 Mar 2025 14:44:41 -0800 Mina Almasry wrote: > > Meaning it doesn't currently do anything special, or you can't make it > > do anything special with netdevsim? > > Meaning it currently doesn't do anything special with netdevsim. I > imagine we may be able to create a specialized syzbot ins

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-06 Thread Jakub Kicinski
On Tue, 4 Mar 2025 17:39:37 -0800 Mina Almasry wrote: > > > Yes, great idea. I don't see why it wouldn't work. > > > > > > We don't expect mixing of net_iovs and pages in the same skb, but > > > netdevsim could create one net_iov skb every N skbs. > > > > > > I guess I'm not totally sure something

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-04 Thread Mina Almasry
On Mon, Mar 3, 2025 at 4:20 PM Jakub Kicinski wrote: > > On Fri, 28 Feb 2025 17:29:13 -0800 Mina Almasry wrote: > > On Fri, Feb 28, 2025 at 4:38 PM Jakub Kicinski wrote: > > > On Thu, 27 Feb 2025 04:12:02 + Mina Almasry wrote: > > > > static inline void __skb_frag_ref(skb_frag_t *frag) > > >

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-03-03 Thread Jakub Kicinski
On Fri, 28 Feb 2025 17:29:13 -0800 Mina Almasry wrote: > On Fri, Feb 28, 2025 at 4:38 PM Jakub Kicinski wrote: > > On Thu, 27 Feb 2025 04:12:02 + Mina Almasry wrote: > > > static inline void __skb_frag_ref(skb_frag_t *frag) > > > { > > > - get_page(skb_frag_page(frag)); > > > + get

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-02-28 Thread Mina Almasry
On Fri, Feb 28, 2025 at 4:38 PM Jakub Kicinski wrote: > > On Thu, 27 Feb 2025 04:12:02 + Mina Almasry wrote: > > static inline void __skb_frag_ref(skb_frag_t *frag) > > { > > - get_page(skb_frag_page(frag)); > > + get_netmem(skb_frag_netmem(frag)); > > } > > Silently handling types

Re: [PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-02-28 Thread Jakub Kicinski
On Thu, 27 Feb 2025 04:12:02 + Mina Almasry wrote: > static inline void __skb_frag_ref(skb_frag_t *frag) > { > - get_page(skb_frag_page(frag)); > + get_netmem(skb_frag_netmem(frag)); > } Silently handling types of memory the caller may not be expecting always worries me. Why do we n

[PATCH net-next v6 1/8] net: add get_netmem/put_netmem support

2025-02-26 Thread Mina Almasry
Currently net_iovs support only pp ref counts, and do not support a page ref equivalent. This is fine for the RX path as net_iovs are used exclusively with the pp and only pp refcounting is needed there. The TX path however does not use pp ref counts, thus, support for get_page/put_page equivalent