From patchwork Tue Mar 12 21:44:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13590637 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (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 CAE4E1448F1 for ; Tue, 12 Mar 2024 21:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710279883; cv=none; b=W6/jWA05W56bs6ADW3Ym4WJBHgY1zb8UU7WPzNRkNzzAEkuOEt0bjb+6vwAJLEIdg1RBRoI1O8iMMWqRzcVrsYQROGS9uY0XZ+A4Eltwh9aBrDKlca3KFSNXP4uqblD+u28/aj6uumhoJ7aRCDI+VzsdVmLmbLADbesD/CAQk9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710279883; c=relaxed/simple; bh=tt7Qj0Ee9P7w5WJse4ZzKwHZdEsDt8EZR8C9Xbepvys=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n5m482+3Nq7RACpsJzOQybg4TmYve5pMw6saXRl685q7t3XfUr++OEIDN44K2Zv9AoyXL/JwVRgXVvQRWACClnN7JuZtv8QCzoocj7BW9987rvZZJDu6jpS1J5LNqYY1JqZJ0b5PVkm0qNb7/LNKIFYLL1SSYTBD/vrIOS/Pyhk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=fqUNScge; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="fqUNScge" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5a1cf769452so2445988eaf.1 for ; Tue, 12 Mar 2024 14:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1710279881; x=1710884681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RSdOpXaG5eyYtOQK8HIj1OSb+RRKm9zsEqtIIKixBPg=; b=fqUNScgesnLybc05nt4hihQfbQEVPk/gVfDFIKICiCoxBkx0uYn08ySxfzYQM7lBLt QevpTx6gdQqgfjuP90QP+X4ol82khu6c8ACAjl6vgmUfzanfd1KNnblMupSFTSW7CtsU IasXaTpB5kesL3dbINRVjnH7MJjdLA1yQQBh/U/lg6TW7aKylC9oz0BK94PQcX5Ituat usDMzKjzuZnSKggGQEtcdOQvfow7QbXDKdWR1YOjDMpmCjyM4ZjlNV7ZXJVzoZAyBWyz TeCdBmLp50TjIMciCOk6nYsq5ii9E4Z5DI6MKQuiII+6HdEQrnMBr5PUcW5XybXComRp rXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710279881; x=1710884681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RSdOpXaG5eyYtOQK8HIj1OSb+RRKm9zsEqtIIKixBPg=; b=TSsK0TBJZ28FeLYZFaeB5ar/3WFKpVLsRx/oA6SmEltwCLm7QW9OqoiXu4gcluy+bT 4ZK8sqx5xhS20o6/n3IK1Y9z6yW60fycUe7UsZzR1hvGEScZjBVL5hDCJFJsfWRsE4KT XQ2Qxu5Ng0Bjj6jPlR7isfNAx6BC4Zt6MVJtMWpowpuhMz7ihueBq3hUmqJW/jhaOgbX Drice79B/fFbbhigW5OVNviH8XFBm4XqPmGD/KHfVUmvb3eSprFVI6w/31P4BXXVaD/L HofB2ZbjlhHVZ/gx6opTgL+UjHbbWjPU54P8lpvHWPVcFIw5yfQgbfgaV5eaWAHMbOG9 ENwQ== X-Forwarded-Encrypted: i=1; AJvYcCWakqMkV2kcOI3bmJnmzyKkzsnGyYiqKK7Rfghq+L9YVnXjZrAf4mCpPPVK5ZQBo8vz7udmDl7NniDe7ft3sxwF1Sxee8zV X-Gm-Message-State: AOJu0YyJppwXyrUBfdmY0jg+5u5BXpS0GOfe7K2yIZT4Q4xIIiol10aJ 1MIu8WUgQObp4IZPiVuJWC7+RjoCA/IPyMJagewHEMOPzuGmrS9Z4DwDzRC/ouU= X-Google-Smtp-Source: AGHT+IEyE7hAxIEltzuiBpQ/u1B4tId9l6LVAuyoHvYl8QxHH1psuFJRa4N+p/CejwhJ97/E83Htrg== X-Received: by 2002:a05:6358:890:b0:17e:8b57:df56 with SMTP id m16-20020a056358089000b0017e8b57df56mr3208554rwj.5.1710279880701; Tue, 12 Mar 2024 14:44:40 -0700 (PDT) Received: from localhost (fwdproxy-prn-025.fbsv.net. [2a03:2880:ff:19::face:b00c]) by smtp.gmail.com with ESMTPSA id i33-20020a635421000000b005d880b41598sm6475388pgb.94.2024.03.12.14.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 14:44:40 -0700 (PDT) From: David Wei To: io-uring@vger.kernel.org, netdev@vger.kernel.org Cc: Jens Axboe , Pavel Begunkov , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Eric Dumazet , Jesper Dangaard Brouer , David Ahern , Mina Almasry Subject: [RFC PATCH v4 07/16] netdev: add XDP_SETUP_ZC_RX command Date: Tue, 12 Mar 2024 14:44:21 -0700 Message-ID: <20240312214430.2923019-8-dw@davidwei.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240312214430.2923019-1-dw@davidwei.uk> References: <20240312214430.2923019-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: David Wei RFC only, not for upstream. This will be replaced with a separate ndo callback or some other mechanism in next patchset revisions. This patch adds a new XDP_SETUP_ZC_RX command that will be used in a later patch to enable or disable ZC RX for a specific RX queue. We are open to suggestions on a better way of doing this. Google's TCP devmem proposal sets up struct netdev_rx_queue which persists across device reset, then expects userspace to use an out-of-band method (e.g. ethtool) to reset the device, thus re-filling a hardware Rx queue. Signed-off-by: David Wei --- include/linux/netdevice.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ac7102118d68..699cce69a5a6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1009,6 +1009,7 @@ enum bpf_netdev_command { BPF_OFFLOAD_MAP_ALLOC, BPF_OFFLOAD_MAP_FREE, XDP_SETUP_XSK_POOL, + XDP_SETUP_ZC_RX, }; struct bpf_prog_offload_ops; @@ -1047,6 +1048,11 @@ struct netdev_bpf { struct xsk_buff_pool *pool; u16 queue_id; } xsk; + /* XDP_SETUP_ZC_RX */ + struct { + struct io_zc_rx_ifq *ifq; + u16 queue_id; + } zc_rx; }; };