From patchwork Fri Dec 8 00:52:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mina Almasry X-Patchwork-Id: 175496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5163261vqy; Thu, 7 Dec 2023 16:53:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe2ufli1YMCTK+F0RNez99dZ/lGqEk806EIf/bEZZ6rcz2CmRgKWguEFzbT99qpJazBkCL X-Received: by 2002:a05:6a20:8f02:b0:190:93e:f224 with SMTP id b2-20020a056a208f0200b00190093ef224mr1984757pzk.76.1701996809477; Thu, 07 Dec 2023 16:53:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701996809; cv=none; d=google.com; s=arc-20160816; b=Jwn/Dzf2njBFWc38tPUvson6q+urfYiR5mrj1RvavpXOYcA0lQNy3qdxbfouA8PfNs G10jyaSyDXtX/Y2yKqcwI1YLlhCTgqQSnJGuPpEQtFz1oafG0rWeKRC++l2eyxbpT5WK q9pi+1AqOHpgdFNN/opOhutI2luiLBiWEf2rORZMhNp2GFB+aMrbKwDhL+c6B8G52Ptg XcH6tsoj8L4eO7I61IAKuaL5WHeKKwDRbxh61FLHr1yJpu55jgeTeLnUK4Sc6tZQQjgQ Vh1uT7/fqTyvMWEy9I94MkWgppEI8Iasegbz1XgAps0jmofIsbpRagpB+B+8Bp7X6pFp rcWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=V1r8ZXlyktFk/hR6LvKbeClNyv61T/bWHclepM8Rp88=; fh=spYIC3Yl69sWtCLqpfRLMGcxeD5ncKplqDHTlWXfkQk=; b=fiArZHkvErDZiNIr61OGRMEoEMg3HlvfHrPgmVAYCDs2IIttBWGmtnVE7l3zrDM7c2 G16xqaORosG5/Vc2iBEHgg6Ur2h/QShl1r196PLjaS4ynre2gs0vMtmYmY21/pCImqhs BtbWGGOONFipS3RpBI1wFaoZuU083INySzjZkKNY6s+0rBc+jf5NH6RY8ysXAfW9dVN4 Wk0tqYOX1G32LvuKe/eCbS0PGzlZUozn3qU9/d8lHdQhkB4GPmKLTgYZzMLiTQiiP4CJ HoAtWkWxd8fkpUdOtQUsWYW9LMzk+DwQ650a6dZdjJbuNpD5fMyvbCvkmSmUMLuyzHcT 4hTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nKnwUW+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h18-20020a656392000000b005b11e5a69fdsi541177pgv.508.2023.12.07.16.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 16:53:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nKnwUW+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8BABB815CDBD; Thu, 7 Dec 2023 16:53:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235659AbjLHAxH (ORCPT + 99 others); Thu, 7 Dec 2023 19:53:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444201AbjLHAwz (ORCPT ); Thu, 7 Dec 2023 19:52:55 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1AE3172E for ; Thu, 7 Dec 2023 16:53:01 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-db3ef4c7094so2057011276.1 for ; Thu, 07 Dec 2023 16:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701996781; x=1702601581; 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=V1r8ZXlyktFk/hR6LvKbeClNyv61T/bWHclepM8Rp88=; b=nKnwUW+ODKImfMaS+HQrnvNEyZvj4JFMXrS8bZ2Yj2CEkAWfRhNkOcAbSNZryzCV40 IEP3lXnGr0DPXlGGLhlUv9I9HMPS4JPnRE7WCrvUzpjlrtvyTGHZ21wStkG0XrDx2NMW UxP6Ekq10yozd0+HCZ2rraY2EqsiLLQf7nZUnVP6fq27YMRIRrL3OzLJnG1+wUA+pcXO vd6SaMDoFYSUNiRcyaZnRvWOhdHS3Y3Lw/f3oaqITRv1LXh3YNJumLBbszFEM4o6mo34 MaFYf2i0lX6QKtI2a/1XI8KLfwQUm79xAeSyNffz3LXeA1Otv48DStwIYBlBzvrjFvl2 oJGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701996781; x=1702601581; 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=V1r8ZXlyktFk/hR6LvKbeClNyv61T/bWHclepM8Rp88=; b=ltuMLv5RoapCmKZYNZehf0RHABdrv1wGLbPPrL6Pyjmr7oyh1yoRkJ6v1/hKVuL/GF sG/3/cMetMWrcKyw3+7R3DyThzXliIY9W3CQLnC/ODLCMABv6RSI2MU5oR9A7ujSeYRw d/lTgFfZMCgv6dhoW55j6kHXsGbyEIs+4ctHNqN7PTNFhn6mnpi0b6HzARvLCL86JI9r hpEiVv44FcP3uF6GsQbGGJiG0jK8A2uNhH0pw8AR1oTL1xEoqRgAD9CZ8I8Tzp/vW10H 7Z6+gahPOVlhij7QsC+BlcUX3vrKt0B9+sFsvIiHDJZ4SuhX4MFnDjsvZJnbrJrPRyys 58aQ== X-Gm-Message-State: AOJu0YxOIF7BJEf8Lmccl5zMrCmrEOYgSQ4TOZahxOackmsrjyMe3/4a sl0UnMab3Zk+OFN8sLRBeb9NRMr4+IrbKgW21w== X-Received: from almasrymina.svl.corp.google.com ([2620:15c:2c4:200:f1cf:c733:235b:9fff]) (user=almasrymina job=sendgmr) by 2002:a25:cc4b:0:b0:db5:3bdf:ff55 with SMTP id l72-20020a25cc4b000000b00db53bdfff55mr39860ybf.6.1701996781080; Thu, 07 Dec 2023 16:53:01 -0800 (PST) Date: Thu, 7 Dec 2023 16:52:34 -0800 In-Reply-To: <20231208005250.2910004-1-almasrymina@google.com> Mime-Version: 1.0 References: <20231208005250.2910004-1-almasrymina@google.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20231208005250.2910004-4-almasrymina@google.com> Subject: [net-next v1 03/16] queue_api: define queue api From: Mina Almasry To: Shailend Chand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@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 , Jeroen de Borst , Praveen Kaligineedi , Jesper Dangaard Brouer , Ilias Apalodimas , Arnd Bergmann , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , " =?utf-8?q?Christian_K=C3=B6nig?= " , Yunsheng Lin , Harshitha Ramamurthy , Shakeel Butt X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 16:53:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784673006663388071 X-GMAIL-MSGID: 1784673006663388071 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 1b935ee341b4..316f7dee86ce 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1432,6 +1432,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); @@ -1673,6 +1687,16 @@ struct net_device_ops { int (*ndo_hwtstamp_set)(struct net_device *dev, struct kernel_hwtstamp_config *kernel_config, struct netlink_ext_ack *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); }; /**