Received: by 2002:ab2:f03:0:b0:1ef:ffd0:ce49 with SMTP id i3csp94896lqf; Tue, 26 Mar 2024 15:51:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXdBnjC6a5Gb2MhR1EKQ4BD4lc3L85fktdAHhgaSqc9ItDaF+DFkd87rsNo5AMZmRhqDXfn+eUehPFOdibtaku+QYGOZX0tpiQiE0ChWA== X-Google-Smtp-Source: AGHT+IGHT8XEfLQf8sXozo4Q1lOl9tnsKkRpy8KTyzk9vT2jkmC9r2LnbFeIpdl6eJxQWfjpaMTT X-Received: by 2002:a05:6808:2226:b0:3c3:dd8b:6259 with SMTP id bd38-20020a056808222600b003c3dd8b6259mr1006156oib.44.1711493519364; Tue, 26 Mar 2024 15:51:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711493519; cv=pass; d=google.com; s=arc-20160816; b=X7tE9dwGm91sPQuRsKmiatVP5SpEdH15m2ToT8cNzVqmFJZ/eszTjRNZSUfjyrHQeh mjPbYyz1iWgcSHc2/ujMuggiOXXYudlSozHP3WtAUAlP8by4kzevokzqHlKo+YeeQAb3 G+lsqSpD2DbpfZpMAw8IgWeUJadcr9NJlqCBebh/g5k9okn6Xn6Jj1h857s7CG96Asm6 Xoem1y2ETK66Zy6qtNfNiOz1u+74kktsef7cYutG7bLovkinr53q21FAyF5B+M1Bw7En ztdwO0M/CrXfheOJbQb85TnNQtIcRKbidWMRddGMb/OMrCKkPt8Fe48+ZXqeei+0w215 qKfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=g7wPvg5SzHg3djrLO0jF0y6HKK/VaWsWbJGTmJoXohw=; fh=l9FTOzymU1nAJQYmsdJfRLpnGXls0K1JLRx429IF90c=; b=JzKtWHrioEaJpoy4mqV8UnSCqbuEl2sf5O0K6iiqdMwHv5cUUwqZrJtrbxrufwD+NP 8NC3YSEMMJE2bza112xvS2boSGGQJ/UknktR1MgfcnG9N8seAVYaJqzY9fPznvdxeolC C1Qgy3PfQFq1wm73/D7lbAuZqhBWelyNApjdwolj6+HUC9upfL9ZQf6s+8yulESoMyOq jXd04EI+tN0UCE5Wz9tioD84eEQouO1KWEXVqQRSYCccsC8KudI6VRwjdRuhxOCwFgvv keTGLi/VPlDzHzshLzSVQcvB5DDODcEnmwSKS2MTNumNIuQXI/D1KqTPdxu8Myiqy5kk y7oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=x6D+IDhp; arc=pass (i=1 spf=pass spfdomain=flex--almasrymina.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-120103-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120103-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 r4-20020ac85c84000000b00430caff98e2si8552234qta.242.2024.03.26.15.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 15:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120103-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=x6D+IDhp; arc=pass (i=1 spf=pass spfdomain=flex--almasrymina.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-120103-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120103-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 E4C9E1C3744D for ; Tue, 26 Mar 2024 22:51:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01B5213E6D3; Tue, 26 Mar 2024 22:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="x6D+IDhp" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 3677E13DDCB for ; Tue, 26 Mar 2024 22:50:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711493461; cv=none; b=Rnke7bxyOPkknwA3JL8jxgm0uVDLB9b88E0sODs8KPSR9yxW/E4+yZIKG4XmqLmQi7r2WQa2Q89cmXsfDmDmGp6oYkzj73zdW8mlMZjQOrbzfKyx3OvETHrB97kGFeihxkERc3LD0KZmRPMCIBzfbazhsagRoRX1xdQ8g+6N4L4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711493461; c=relaxed/simple; bh=HwXV7niH/WxHc7jazaZuD951dDYxvnrXLKJ5aOXzXpw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ko5J0+043R1ZfR0JV3jWP4hJPsI2yyGdg1XAbNf/1H0NCIhOL8oYvoiyKTCl92QgNfl7EQL2h2F615X423nEGxt6TpxzBV4yOX8GGU++Jisr4pOpqt+HJBnH8kthyT3MORZrScAx8fZPJ/59oskVKOo0xsMcT3AyiHHhLzRYdMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--almasrymina.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=x6D+IDhp; arc=none smtp.client-ip=209.85.219.202 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=flex--almasrymina.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6dbdcfd39so12087173276.2 for ; Tue, 26 Mar 2024 15:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711493457; x=1712098257; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=g7wPvg5SzHg3djrLO0jF0y6HKK/VaWsWbJGTmJoXohw=; b=x6D+IDhpGqjgzwRWj5fpWKi+7i3QZkp1IEDjB1Qht3yOOKH/VaiTKAYKk0R5I603OM t8L7+P2cVN7YCO2ENWLslUaz3Wt5Ub8UGxiK1CnEQt7A+qRozSX3M31IgguKAY6jZJw+ LSzyZ74AWYo8T8vPppF0g51kCPRajl4ZAM2YZ0CcWsFmFjHpGZ1UK+1/djvdkW4KvwJe 97+MTstmMPVNj/zWYAY902/7tbetoYKV2/LacWPHJzEkDO33w0Jf8bzOrAjAP2nrbNOx LiQz1FQl1cprHZuOKN0V5HnKIDSqzQfN556rGH7/lhFMvzDRbqvzJSzc7y5HA0+T+wSy 8vig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711493457; x=1712098257; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g7wPvg5SzHg3djrLO0jF0y6HKK/VaWsWbJGTmJoXohw=; b=jYUsH5/UN2A9PZDbnM4o7lovj/6J5+5JHHufx6s/bUEZ5e/9EJyTvIHLXgy3I7+7c/ E4G5E7WmUjIsb2MHINMywlzgcayuCknss9n4BrXzQOMtF2/Z9nwK73eMwA19olHNVrmq ooNuT3gbF6JuCaWZuVhBfhC1jtGei7J36aNhjms+k7h/cyqmH1Wa6CzgayLvVZpdeN1C pf9gtkJ6GeBvvOOtAe75qCj2g3bOtihDRMCnFSR5TwKsG8CIXg2GnswhqQXCvaCKNe9l EYpdNJEKqTLD/m6bpgc+R390qiGte4TmVANdb378dGeHaFzIq67+QczpzhoYjnUi0Qdb qbFA== X-Forwarded-Encrypted: i=1; AJvYcCXKVIKhnTUOeEPOs0ylyE+brLfRGQwUzJkqG5hoZOCzTLa7t18FfcniSgbYfwymhfpyoXxVbBY373IomQ7fuh/8C3IG0An+obkht6z0 X-Gm-Message-State: AOJu0YxWv+efSTorSxC0npFuG8V+nIF9nwPa7IABhToXG4WaN+XoNDzp FL0Qp79QKBI9Ri4/+3YY+DZH1DMkGWyxWs4i1CSQyHuJvuyPqGUGzU8Y4Vhxq8nZGuyv1jIL0TL /BO2hhvBDRbh8sz9xqZGobQ== X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:c51e:bdd0:7cc8:695c]) (user=almasrymina job=sendgmr) by 2002:a05:6902:220a:b0:dcc:f01f:65e1 with SMTP id dm10-20020a056902220a00b00dccf01f65e1mr3555213ybb.8.1711493457318; Tue, 26 Mar 2024 15:50:57 -0700 (PDT) Date: Tue, 26 Mar 2024 15:50:32 -0700 In-Reply-To: <20240326225048.785801-1-almasrymina@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240326225048.785801-1-almasrymina@google.com> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog Message-ID: <20240326225048.785801-2-almasrymina@google.com> Subject: [RFC PATCH net-next v7 01/14] queue_api: define queue api From: Mina Almasry To: 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 Cc: Mina Almasry , "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 , Steffen Klassert , Herbert Xu , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , "=?UTF-8?q?Christian=20K=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" This API enables the net stack to reset the queues used for devmem TCP. Signed-off-by: Mina Almasry --- include/linux/netdevice.h | 3 +++ include/net/netdev_queues.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e41d30ebaca6..3d3af8f7f9c9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1956,6 +1956,7 @@ enum netdev_reg_state { * @sysfs_rx_queue_group: Space for optional per-rx queue attributes * @rtnl_link_ops: Rtnl_link_ops * @stat_ops: Optional ops for queue-aware statistics + * @queue_mgmt_ops: Optional ops for queue management * * @gso_max_size: Maximum size of generic segmentation offload * @tso_max_size: Device (as in HW) limit on the max TSO request size @@ -2338,6 +2339,8 @@ struct net_device { const struct netdev_stat_ops *stat_ops; + const struct netdev_queue_mgmt_ops *queue_mgmt_ops; + /* for setting kernel sock attribute on TCP connection setup */ #define GSO_MAX_SEGS 65535u #define GSO_LEGACY_MAX_SIZE 65536u diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h index 1ec408585373..337df0860ae6 100644 --- a/include/net/netdev_queues.h +++ b/include/net/netdev_queues.h @@ -60,6 +60,33 @@ struct netdev_stat_ops { struct netdev_queue_stats_tx *tx); }; +/** + * struct netdev_queue_mgmt_ops - netdev ops for queue management + * + * @ndo_queue_mem_alloc: 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. + * + * @ndo_queue_mem_free: Free memory from an RX queue. + * + * @ndo_queue_start: Start an RX queue at the specified index. + * + * @ndo_queue_stop: Stop the RX queue at the specified index. + */ +struct netdev_queue_mgmt_ops { + 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); +}; + /** * DOC: Lockless queue stopping / waking helpers. * -- 2.44.0.396.g6e790dbe36-goog