Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2410553lqz; Tue, 2 Apr 2024 17:29:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWunImPeoBg8gTjk0REVIK5VEdy3DhkVUHrsO+rzlV0LVUl+Ae03HbexwLZg8FilANhlMaF3lQUT1rKNc/WMLfbhJrU/BR2YLzkh1bH8g== X-Google-Smtp-Source: AGHT+IF3aFQgPdDBZd8EiOP2csXi25eEuahsrgyPWggiTRjrIKaImlsnbBPczvsfmhkhpozY9Bq8 X-Received: by 2002:a05:6358:33a3:b0:183:b74a:249f with SMTP id i35-20020a05635833a300b00183b74a249fmr1131486rwd.24.1712104160048; Tue, 02 Apr 2024 17:29:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712104160; cv=pass; d=google.com; s=arc-20160816; b=xSeDO8HE6GJHf4ymhP0Z6WZ08pOrbolkmNa7+nFEBu276tfB1Zaj6HOxa0gvNOER23 E7QzkPX2fmae4mBhTKRsSbW2AXjHDE0f/bUzFzGDou+snXGqrPra0haDXOJ+P1hbdE41 MX1gIQecrspmH0DHSE2GgFDZCMBi11C1vzhrhVOE6mqmpahEmEofKZsieI21c1+dgX00 JcGEasGomIwsMz2aLKG1bUMtfIBDFe2FLxVWPnsrEgY5vmKGc3yYCPdr82sBTPXK1Ye6 tcnNX/mWAK4Gp7SvY0OeD0pw9gxHcV/AF95+vefQJiaZtvC8U1jkY0vdezCks1SdxUmq AcOw== 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=i9/eCQL3Z814esAM4yERlEsKsNnrs1jkfV4Puiw4Jo8=; fh=hmURr5oS5bg7oPNMzUtSzdcZCQsZmsSv67nR4BckpzI=; b=fOZmPxlwryPCX4454Xa52ujIem4XzelV0Ol4QGefszDHiRcjrX/6WMrb9tcKNvRLzY yY8DRa1nen9UZc5hkHp4M8xyt/owL2DLt3ZNnrEzR5v+1c+uZwshWe6iDGOg0H1TE9vA X02aj1Fld8hj5aKk8El4LMI4snxfILTiSrckynZsQFPIG8GwTNX0gWZ4sZ9MOYR4JwYq oaw6Ru9OoNFx15cdwlKhneXESgRJRGV8Ow5HO7RhdgA6c3OgEMiTX7s93vRBkphYq6QW WVkPAtI94pX0kJJjx9v1O1ya6s7DoUItCCK19sMTHE/E6XqosDRX5faJpFsqQPKEgJWc u3xA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qnACVtKh; 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-128857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z13-20020a6552cd000000b005dc80a2a308si11700451pgp.436.2024.04.02.17.29.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 17:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qnACVtKh; 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-128857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128857-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5EAD4289895 for ; Wed, 3 Apr 2024 00:21:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53605101EE; Wed, 3 Apr 2024 00:21:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qnACVtKh" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 675618C07 for ; Wed, 3 Apr 2024 00:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712103664; cv=none; b=Img7R61TVXZLsP1Vkmh8hBxmqgXosHGAN6MxhPtnyFbFetmqGeDmlohlV97tfRiBSzjkGNAVNCuyZ/A9Y/beXVMW5N1gEmBOQ2MSTXIkQL9xp1AVY5aVx3yMELhthQ4O/OYacZVJOjTxVAmrYf53g26JPeBRK4Jv3VZffmjdQpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712103664; c=relaxed/simple; bh=gWRcyKODjkpOwskuiMoFPxRJnFLhBJ+2aQ4yyFxaS+w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=j2k/UjmJNzITzquDdnsTn3BCPpuBoSSO90ca23sDK9bVcxc3QrGDyCEH+eg4L9jy/ic/mTCeklLzG65pXIpNLmt8m3rUZNNDKKAZheTpoUvoBbKsIpi2cD/12S+auw0eI966SKrQdR02YTh4qYYhlppJp4G78fD0m4KX4kfyq2w= 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=qnACVtKh; arc=none smtp.client-ip=209.85.128.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-yw1-f202.google.com with SMTP id 00721157ae682-615404edc5fso5698247b3.0 for ; Tue, 02 Apr 2024 17:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712103661; x=1712708461; 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=i9/eCQL3Z814esAM4yERlEsKsNnrs1jkfV4Puiw4Jo8=; b=qnACVtKhLQTyisTNSFx4mrXyqFeMM0XeeWn0K0IjaNuJg32stlpeFmxHQgQdb5vIg1 EaAtDqZNVDPFMiw/+vy/sc84YcIc0PU1U9w1vcRTT19QmRcym8m2JTAiu5KduzTmoyCP agW7h7hBvAAR2pORQcd8o8fZoBZID6DMJpmtFBW05TWyfQmsPyX7V07n0/mTCXWq4ui3 ufSWs1Rc72Eshz5r97+t9k+qpn7qimmLH+8iRZjFfx7UW2lWqH0luj4oKrcTzPZlnxG3 0fTWXnrGLmbpHCzDYp1bS0BxHr/7XjG1UEJ1HbfuEzdKNF80Rd60kPHlWZ3CoUfeOmiT m99g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712103661; x=1712708461; 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=i9/eCQL3Z814esAM4yERlEsKsNnrs1jkfV4Puiw4Jo8=; b=NBw1NrlKi4T940/isWnWYjjcDqit1sosd6vAm52hISTac8I1IjNLvPQWuKdJD0crgG gVvaclKyB2akmv/Y6vWUssd+HP50Kvj6Xj3KpA/U/EumB+B/pcilBJdGwIUoILUANqUE j2skrmGf8frjNyyaqZQ02v2Jy5WLalQy5mw231uxLECviPrC9xf1XKmmXQRGYaJsZ+h2 G5Lj2Owi1cmQMjy2l8yDh5tj+2LendsrAf584ZVrTjcxe80luZ57Ednd6Mosfm7LbAFp uHYZ4wV4q/Dg2+49/eEoZdt0eqHBezszGsOzNnptj13WES8S562iH+mfgSWNb2pMOO9V eEGA== X-Forwarded-Encrypted: i=1; AJvYcCVXAXmJNR/+NBA19AvMBTZRr9UcE/97MzGNqQNQ+8UIPTrTJQ6GXL+6cpzxkgYOelbwlRGdSJdLUf2erEh+jFRqkPZjL2ZbGe66DQ0F X-Gm-Message-State: AOJu0YyzJ0Rh8gpu4+RYJAoawYhd6JsbTV7H1SINtR7GTlxgAGXRLBna L0/SpAhGwNxEE7Rie89HqvN1JZrwhXdj3YQNcEwZKk9PL5Po3BIwSz98QqG+I468VLLXYIRcHt+ H6W+o1eds2bHTmKlsVjJg3g== X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:1726:7620:90a1:78b9]) (user=almasrymina job=sendgmr) by 2002:a81:b703:0:b0:615:f67:53e2 with SMTP id v3-20020a81b703000000b006150f6753e2mr206828ywh.2.1712103661503; Tue, 02 Apr 2024 17:21:01 -0700 (PDT) Date: Tue, 2 Apr 2024 17:20:38 -0700 In-Reply-To: <20240403002053.2376017-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: <20240403002053.2376017-1-almasrymina@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240403002053.2376017-2-almasrymina@google.com> Subject: [RFC PATCH net-next v8 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?=" , Amritha Nambiar , Maciej Fijalkowski , Alexander Mikhalitsyn , Kaiyuan Zhang , Christian Brauner , Simon Horman , David Howells , Florian Westphal , Yunsheng Lin , Kuniyuki Iwashima , Jens Axboe , Arseniy Krasnov , Aleksander Lobakin , Michael Lass , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Richard Gobert , Sridhar Samudrala , Xuan Zhuo , Johannes Berg , Abel Wu , Breno Leitao , Pavel Begunkov , David Wei , Jason Gunthorpe , 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 7d12b5a9380f..a0bd542d143a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1957,6 +1957,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 @@ -2339,6 +2340,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.478.gd926399ef9-goog