Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-21 Thread Jakub Kicinski
On Wed, 21 Aug 2024 11:36:31 -0400 Mina Almasry wrote: > Additionally I'm wondering if we should disable adding mp-bound > devices as slaves completely, regardless of xdp. My concern is that if > the lower device is using unreadable memory, then the upper device may > see unreadable memory in its c

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-21 Thread Taehee Yoo
On Thu, Aug 22, 2024 at 12:36 AM Mina Almasry wrote: > > On Wed, Aug 21, 2024 at 5:15 AM Taehee Yoo wrote: > > > > On Tue, Aug 20, 2024 at 1:01 PM Mina Almasry wrote: > > > > > > On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > > > > > > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-21 Thread Mina Almasry
On Wed, Aug 21, 2024 at 5:15 AM Taehee Yoo wrote: > > On Tue, Aug 20, 2024 at 1:01 PM Mina Almasry wrote: > > > > On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > > > > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > > > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(stru

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-21 Thread Taehee Yoo
On Tue, Aug 20, 2024 at 1:01 PM Mina Almasry wrote: > > On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device > > > > *dev, struct netlink_ext_ack *extack > > >

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-20 Thread Jakub Kicinski
On Tue, 20 Aug 2024 13:11:20 -0400 Mina Almasry wrote: > > Protecting the stack from unreadable memory is *the* challenge > > in this series. The rest is a fairly straightforward. > > Understandable. I pulled the trigger on v21 with the build fix last > night after reading your response on the o

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-20 Thread Mina Almasry
On Tue, Aug 20, 2024 at 11:19 AM Jakub Kicinski wrote: > > On Tue, 20 Aug 2024 00:01:02 -0400 Mina Almasry wrote: > > Took a bit of a look here. Forgive me, I'm not that familiar with XDP > > and virtual interfaces, so I'm a bit unsure what to do here. > > > > For veth, it seems, the device behind

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-20 Thread Jakub Kicinski
On Tue, 20 Aug 2024 00:01:02 -0400 Mina Almasry wrote: > Took a bit of a look here. Forgive me, I'm not that familiar with XDP > and virtual interfaces, so I'm a bit unsure what to do here. > > For veth, it seems, the device behind the veth is stored in > veth_priv->peer, so it seems maybe a dev_g

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 Thread Mina Almasry
On Mon, Aug 19, 2024 at 6:53 PM Jakub Kicinski wrote: > > On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device *dev, > > > struct netlink_ext_ack *extack > > > NL_SET_ERR_MSG(extack, "Native and gener

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-19 Thread Jakub Kicinski
On Mon, 19 Aug 2024 00:44:27 +0900 Taehee Yoo wrote: > > @@ -9537,6 +9540,10 @@ static int dev_xdp_attach(struct net_device *dev, > > struct netlink_ext_ack *extack > > NL_SET_ERR_MSG(extack, "Native and generic XDP > > can't be active at the same time"); > >

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-18 Thread Taehee Yoo
On Wed, Aug 14, 2024 at 6:13 AM Mina Almasry wrote: > > Add a netdev_dmabuf_binding struct which represents the > dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to > rx queues on the netdevice. On the binding, the dma_buf_attach > & dma_buf_map_attachment will occur. The entri

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-16 Thread Mina Almasry
On Thu, Aug 15, 2024 at 8:48 PM Jakub Kicinski wrote: > > On Tue, 13 Aug 2024 21:13:05 + Mina Almasry wrote: > > +int dev_get_max_mp_channel(const struct net_device *dev) > > +{ > > + int i, max = -1; > > I presume the bug from yesterday is self evident once reported? :) > Yes, my apologi

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-15 Thread Jakub Kicinski
On Tue, 13 Aug 2024 21:13:05 + Mina Almasry wrote: > + if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, > + NETDEV_A_QUEUE_ID)) { > + err = -EINVAL; > + goto err_unlock; > + } > + > + if (

Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-15 Thread Jakub Kicinski
On Tue, 13 Aug 2024 21:13:05 + Mina Almasry wrote: > +int dev_get_max_mp_channel(const struct net_device *dev) > +{ > + int i, max = -1; I presume the bug from yesterday is self evident once reported? :) > + ASSERT_RTNL(); > + > + for (i = 0; i < dev->real_num_rx_queues; i++) > +

[PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice

2024-08-13 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a genpool