Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3426887pxm; Mon, 28 Feb 2022 20:20:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjG1w1+e9GSYq5pgY5ZwXkZXR20fFwM1XYsIE8QYqQJObmhnqPowW1MjmieHmMW6gsL3UB X-Received: by 2002:a17:906:1e06:b0:6ce:70af:ce6d with SMTP id g6-20020a1709061e0600b006ce70afce6dmr17868412ejj.571.1646108458295; Mon, 28 Feb 2022 20:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646108458; cv=none; d=google.com; s=arc-20160816; b=dbuf8R5J0IB3veZPoH6Qdp2PsFOT2oAg3FU45ROXSuRxncTxuIshHYi6np6SLSdYgb F8q5scolF7CiTk8LiP3GMBn66rnQUcUtT9WcXB0EQC+LCxTWAscQyk2cfrwePDfjLqxu dsm91OwuK6c4YkdgHgKOhETt84K/hLJ+5m+vFPN65RygLZCcE+TboMXTQ2C4AHWf5uaF n2G3legJdhX9kOOZxXII8n/WONsst877aPzIyylnDjFxwtuSntZcQpP//7rMzBRnd8Y9 03rfWau0rglVdJIy0o260/BWyF2oTueAliw7ty9B50tO1ITvHuscDdtJu/H6Tw5vkvK7 YT+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=luuUiMnqhEGGpxdu/95KFzZYsnUnE9Pq8uUGjugbrlY=; b=j0uXNwxvr6Hja64zU5lG4e9E1rqBCKFAaWB+4kEhrrZbTQeX5Ei0RL7CCAWVUtdE+1 GIA11LobX0ZZqyYGOWqd5NT3PsMQ/kGgp5HkJ6k4GqVZRGKpFCfgd6L0ULx5BxKfXR+i +6d6bzs2mnlUMrrZFNdrGGUkhHRk/vHCv/8mmJ1wnIEiBNUhyhsW4bMHst7G9VoLNbkt 7meagdZIID/ze+drsmWknvif1sLpMRuyCioLyM2USa7T3LMdvDtr9mLsNLC1CiXZoPfg 4OFXP/El3MYtr0tnhJT/qtz+DTfu1mliMPhnJb9ocZSb1UUhTB5HMfs4QCtvbO0dSu3B fbyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BUYu3uoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id zc19-20020a170906989300b006d0334f2a15si7014983ejb.209.2022.02.28.20.20.36; Mon, 28 Feb 2022 20:20:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BUYu3uoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbiCABsZ (ORCPT + 99 others); Mon, 28 Feb 2022 20:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbiCABsY (ORCPT ); Mon, 28 Feb 2022 20:48:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3B0011A2B for ; Mon, 28 Feb 2022 17:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646099262; 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: in-reply-to:in-reply-to:references:references; bh=luuUiMnqhEGGpxdu/95KFzZYsnUnE9Pq8uUGjugbrlY=; b=BUYu3uoHJT7hzqWzqywIDHjyGpod0vNeja7MYerL52/SBFk0ttPzK0k2o+w4J7AdPqWJ86 6AZiC4Q8zcrutpGLfxcN+mKkWCN66j6gFiKO8PkFuorv6QzyKxpMlxOgDAk9sJi5gZKtzj 23cwjAMdVkgg5GzDAOZ8LZ4HFb+xkbI= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-R_KWCpx1O2CFzeX0Jejmjg-1; Mon, 28 Feb 2022 20:47:41 -0500 X-MC-Unique: R_KWCpx1O2CFzeX0Jejmjg-1 Received: by mail-lj1-f199.google.com with SMTP id b27-20020a2ebc1b000000b00246209c497dso6561986ljf.11 for ; Mon, 28 Feb 2022 17:47:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=luuUiMnqhEGGpxdu/95KFzZYsnUnE9Pq8uUGjugbrlY=; b=XhkTtKTcGSIBtzQC8MccnmMUDVWAl3I2UG40sAGbzgU5Fm2FXMKV/gKHJONUHSroCW QaXdXKHd1x3w/VC2wLsCaMQBPLfyjg/IlcOtt1D4ROD2aIh+JE8eFHiasbMym4NvLbsM zwahVLXdNGbxD0E3lOAB2Yxfe6boj+Ihbj8WT9UAzZ73tjqwdmrKojm7lwcsPkI60svN 35IpikcK4tU841KlGEj7Mpl3l8dFGb1P97IN+qUTuVC4NVpdsdfKl7U/m4zDMBtp0hSa SPKzmno0Dy8GVhBRnI/Wb0rHRztBUpqw1pA8bDR0QXQdR2TKnVat3Y9AlYs+AWe/zu5n I1fQ== X-Gm-Message-State: AOAM532QoK472GTBbzD8o10ACDIF3Lk7rN0kXfkql/1LYhA9j8Gy1+B2 oneOYX2T28Wo1BVm6nswvylymh8GPrAqI3nfoVWj+cxKXVGRh2JzSgHV7FLze0rtQ2WolqifbVD L3J/TIaB63MQw44SAbeQyBV2AM0zaqHZj2A/w7iMr X-Received: by 2002:a05:651c:90b:b0:244:c4a4:d5d8 with SMTP id e11-20020a05651c090b00b00244c4a4d5d8mr15365306ljq.97.1646099259986; Mon, 28 Feb 2022 17:47:39 -0800 (PST) X-Received: by 2002:a05:651c:90b:b0:244:c4a4:d5d8 with SMTP id e11-20020a05651c090b00b00244c4a4d5d8mr15365294ljq.97.1646099259773; Mon, 28 Feb 2022 17:47:39 -0800 (PST) MIME-Version: 1.0 References: <20220224103852.311369-1-baymaxhuang@gmail.com> <20220228033805.1579435-1-baymaxhuang@gmail.com> <20220228091539.057c80ef@hermes.local> In-Reply-To: <20220228091539.057c80ef@hermes.local> From: Jason Wang Date: Tue, 1 Mar 2022 09:47:28 +0800 Message-ID: Subject: Re: [PATCH net-next v3] tun: support NAPI for packets received from batched XDP buffs To: Stephen Hemminger Cc: Harold Huang , netdev , Paolo Abeni , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , open list , "open list:XDP (eXpress Data Path)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 1, 2022 at 1:15 AM Stephen Hemminger wrote: > > On Mon, 28 Feb 2022 15:46:56 +0800 > Jason Wang wrote: > > > On Mon, Feb 28, 2022 at 11:38 AM Harold Huang wrote: > > > > > > In tun, NAPI is supported and we can also use NAPI in the path of > > > batched XDP buffs to accelerate packet processing. What is more, after > > > we use NAPI, GRO is also supported. The iperf shows that the throughput of > > > single stream could be improved from 4.5Gbps to 9.2Gbps. Additionally, 9.2 > > > Gbps nearly reachs the line speed of the phy nic and there is still about > > > 15% idle cpu core remaining on the vhost thread. > > > > > > Test topology: > > > [iperf server]<--->tap<--->dpdk testpmd<--->phy nic<--->[iperf client] > > > > > > Iperf stream: > > > iperf3 -c 10.0.0.2 -i 1 -t 10 > > > > > > Before: > > > ... > > > [ 5] 5.00-6.00 sec 558 MBytes 4.68 Gbits/sec 0 1.50 MBytes > > > [ 5] 6.00-7.00 sec 556 MBytes 4.67 Gbits/sec 1 1.35 MBytes > > > [ 5] 7.00-8.00 sec 556 MBytes 4.67 Gbits/sec 2 1.18 MBytes > > > [ 5] 8.00-9.00 sec 559 MBytes 4.69 Gbits/sec 0 1.48 MBytes > > > [ 5] 9.00-10.00 sec 556 MBytes 4.67 Gbits/sec 1 1.33 MBytes > > > - - - - - - - - - - - - - - - - - - - - - - - - - > > > [ ID] Interval Transfer Bitrate Retr > > > [ 5] 0.00-10.00 sec 5.39 GBytes 4.63 Gbits/sec 72 sender > > > [ 5] 0.00-10.04 sec 5.39 GBytes 4.61 Gbits/sec receiver > > > > > > After: > > > ... > > > [ 5] 5.00-6.00 sec 1.07 GBytes 9.19 Gbits/sec 0 1.55 MBytes > > > [ 5] 6.00-7.00 sec 1.08 GBytes 9.30 Gbits/sec 0 1.63 MBytes > > > [ 5] 7.00-8.00 sec 1.08 GBytes 9.25 Gbits/sec 0 1.72 MBytes > > > [ 5] 8.00-9.00 sec 1.08 GBytes 9.25 Gbits/sec 77 1.31 MBytes > > > [ 5] 9.00-10.00 sec 1.08 GBytes 9.24 Gbits/sec 0 1.48 MBytes > > > - - - - - - - - - - - - - - - - - - - - - - - - - > > > [ ID] Interval Transfer Bitrate Retr > > > [ 5] 0.00-10.00 sec 10.8 GBytes 9.28 Gbits/sec 166 sender > > > [ 5] 0.00-10.04 sec 10.8 GBytes 9.24 Gbits/sec receiver > > > > > > Reported-at: https://lore.kernel.org/all/CACGkMEvTLG0Ayg+TtbN4q4pPW-ycgCCs3sC3-TF8cuRTf7Pp1A@mail.gmail.com > > > Signed-off-by: Harold Huang > > > > Acked-by: Jason Wang > > Would this help when using sendmmsg and recvmmsg on the TAP device? We haven't exported the socket object of tuntap to userspace. So we can't use sendmmsg()/recvmsg() now. > Asking because interested in speeding up another use of TAP device, and wondering > if this would help. > Yes, it would be interesting. We need someone to work on that. Thanks