Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp867022lqs; Tue, 5 Mar 2024 21:34:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUWLhAv2BiDpxHRyc4YMeshQONrw92IFCjEvBz1J1CPIqG0qPajz9sAE16PiCqgj6YRfaL38uRFReZGsoEYMENWJTkZ0Air4hP8UCt4VQ== X-Google-Smtp-Source: AGHT+IGak0SdclKQLG0XhSOECOoGPIbK0yjwW+MUL7VcXDeSH9UdiLMLAiOFrBZVePwthhBf8+je X-Received: by 2002:a05:6870:970e:b0:220:932f:1a19 with SMTP id n14-20020a056870970e00b00220932f1a19mr4218423oaq.55.1709703240702; Tue, 05 Mar 2024 21:34:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709703240; cv=pass; d=google.com; s=arc-20160816; b=w5LaGlKXimXbiRuhWy7b8oyxZYkI7bWmGmR8KqSjxHT/ghnfs/rkDVgqb+pMzsy7r3 7c5xUjE7q9t0TIeTSReAL0X+RkhLxWaJ4Kb898jkZcJar4PMLnjvaFJk2G8ITLkXivX8 CcGfBWsmDrkH/uh5g8WaF8oNSPLTW1s+WQrP1YbF0XARN4+iMptLdePzHp8gGZdWTBXQ rqByLa3CXsD59qih7bT730+1uCNKOqUvLnGFm4rYRHwa4yLbJ4awh6n8M/bYiDPcujS/ DusMhjWjrU9R3oOgUO6vsuZFNsEI9Rs6sYHSa8JTTCAbh74bQ6Cbt4mneVISbYqfQJFQ UJPA== 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=TU6enkAGhxLVo9zYShsbcBwAQaBFKNnqNn+vF6qWndE=; fh=PxVY38i0yJ1QQkD3GGPZNBSDzRJcyPLwYeQ87Ia6RDw=; b=eZEHUrEOYRvlwTjd9GPQvxdlx8LA66SugCMfp0GkDvLnsx9RmmLgvP3h7Ql8rd6mWF /VLiWftd5+Q6zsXsO8RBNo2PFWV6unmF9J/7lDDqiN/IE5p/rg2VbZ2WbDcELirUZRof zn30R+d2ef7zmMjg/NdUjSw6BVZmL53E2WhzgYPcDzq+yANkwCg2/o9s9qMN3cKsZjpj ZIQpfGiIQiICclc/rjXRVQ1hfWtXhKayPTM5NMMBcIpY/qbA3ZmsShxYMbQzGBLuDOy6 SB0xllWrRvQfnWzTIzDg9ydBZL5+W5Mx90hK92472fvknUUsY4a3iRP7KPifilQ98Csr ncvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T1dv+Wcd; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-93352-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93352-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 ca6-20020a056a02068600b005e0b2316f6esi11717821pgb.433.2024.03.05.21.34.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 21:34:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93352-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=@redhat.com header.s=mimecast20190719 header.b=T1dv+Wcd; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-93352-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93352-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 21B67289528 for ; Wed, 6 Mar 2024 05:32:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED87E1BC5C; Wed, 6 Mar 2024 05:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T1dv+Wcd" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFFC017BCB for ; Wed, 6 Mar 2024 05:32:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709703151; cv=none; b=lnt6tz0BmVjCxjXRIu42hcM69Te3rP1gENQhkOiDQZa/P6dwvtoX0MUrSaU8wgMWEOmiRiVPqOWJy9a+ar+bgVfC3ZcUrzJ4/RGBX9+KhlSZwHBjboYGgKwO1giRyQ3Bd+uN3tpWZDQIJ7vaY2Ef/czQyZHpO22+fWF0nrFjmIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709703151; c=relaxed/simple; bh=TU6enkAGhxLVo9zYShsbcBwAQaBFKNnqNn+vF6qWndE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jH/dk5vtIcI8WpTKz8JUxP0lpr9uiSXunjK/kr6xskLEyjF5c9zhABO25oZaJGGdlvG/yJIFPdffeiaHEETueD2boZ8Udjv6FZlWCWUsv7b92CPyLTx+htyGOMRHfNwAHfVCY8NbunEXuiNUeLgyBibeGD1J5lZtwtdLwKY8zU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=T1dv+Wcd; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709703148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TU6enkAGhxLVo9zYShsbcBwAQaBFKNnqNn+vF6qWndE=; b=T1dv+WcdWYKcByo0uJmYOsN4AmmTeXH7YGC3F0ki0PFx+Xc3mpEfRwAe8jSvTCqcrjWw7i dbPZy9vfhwAvHSvIp3hfYcNxVHpvgeUrQCOKMSbagSyzvkKPHQd5qB/9COAHF8/hRlViXP hNuXvaH39HUOZQ/MUIeoYJWT+hlGUJ0= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-184-tvT8lnjkPou6DBZFCM8xsw-1; Wed, 06 Mar 2024 00:32:27 -0500 X-MC-Unique: tvT8lnjkPou6DBZFCM8xsw-1 Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-1dccd2efdbfso64222325ad.2 for ; Tue, 05 Mar 2024 21:32:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709703146; x=1710307946; 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=TU6enkAGhxLVo9zYShsbcBwAQaBFKNnqNn+vF6qWndE=; b=J7mMIzE0XSxZK0e2DoeL3z0DhTDVxRbAp3qdLrtl9S5tx9WIzU51ppcdP5QCg6EpK/ oxLcSQwemCfdkIUQ3dQN8xDgZG+GjUPRdjv3or4vazq8maxALrmOeHOn1U+vCypFYRbV OWzxfF4Nas1kGjwJ+VEkkOTx1k116ifbQKJyhh8Cxvad7nUXIdWtGNJJmZoxbIh9jG+5 YCP97+yk9ihNeO7NyqMoQnNe4v4w7zlO7LAL3xPb8lKEq4NGV1B2PvdhWjFsK9CgFv1x A23mmkMpoPeCHHKagCDtbdNZyvwKIz0ZY/cdLMjsQpC4BKiucWgs/YHqIF2rtDhpQqcj ShSg== X-Forwarded-Encrypted: i=1; AJvYcCW4PYfbQlALsDDTItsuzvArN77BiypWtLzHIHSbZ3NDiTYPpKXdIFOrnz8/SGXD4YCDz610fntPuZvFG5utCWhcJVltxFuKkoCJytsE X-Gm-Message-State: AOJu0YzkU9l0QihpZpG9ESBFhAy+ZBUYhycBFsyM9tb32nSsgrU8rbqO hP7ZMyuiweTPWG/fqp7z3z0He1WecMHNMKUOgug7UexOfv11LgcP6tzyFM3zvpjpjQcdavr7THo 3RKJhWfY17QQEKkTzecITO5Lc17uYJa1/f4Lkw3Y6oJNqviHMW5WMl7ByWPaOrPLCbrJhaZt4pO OrfcCYd6knFMrSBAWfGHHQlzxW6HgxgLh4lH8u X-Received: by 2002:a17:90a:d24f:b0:29a:e097:50be with SMTP id o15-20020a17090ad24f00b0029ae09750bemr11686563pjw.31.1709703146440; Tue, 05 Mar 2024 21:32:26 -0800 (PST) X-Received: by 2002:a17:90a:d24f:b0:29a:e097:50be with SMTP id o15-20020a17090ad24f00b0029ae09750bemr11686548pjw.31.1709703146152; Tue, 05 Mar 2024 21:32:26 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1709118356-133960-1-git-send-email-wangyunjian@huawei.com> <65e2212e66769_158220294f@willemb.c.googlers.com.notmuch> In-Reply-To: <65e2212e66769_158220294f@willemb.c.googlers.com.notmuch> From: Jason Wang Date: Wed, 6 Mar 2024 13:32:14 +0800 Message-ID: Subject: Re: [PATCH net-next v2 3/3] tun: AF_XDP Tx zero-copy support To: Willem de Bruijn Cc: Maciej Fijalkowski , Yunjian Wang , mst@redhat.com, kuba@kernel.org, bjorn@kernel.org, magnus.karlsson@intel.com, jonathan.lemon@gmail.com, davem@davemloft.net, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev, xudingke@huawei.com, liwei395@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Mar 2, 2024 at 2:40=E2=80=AFAM Willem de Bruijn wrote: > > Maciej Fijalkowski wrote: > > On Wed, Feb 28, 2024 at 07:05:56PM +0800, Yunjian Wang wrote: > > > This patch set allows TUN to support the AF_XDP Tx zero-copy feature, > > > which can significantly reduce CPU utilization for XDP programs. > > > > Why no Rx ZC support though? What will happen if I try rxdrop xdpsock > > against tun with this patch? You clearly allow for that. > > This is AF_XDP receive zerocopy, right? > > The naming is always confusing with tun, but even though from a tun > PoV this happens on ndo_start_xmit, it is the AF_XDP equivalent to > tun_put_user. > > So the implementation is more like other device's Rx ZC. > > I would have preferred that name, but I think Jason asked for this > and given tun's weird status, there is something bo said for either. > From the the view of the AF_XDP userspace program, it's the TX path, and as you said it happens on the TUN xmit path as well. When using with a VM, it's the RX path. So TX seems better. Thanks