Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp278073lqc; Thu, 7 Mar 2024 18:08:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9AljLxRHX8SzX+5VzPMiZiWb7hu6Vd0UaZPTa69WNZSFPV+dyFaPNK5Cua4wrgME8U8K63OnOOCrWUhNiwPHTsuD3AeqPHDmc/boSDA== X-Google-Smtp-Source: AGHT+IFwezWrbvi5QPl4zCoxla9redsf7ZdSphajB7FihRXQc94islQhzgSHq0+pgAtFH1isFyGy X-Received: by 2002:ac8:7c4c:0:b0:42e:baea:5f26 with SMTP id o12-20020ac87c4c000000b0042ebaea5f26mr10352574qtv.7.1709863737481; Thu, 07 Mar 2024 18:08:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709863737; cv=pass; d=google.com; s=arc-20160816; b=K13i+LBv2iZ5zOSkd6k28C0HVvg8vpFeLfpT0NaUp7Bss7C0MTatj31cFfFuemOhTr sKOGMvG+mjog3hGcpzWl+wUY7I6nMyaD8LfnYxX24OraWl8E04XTXhGV+VQ0EnEgpUsR nTiYXs9NjnkUKyxRDG/PBwXgB+bXVyBWSmENCXSkPm/touxbzz1OshT2tfc8UnBgQtLa JGUNZH2L9rqwKKgArp6K/K8hQ1qMqTGjf/Jwm/c2OkD/WBRoII3MplWRVjFN6c8HKO/1 QyMiicTnjAKowtCNQ3ZORWG3ufc4075fCXGqNMtnhaR4aiH8HfgWSaqQjCCLpaTJTns3 DeEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=M5QPfVVlznHCy9800rrfO6KR+EEw66k04MBVvznezAw=; fh=1lTtXbKd1m89vTaUufUIgzFX68mdS5HVcgQV6yIB1G8=; b=z4tni7T1RcOVsY8XfxFDDrfn1wYjtrgSku06DAso2GLXmGmUIB8yGCypKofZK93y8E wEr/AToC3Gh5L+kC7fJeRohh9GgtkQeWmqwjMuJ1WH4cx1Y2k4wzpo533EfE3z90i/CE mjeEUhCVsK5Xq2hkDTx4X4E0EpX26xIHcJ9DiicB3VCQ8bUMznBjK3PsU6LIQeDW4I69 3C1eXDs1o9c8jwLAMXnVcNSgwwWhsU8+XJ4X7gr7opw3055j1dV2Ei4TdN05cL0zmo7E jb8/bGZDIovNK+erdoU5dTsNV35+6cNSne592CL9UgVdihkRNd+uM44vn2YQ/ORi9ge+ QOyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Vz8QSX83; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-96442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96442-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vv23-20020a05620a563700b00788321916e0si8115447qkn.471.2024.03.07.18.08.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 18:08:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Vz8QSX83; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-96442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96442-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 260631C2154E for ; Fri, 8 Mar 2024 02:08:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68A8924A06; Fri, 8 Mar 2024 02:08:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Vz8QSX83" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 EA02D22F03 for ; Fri, 8 Mar 2024 02:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709863721; cv=none; b=C+aMdj0lr1nD29Y0msG7sAGALKcML354EIe8MZ61gNLhZjQLElw/kcFiIeeunpMTPQU9F21ZrNKFlDiyRA4z9yPF2JYgGqxb0M95XpUckAqp3KizS6tbRpROU3vy0Riii0nySyHL2wDucMBBNC7Lup/DXZU1X/RNm2R+fv9u76I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709863721; c=relaxed/simple; bh=2oAucL9FmKXjOeeokVf3zjH8TEdrD9innbGK83JfkzI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=XMkC3LAKLDkqwQtCbyGBddXvMkagwg6ZFKjIaDdM2wNVeNCA7GRJbuzeUkj+rryCLpWmJsnMfjtHqJDIkGlH6OfJl5H0bzI2g53R90x7Q4i+mTssqt44AkhwcyoNciTZSdx3rGd6l88SGDolzkbfGJ+SV0gMZBNxsonlNyLhT3M= 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=Vz8QSX83; arc=none smtp.client-ip=209.85.208.46 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 Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-563d32ee33aso1808909a12.2 for ; Thu, 07 Mar 2024 18:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709863717; x=1710468517; 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=M5QPfVVlznHCy9800rrfO6KR+EEw66k04MBVvznezAw=; b=Vz8QSX83467DPy9/uYGiv6OK9FB4nRsUecP/Zaadz0/VC432HtZhHH1FcQH3zTYFYY 7HjBEsKjWP8C0mg2eKq4cmIuEljNRPYJhn2LT6DQvErrBeYQsOCzdZaBO+DBgHF5hTXb lkqQ/7YrnMPjWk+t44qevtx5QGPq+o+D5ea7IS4ZfGhJ1RQcfuhwCs8yDY54JrC9qXrq S1LJ1E7W5e1ltSo6rm+C4uBPWNj3v2cqCFQiMuYEvc+3Iz81BN3MJIHW16//ytI7YNrM ooLn48otvXdUIyX/O4w6xN4Fu1wkPj9+2ZvrMTBW7Vt8aOVXpvzkXcYN+ycpiqX2CEGY xZRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709863717; x=1710468517; 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=M5QPfVVlznHCy9800rrfO6KR+EEw66k04MBVvznezAw=; b=gXStPedukIxwisgcXUwp8Ozh5HCJimNJ5bvCSY1imST1CG+g75gyucmoZgBhZAN6HW +tt2XEcNlr26hpwCbqgwAfpjuravp6unaCz7ijV/K5mbMcQAmExc1ZvaCqAn7QFKPZkW S3ZKWRgriGm3wLCCYNHh8CIEgd3hBvqhM6gwjM5uI12HHc1VBbACC0j0uW+DR8IsO4vo GaHKH9PEhX6QlRFd5iLdmFiolIFU7XbBfZ7LHkO6ejISXjG9RdQ1/baph8uWtYXkrum+ 00Nm5kQXlA09hV1EMYCXj4DHnqgJEmdJFXxEx4AurLVACcRAL0Gr5gwStYRzas/f5taM aJDQ== X-Forwarded-Encrypted: i=1; AJvYcCVFWCZYjKkem/h+noYULkwg9Jwe4PC2boeekrdDIAZG2tNFymtEzSnGa45V2eLeYxFrfn1tVyb+Uka0p/7tu+dKtJNEIp4GFEYaLJez X-Gm-Message-State: AOJu0YyQ4y3jmRQASiRS+QKI2PecGWBcliDAL2ooVRJ1CulU1BScFEEv cMlSXlrORXRrGjpuGfc9GU66dgkNYqtxb5svZw08HzEsm4sIaJnPu+bUTwLy0lRUmttNMGpoYyb KWCXuiXwRg07d5VEWhbIVGV3tkV1gqnAlHhxU X-Received: by 2002:a17:906:b055:b0:a45:ba06:e501 with SMTP id bj21-20020a170906b05500b00a45ba06e501mr4646563ejb.57.1709863716984; Thu, 07 Mar 2024 18:08:36 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@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> <20240307173039.00e6fbb7@kernel.org> In-Reply-To: <20240307173039.00e6fbb7@kernel.org> From: Mina Almasry Date: Thu, 7 Mar 2024 18:08:24 -0800 Message-ID: Subject: Re: [RFC PATCH net-next v6 01/15] queue_api: define queue api To: Jakub Kicinski 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 , 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 , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 7, 2024 at 5:30=E2=80=AFPM Jakub Kicinski wro= te: > > On Mon, 4 Mar 2024 18:01:36 -0800 Mina Almasry wrote: > > + * 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); > > The queue configuration object was quite an integral part of the design, > I'm slightly worried that it's not here :) That was a bit of a simplification I'm making since we just want to restart the queue. I thought it was OK to define some minimal version here and extend it later with configuration? Because in this context all we really need is to restart the queue, yes? If extending with some configuration is a must please let me know what configuration struct you're envisioning. Were you envisioning a stub? Or some real configuration struct that we just don't use at the moment? Or one that we use for this use case somehow? > Also we may want to rename > the about-to-be-merged ops from netdev_stat_ops and netdev_queue_ops, > and add these there? > > https://lore.kernel.org/all/20240306195509.1502746-2-kuba@kernel.org/ > Yeah, that sounds reasonable! Thanks! We could also keep the netdev_stat_ops and add new netdev_queue_ops alongside them if you prefer. > Very excited to hear that you made progress on this and ported GVE over! Actually, we're still discussing but it looks like my GVE queue API implementation I proposed earlier may be a no-go. Likely someone from the GVE team will follow up here with this piece, probably in a separate series. For now I'm carrying my POC for the GVE implementation out of tree with the rest of the driver changes: https://github.com/mina/linux/commit/501b734c80186545281e9edb1bf313f5a2d8cb= ee --=20 Thanks, Mina