From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0243EA23 for ; Sat, 9 Mar 2024 00:27:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709944076; cv=none; b=aoxAtppe9CH/AxTXTdT5a7E2lY990ec7EpQRP8/2he0fSl9HacOcUoDCG/CoXOwTxPMNmxSN6n7VNoMMazrb60EDUbJQ1IYq94jVtj7uuF4TyoYc19FMzrGSAFnG8pIWUM9k7s/tkwomYY5C/l8Kh+fYtLhxI3yTHHzDRmX4/s8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709944076; c=relaxed/simple; bh=UAHNOoQOfnXGU4ynjW3Di4sMLSMOx0hwkdhyKrO246c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aaon3wtj8LRNlpS3o3auCpLd4KfbN4pXu6ncIaQmUqV5AclMfP7qfE4TYBcVyOGDxExTnnIDM5giVgtgH6+w9qsFB3bGf9mepqgiwYFb0UrBJgrMkoCqQsYaWpWOkSSouwcelLyEJTJkl7d2G112nNsdGWpKjpzfN+Z7ubCQxmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cKLX+2Aa; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cKLX+2Aa" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-56647babfe6so2120855a12.3 for ; Fri, 08 Mar 2024 16:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709944071; x=1710548871; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EWYfh9XoJurOTi8J7CJKHaNZmYFNooi7e3RylW8C//Y=; b=cKLX+2AaXAKsbJm0yJSoV5EfK47mkTHgBxnjzLm3Qi+mbVTJ0/35N0WYiav0SapGJM cDyGrmHJrruoMoMLbe1jOUloQx5t4MAi4aNwOQY0tF21GKFBaIbyB/l1TEL/VySh/Mik uhP1cbY/yn+43G6SGbVcuyZnEEPvvCMiXnZzryMRsh8Odw3H7pu5pO3+Xv/68hE6he8H ZAR9cxuAP0O2ixXqz107LMaGDHHGH3a2etOdS48euG1nmkimVqQO91HOAsFYAgNUbZv7 gdlKD2Ge6lIpNV+E+cB7LDUcbiPqA15QcEwaIAxb+3xOnQn/QxOZXkzs8kwfH8dshzUL sTKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709944071; x=1710548871; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EWYfh9XoJurOTi8J7CJKHaNZmYFNooi7e3RylW8C//Y=; b=Sl05xzQiBvmr+wf53Rba8yfvtfprNosWO4921YLTGCpykEkrFnJnsNdL5BCFB3a8Es bajB+oF5HSPq0XfRqYgf4D+gJaeGIqXD75CwLLjMUYBVTEoYZJ9AaiwVMmvk7IJ1zZYN 6gm7ZsTPLXQ9/P50yu6v+yxKWjf7KbAxyUpFWeN4c+HAd5JRAHirsJjz+309SXqD3biI mXm12h0+fk7552EWthjzIwjkEwuSr+0CH7qQMN6zZB1lU5szVPNtYKzg8ZeTdKUoonxE j7CvmQQ09ZPzXSQEwk3ykctgM5YePEd6Y7uxAfBU3lwjBspUwupeAYLoiC172vg5rm/G aapQ== X-Forwarded-Encrypted: i=1; AJvYcCUld/+xYhX+ekrRm8OL55/e2455qqXVU3rKmeJyYbLK36Jrts6Xc44W6szrAfsnUryYpVlXVz0lZdtMm31LSooAGorfH6bFaTPmyq4= X-Gm-Message-State: AOJu0YyH/V8hZ9BVqMCwuW3n9ynnfp6ESU8pNkOSg0u+/fX2nBmPhcwW wsjDpWIP/drhH4y6Lu/sBLrin+GiLZ8ubjeDF7Fy6RevMe+ixeYonAapfJNPvZhuTHafK1nbT+z uc4HadLfAZaR6c9UVJ/Ug5rjrjDM/QkjICw2O X-Google-Smtp-Source: AGHT+IESd1pHYOts43futyrxfMXx/f2edur2d17Kl0AlPQ1Jsil6uEMQ/KupG2jdYDiEzWeJ95HiQuXNh787lBIftRY= X-Received: by 2002:a17:906:3c56:b0:a45:b631:1045 with SMTP id i22-20020a1709063c5600b00a45b6311045mr133451ejg.21.1709944071018; Fri, 08 Mar 2024 16:27:51 -0800 (PST) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240305020153.2787423-1-almasrymina@google.com> <20240305020153.2787423-2-almasrymina@google.com> <54891f27-555a-4ed1-b92f-668813c18c37@davidwei.uk> In-Reply-To: <54891f27-555a-4ed1-b92f-668813c18c37@davidwei.uk> From: Mina Almasry Date: Fri, 8 Mar 2024 16:27:39 -0800 Message-ID: Subject: Re: [RFC PATCH net-next v6 01/15] queue_api: define queue api To: David Wei Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Pavel Begunkov , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 8, 2024 at 3:48=E2=80=AFPM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > This API enables the net stack to reset the queues used for devmem. > > > > Signed-off-by: Mina Almasry > > > > --- > > include/linux/netdevice.h | 24 ++++++++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > > index c41019f34179..3105c586355d 100644 > > --- a/include/linux/netdevice.h > > +++ b/include/linux/netdevice.h > > @@ -1435,6 +1435,20 @@ struct netdev_net_notifier { > > * struct kernel_hwtstamp_config *kernel_config, > > * struct netlink_ext_ack *extack); > > * Change the hardware timestamping parameters for NIC device. > > + * > > + * void *(*ndo_queue_mem_alloc)(struct net_device *dev, int idx); > > + * Allocate memory for an RX queue. The memory returned in the form = of > > + * a void * can be passed to ndo_queue_mem_free() for freeing or to > > + * ndo_queue_start to create an RX queue with this memory. > > + * > > + * void (*ndo_queue_mem_free)(struct net_device *dev, void *); > > + * Free memory from an RX queue. > > + * > > + * int (*ndo_queue_start)(struct net_device *dev, int idx, void *); > > + * Start an RX queue at the specified index. > > + * > > + * int (*ndo_queue_stop)(struct net_device *dev, int idx, void **); > > + * Stop the RX queue at the specified index. > > */ > > struct net_device_ops { > > int (*ndo_init)(struct net_device *dev); > > @@ -1679,6 +1693,16 @@ struct net_device_ops { > > int (*ndo_hwtstamp_set)(struct net_device *de= v, > > struct kernel_hwtstam= p_config *kernel_config, > > struct netlink_ext_ac= k *extack); > > + void * (*ndo_queue_mem_alloc)(struct net_device = *dev, > > + int idx); > > + void (*ndo_queue_mem_free)(struct net_device *= dev, > > + void *queue_mem); > > + int (*ndo_queue_start)(struct net_device *dev= , > > + int idx, > > + void *queue_mem); > > + int (*ndo_queue_stop)(struct net_device *dev, > > + int idx, > > + void **out_queue_mem); > > }; > > I'm working to port bnxt over to using this API. What are your thoughts > on maybe pulling this out and use bnxt to drive it? > Sure thing, go for it! Thanks! I think we've going to have someone from GVE working on this in parallel. I see no issue with us aligning on what the core-net ndos would look like and implementing those in parallel for both drivers. We're not currently planning to make any changes to the ndos besides applying Jakub's feedback from this thread. If you find a need to deviate from this, let us know and we'll work on staying in line with that. Thanks! --=20 Thanks, Mina