From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 948A4A0353 for ; Thu, 24 Feb 2022 05:40:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68AF44114D; Thu, 24 Feb 2022 05:40:00 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A8F2140E5A for ; Thu, 24 Feb 2022 05:39:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645677599; 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=Am46PTmy5kMN2mfTXjYSgc6DjUyFNTOSNwyB1OrzwSE=; b=EiV6xSGVF0P55INAZRa2SBS+GJjrgGBZu01R7odrE1MurmG36QSMN1BruycEjf2h/3rslG YykawEPOrJ5yQAQHoNuPW8OiclUbvtqe9CsIPC3GpAOx+4ArflrjLsCLSWFW6SD/Ofcvkn 4aznlQovH2pm0kMAREhX7lfv7tXw994= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-225--OMh6Up2Prm0GkCcTzh9cQ-1; Wed, 23 Feb 2022 23:39:58 -0500 X-MC-Unique: -OMh6Up2Prm0GkCcTzh9cQ-1 Received: by mail-lf1-f70.google.com with SMTP id m18-20020a0565120a9200b004439214844dso89274lfu.9 for ; Wed, 23 Feb 2022 20:39:57 -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:content-transfer-encoding; bh=Am46PTmy5kMN2mfTXjYSgc6DjUyFNTOSNwyB1OrzwSE=; b=Ef8CpCzzyi3+TtK0lEcW7zaQU7j3eWjmeMw8B4ZWXkdV54kSRrFNNMJ1+goMEfF5dG 8cQNVH4cKOWJxOb6HkhI3V9Hq7btzHtma35cPir+Fkjtxm0Y+DvwG1+UKro1+IsSLz/x 7N1ZqJLG/62ZJCwz6g1TxdiwoElg8BCXsNQT2aID5ScuNf2dRIKkFfe5XuRei6QX3ptZ SbTMOe26zSMnWIPwmY/AClPmxCCxvx2GJVVlAVPK+QkagC/VvAccR9c6v/0zf5x5AmE/ uiOeyXjtNVUfS2f9pYNSGw7DzPbtSM5FtBDhj1J5ZL38olJnJWlLT6l9f/LfMHIt/0Mc 2+Iw== X-Gm-Message-State: AOAM530LZkBsIvyw5ju8FWPJf3O1ct5Smg9zKaDsTtP2d2j4sOcmkdkA DQ5yOjjsrxL6ljdvW+JD0vQioug2MPPa22JIN8NRS7pjuhvdpnjWae/ydWqJBNa5ObY7T3R0wPo Mo4MhQIcHKIB4c82yr2/vwQ== X-Received: by 2002:a05:6512:3d08:b0:43f:8f45:d670 with SMTP id d8-20020a0565123d0800b0043f8f45d670mr695854lfv.587.1645677596299; Wed, 23 Feb 2022 20:39:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO3Gfx4nBQ0YNhzLMSiTyrx/rVkAKNhMF9Czk833KtuEnohiO8qOAxsHFguLu++WRIgmo8EFwvzD+xKACdP4U= X-Received: by 2002:a05:6512:3d08:b0:43f:8f45:d670 with SMTP id d8-20020a0565123d0800b0043f8f45d670mr695848lfv.587.1645677596053; Wed, 23 Feb 2022 20:39:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jason Wang Date: Thu, 24 Feb 2022 12:39:44 +0800 Message-ID: Subject: Re: Question about the sndbuf of the tap interface with vhost-net To: Harold Huang Cc: users@dpdk.org, Maxime Coquelin , Chenbo Xia , netdev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Thu, Feb 24, 2022 at 12:19 PM Harold Huang wrote= : > > Thanks for Jason's comments. > > Jason Wang =E4=BA=8E2022=E5=B9=B42=E6=9C=8824=E6=97= =A5=E5=91=A8=E5=9B=9B 11:23=E5=86=99=E9=81=93=EF=BC=9A > > > > Adding netdev. > > > > On Wed, Feb 23, 2022 at 9:46 PM Harold Huang wr= ote: > > > > > > Sorry. The performance tested by iperf is degraded from 4.5 Gbps to > > > 750Mbps per flow. > > > > > > Harold Huang =E4=BA=8E2022=E5=B9=B42=E6=9C=88= 23=E6=97=A5=E5=91=A8=E4=B8=89 21:13=E5=86=99=E9=81=93=EF=BC=9A > > > > > > > > I see in dpdk virtio-user driver, the TUNSETSNDBUF is initialized w= ith > > > > INT_MAX, see: https://github.com/DPDK/dpdk/blob/main/drivers/net/vi= rtio/virtio_user/vhost_kernel_tap.c#L169 > > > > Note that Linux use INT_MAX as default sndbuf for tuntap. > > > > > > It is ok because tap driver uses it to support tx baching, see this > > > > patch: https://github.com/torvalds/linux/commit/0a0be13b8fe2cac11da= 2063fb03f0f39359b3069 > > > > > > > > But in tun_xdp_one, napi is not supported and I want to user napi i= n > > > > tun_get_user to enable gro. > > > > NAPI is not enabled in this path, want to send a patch to do that? > > Yes, I have a patch in this path to enable NAPI and it greatly > improves TCP stream performance, from 4.5Gbsp to 9.2 Gbps per flow. I > will send it later for comments. Good to know that. Have you compared it with non-NAPI mode? > > > > > Btw, NAPI mode is used for kernel networking stack hardening at start, > > but it would be interesting to see if it helps for the performance. > > > > > > As I result, I change the sndbuf to a > > > > value such as 212992 in /proc/sys/net/core/wmem_default. > > > > Can you describe your setup in detail? Where did you run the iperf > > server and client and where did you change the wmem_default? > > I use dpdk-testpmd to test the vhost-net performance, such as: > dpdk-testpmd -l 0-9 -n 4 > --vdev=3Dvirtio_user0,path=3D/dev/vhost-net,queue_size=3D1024,mac=3D00:00= :0a:00:00:02 > -a 0000:06:00.1 -- -i --txd=3D1024 --rxd=3D1024 > > And I have changed the sndbuf in > https://github.com/DPDK/dpdk/blob/main/drivers/net/virtio/virtio_user/vho= st_kernel_tap.c#L169 > to 212992, which is not INT_MAX anymore. I also enable NAPI in the tun > module. The iperf server ran in the tap interface on the kernel side, > which would receive TCP stream from dpdk-testpmd. You're do TCP stream testing among two TAP and using tesmpd to forward traf= fic? > But the performance > is greatly degraded, from 4.5 Gbps to 750Mbps. I am confused about > the perf result of the cpu core where iperf server ran, which has a > serious bottleneck: 59.86% cpu on the report_bug and 20.66% on the > module_find_bug. This looks odd, you may want to check your perf, I don't think module_find_bug() will run at datapath. >I use centos 8.2 with a native 4.18.0-193.el8.x86_64 > kernel to test. The kernel is kind of too old, I suggest to test recent kernel version. Thanks > > > > > > > But the > > > > performance tested by iperf is greatly degraded, from 4.5 Gbps to > > > > 750Gbps per flow. I see the the iperf server consume 100% cpu core, > > > > which should be the bottleneck of the this test. The perf top resul= t > > > > of iperf server cpu core is as follows: > > > > > > > > ''' > > > > Samples: 72 of event 'cycles', 4000 Hz, Event count (approx.): > > > > 22685278 lost: 0/0 drop: 0/0 > > > > Overhead Shared O Symbol > > > > 59.86% [kernel] [k] report_bug > > > > 20.66% [kernel] [k] module_find_bug > > > > 6.51% [kernel] [k] common_interrupt > > > > 2.82% [kernel] [k] __slab_free > > > > 1.48% [kernel] [k] copy_user_enhanced_fast_string > > > > 1.44% [kernel] [k] __skb_datagram_iter > > > > 1.42% [kernel] [k] notifier_call_chain > > > > 1.41% [kernel] [k] irq_work_run_list > > > > 1.41% [kernel] [k] update_irq_load_avg > > > > 1.41% [kernel] [k] task_tick_fair > > > > 1.41% [kernel] [k] cmp_ex_search > > > > 0.16% [kernel] [k] __ghes_peek_estatus.isra.12 > > > > 0.02% [kernel] [k] acpi_os_read_memory > > > > 0.00% [kernel] [k] native_apic_mem_write > > > > ''' > > > > I am not clear about the test result. Can we change the sndbuf size= in > > > > dpdk? Is any way to enable vhost_net to use napi without changing t= he > > > > tun kernel driver? > > > > You can do this by not using INT_MAX as sndbuf. > > Just mentioned above, I change the sndbuf value and I met a serious > performance degradation. > > > > > Thanks > > > > > > > >