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

2024-08-30 Thread Jakub Kicinski
On Thu, 29 Aug 2024 22:41:17 -0700 Mina Almasry wrote: > Thank you, I think the right fix here is to reacquire rtnl_lock before > the `goto err_unbind;`, since err_unbind expects rtnl to be locked at > this point. FWIW it's best to keep the error path a mirror image of the success path, so I'd add

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

2024-08-29 Thread Mina Almasry
On Thu, Aug 29, 2024 at 2:24 PM Vadim Fedorenko wrote: > > On 29/08/2024 22:08, Jakub Kicinski wrote: > > On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: > >> +err = genlmsg_reply(rsp, info); > >> +if (err) > >> +goto err_unbind; > >> + > >> return 0; > >> + > >> +e

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

2024-08-29 Thread Vadim Fedorenko
On 29/08/2024 22:08, Jakub Kicinski wrote: On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: + err = genlmsg_reply(rsp, info); + if (err) + goto err_unbind; + return 0; + +err_unbind: rtnl_lock() There are 2 places with goto err_unbind, and one is under

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

2024-08-29 Thread Jakub Kicinski
On Thu, 29 Aug 2024 12:38:13 -0700 Mina Almasry wrote: > BTW I submitted 2 iterations already this week, Sunday and Wednesday. > This is easily fixable and I can resend before the end of the week, > but if I'm stressing NIPA too much with reposts of this large series I > can wait until next week. S

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

2024-08-29 Thread Jakub Kicinski
On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: > @@ -9376,6 +9376,9 @@ int dev_xdp_propagate(struct net_device *dev, struct > netdev_bpf *bpf) > if (!dev->netdev_ops->ndo_bpf) > return -EOPNOTSUPP; > > + if (dev_get_min_mp_channel_count(dev)) there's an extack in

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

2024-08-29 Thread Jakub Kicinski
On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: > + if (NL_REQ_ATTR_CHECK(info->extack, attr, tb, > NETDEV_A_QUEUE_ID) || > + NL_REQ_ATTR_CHECK(info->extack, attr, tb, > NETDEV_A_QUEUE_TYPE) || > + nla_get_u32(tb[NETDEV_A_QUEUE_TYPE]) != > NETDE

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

2024-08-29 Thread Jakub Kicinski
On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: > + if (dev_xdp_prog_count(netdev)) { > + NL_SET_ERR_MSG(info->extack, "netdevice has xdp program > attached"); > + return -EEXIST; > + } goto err_unlock

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

2024-08-29 Thread Jakub Kicinski
On Thu, 29 Aug 2024 06:01:16 + Mina Almasry wrote: > + err = genlmsg_reply(rsp, info); > + if (err) > + goto err_unbind; > + > return 0; > + > +err_unbind: rtnl_lock() > + net_devmem_unbind_dmabuf(binding); > +err_unlock: > + rtnl_unlock();

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

2024-08-29 Thread Simon Horman
On Thu, Aug 29, 2024 at 06:01:16AM +, Mina Almasry wrote: ... > diff --git a/net/core/netdev-genl-gen.c b/net/core/netdev-genl-gen.c > index 6b7fe6035067..8b87801e8d1c 100644 > --- a/net/core/netdev-genl-gen.c > +++ b/net/core/netdev-genl-gen.c > @@ -8,6 +8,7 @@ > > #include "netdev-genl-g

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

2024-08-29 Thread Mina Almasry
> +#include > #include > ... > > +#include > #include > Darn, I went too overboard with sorting of includes. ynl-regen.sh wants these in the reverse order, which is unsorted. I'll fix it in the next iteration, and I added this check as well to my presubmits. BTW I submitted 2 iterations al

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

2024-08-28 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