Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2518575rbb; Wed, 28 Feb 2024 04:36:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWbinOjJG59TY3itvijsQW93En7sMJ06kMrp/BXxA+BknwwcSLS6IUfmGPn38CutNkP5bs4Jvdr/K7GtRKt8QKzoCYX2myAjzdDtXkCEg== X-Google-Smtp-Source: AGHT+IHgyNcfQF7RI1pbFuulaeSqhlKrIp8HgW2ndq+nX25bse1xVEHqPTbbzzYbIe9qyXOO/z+i X-Received: by 2002:a05:620a:568b:b0:787:e475:55dd with SMTP id wg11-20020a05620a568b00b00787e47555ddmr3133662qkn.27.1709123800053; Wed, 28 Feb 2024 04:36:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709123800; cv=pass; d=google.com; s=arc-20160816; b=fuxDqXZ0npjkiWnYqoUD+wm1nhDMk4/G0lGZREriO4k8AeyPJFpPXKjBkLv8q9zPFE OQWB3mqQBOtXCZZlpVY+FCzJCG2Jj+XetG7E0xfLTAZH1o8wp7rhWEKpLyo9NIYWQ0bp H17XDZYZg6xVW0fIRvWzavtIwky3kuZMA6Wjzx6JceYkkJ4dO6r2+M8QmuP7agZDFAXB QTr3phG7QdOnXdCe+gWJW3eP+aexV6ggFwxfocSH53FpUIjU21PQNuW/rA93otqLpm54 Zcxd7283HFFRo93L4RvlvhMIK93cezJwtwiCZk9PulZKR/qYSR3bR/kwSj2dkkl8260q WhTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1r218cPQs+vQGXk5W8TMf0lKe2Qttm/rc570dURd+N8=; fh=lYAnY68fn7C27AzoIIHvGmJ9WziBdOsZKweOm3s9Us4=; b=o6cuVgQ8O33pLQMWaS2f/qM1MVZSXgl/OYiwfsPL5h1iLUJAR5X7D0bwepbYrylBTo Zd7Hnh6CTLqAv6JpyTlTKfEGRdSHSkiGiFbOfgpaG5TSm1q2XgoEtTWjnEKLcfNY2zZD iYlLdDLXG7bhEiqY4R93HryvQcQPhSpBSmlF0sqHFeCpKAh5A4JL04tNrW37laeJ/3Li G5icYHLf7JDuW16L8fhljt53/DQL2/ydtU7dBKlmF9NrKLJicgmln9Q9MMvuQ4waZxI7 3NyMADgdlAlnOHXtYDJr7bPbgXQ1jUp+aS4sIWcltDVWbMndRu23M8xH9S3UylED1m8K nxFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=bvKkZ+ZL; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85023-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g9-20020a05620a40c900b00787f6204b6esi199550qko.541.2024.02.28.04.36.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 04:36:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85023-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=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=bvKkZ+ZL; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-85023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85023-linux.lists.archive=gmail.com@vger.kernel.org" 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 7E4701C21E1A for ; Wed, 28 Feb 2024 12:36:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9500E1487D8; Wed, 28 Feb 2024 12:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="bvKkZ+ZL" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 21F6A145B27 for ; Wed, 28 Feb 2024 12:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709123786; cv=none; b=qTsK0bB4OPNBaDYhRfyvx+4Bn6hed9NOr3y1hD5CgWfX7Q2SoQRJcfDU8dAZ+oU9pS8JyyMRiFGSLAX35uTakEKKvjmjWw+RtxJhQzhkk71fXm6Ry9jKZxp4G2gfPMykweSnhaO/QIgYEzLiO2iTG34PbSogaG+nD/owfrvyjnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709123786; c=relaxed/simple; bh=JV34Rsk9Ud6TAluSh/NNnx0sR4WyEiQcLsdy9DEB4qs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LsZlxh0UNc1txqNdKOxmwaQzmTM0u4cnUcZOyjy/vGuFy6g80x2BAbiSGwUZ5MigxvKkyJJGReOXIRrcOFE2rR/YTyEd4+CGjerByf805XjMOoNPYNyaxLUH++3YA7CUjIIQB6kQ/+G033enAkNPbjAMYnc30VKmyyBooR/O9Ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b=bvKkZ+ZL; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d27184197cso68364591fa.1 for ; Wed, 28 Feb 2024 04:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1709123783; x=1709728583; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1r218cPQs+vQGXk5W8TMf0lKe2Qttm/rc570dURd+N8=; b=bvKkZ+ZLtHNPsb7dGhSPQXPayePNh+6Lmt/DHG7HRPB3V9c7Ppzh+a3Ho/q1fuQrVM t9J0NO+bVlMs4wQnKdeckyUIShPMuieGay2SK5BhALFXOyFFB2qQ4A6ArQRP/Xt4jY2u bPBxtTIIJDTofbyZjsmVqk05oVSgOVEALDrtGi2XQlrJl0r44lAE1x4hQ077h0Ojxkou pq8OeAjQZJkHFmU2x6PR/Ct0QTi8HA1aK4U8EPyPIx3h8sqOJuS2c1yyqPStDZtySXwT cf+6V3bevYEdhAzWW1i4nslTOm/IT9XJrPueyQmgOT4hIcW45KxL89D6SfJS2Vau3wZA T6Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709123783; x=1709728583; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1r218cPQs+vQGXk5W8TMf0lKe2Qttm/rc570dURd+N8=; b=XUayUOMn7Fr5GhkzrxenAInsX7l4sK4wfuNb3P76gxEnA85eHyO3VliF2vyXpo5V0Z JtxL1TmRFwZzpu2xaKIblQArpc+RXw4nEw/gXsbjNdKf6mbetQPU3Qr5j0NA9eT5Je19 5Gcnlib5CY1rAqi+Hzo+Xyf+ygoi7fikRqGwrCPDhz/IVCLwbeBTX27zt+upDRdcSuS6 59CFYfxLGc0wIVZBgg4SAaFyr3nAV4lzd3fWps3j0GhyufE6BTLFqVfgmO88NNnlDlBd oomGSgGVicxp02sBeUy0d3yMKhqiYPS2LOn0Ycnl12LGOETrb9V52nI740YgbiU8zJNJ hwqw== X-Forwarded-Encrypted: i=1; AJvYcCWQ8I+ZllIpDSAkRj63TnGTfXreiPwlkU4PX4knAWXLBMZoNZvDrv8TPwJknxIJEBDkeR9hgR9EwkfCifYiMp6iLJzfc610Gq/Vx144 X-Gm-Message-State: AOJu0YxIKekhzRObnKugZHp+x4DKxqSZYwmnONhwppa20KiP1oSYCyQC G+nyyIdcNEBvOos2T/dYQlkPbcol5Gsa/8GVa8q64GkxIyOg9wvCkqZ4jqlZ8/8= X-Received: by 2002:a2e:99d5:0:b0:2d0:b758:93a5 with SMTP id l21-20020a2e99d5000000b002d0b75893a5mr7831033ljj.18.1709123783116; Wed, 28 Feb 2024 04:36:23 -0800 (PST) Received: from localhost ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id 9-20020a05600c230900b004129018510esm1949803wmo.22.2024.02.28.04.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 04:36:22 -0800 (PST) Date: Wed, 28 Feb 2024 13:36:19 +0100 From: Jiri Pirko To: Yunjian Wang Cc: mst@redhat.com, willemdebruijn.kernel@gmail.com, jasowang@redhat.com, kuba@kernel.org, bjorn@kernel.org, magnus.karlsson@intel.com, maciej.fijalkowski@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 Subject: Re: [PATCH net-next v2 0/3] tun: AF_XDP Tx zero-copy support Message-ID: References: <1709118281-125508-1-git-send-email-wangyunjian@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1709118281-125508-1-git-send-email-wangyunjian@huawei.com> Wed, Feb 28, 2024 at 12:04:41PM CET, wangyunjian@huawei.com wrote: >Hi all: > >Now, some drivers support the zero-copy feature of AF_XDP sockets, >which can significantly reduce CPU utilization for XDP programs. > >This patch set allows TUN to also support the AF_XDP Tx zero-copy >feature. It is based on Linux 6.8.0+(openEuler 23.09) and has >successfully passed Netperf and Netserver stress testing with >multiple streams between VM A and VM B, using AF_XDP and OVS. > >The performance testing was performed on a Intel E5-2620 2.40GHz >machine. Traffic were generated/send through TUN(testpmd txonly >with AF_XDP) to VM (testpmd rxonly in guest). > >+------+---------+---------+---------+ >| | copy |zero-copy| speedup | >+------+---------+---------+---------+ >| UDP | Mpps | Mpps | % | >| 64 | 2.5 | 4.0 | 60% | >| 512 | 2.1 | 3.6 | 71% | >| 1024 | 1.9 | 3.3 | 73% | >+------+---------+---------+---------+ > >Yunjian Wang (3): > xsk: Remove non-zero 'dma_page' check in xp_assign_dev > vhost_net: Call peek_len when using xdp > tun: AF_XDP Tx zero-copy support Threading of the patchset seems to be broken. Did you by any chance send this with "--nothread" git-send-email option? pw seems to cope fine with this though. > > drivers/net/tun.c | 177 ++++++++++++++++++++++++++++++++++++++-- > drivers/vhost/net.c | 21 +++-- > include/linux/if_tun.h | 32 ++++++++ > net/xdp/xsk_buff_pool.c | 7 -- > 4 files changed, 220 insertions(+), 17 deletions(-) > >-- >2.41.0 > >