Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp59201imm; Mon, 21 May 2018 02:10:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZovqnOicLQRTaxO9SwADoKx+JQzV3BLp721D0LkZtiPj1NgjNiK/vqQYMvDOwdVxspBdCxi X-Received: by 2002:a17:902:bb93:: with SMTP id m19-v6mr19400055pls.74.1526893816665; Mon, 21 May 2018 02:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526893816; cv=none; d=google.com; s=arc-20160816; b=MOjd/IXMd3xxGoWDvLmXRuf+/2XxHED6Fo2mWq6xfV6seehi6MhaOmi34a1jEphLpb uj5B9yvdjaEvZ3KxHxwtYcvoq6t1ctTFg41sFoeWgI7YzIFmRQgjT0ohm6GphyhZTqhR /irTKip3nLiUkkS3uSocqz75EtXsntUJWwAZW4qK9yi/b0BYpZx18ZWYHF0ack+mHxex Po9RC8rdBoCoziiwT6tOaL2u2+FCGCbvzsj/4W3V8tfTe3cVMkfpd++Hv89f2oDfasRT uOq8BdhkNqy52RKoZtdvPdI3Ir7DJwzSKs/98e9kwWd5klxgFVG/zbb6PVqeFYAm1kQl rSkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YroEEjyvLq5JGxHmCQLcHKaC/46vCFWv91NpWghnvdk=; b=jPQ1s3dO2acYyk2BiQzsak0ObvOpT4KZyIsmdwnBDUkdg09K7HYqNypvbZr/AmR83r zOeIWrR4JKbrZJgy671rrzgl/t5MFkjBlDBuj9kmXIf1BO4pbLMeTUHlzIS7wkVN5OoS U/h2CHqWhIKrF7GppddcCSA7dP1+6Y9slbbYpYaaL++238e61UpaOMcRRAX06r8YU9Fa QhctpyCVaGgqPd3pt49Uw5XNuwVa7RY4Xtu4MgLyDY20eaCDuha35hIqv92esULiG8W3 yd7Anykj7PwusB8KyekKr7LUAD/HDZWuu9uEjTMdXdstYxOxD0k0p41KL7M0RrHOXVBZ ft2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4-v6si10806607pgc.223.2018.05.21.02.10.02; Mon, 21 May 2018 02:10:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751633AbeEUJEp (ORCPT + 99 others); Mon, 21 May 2018 05:04:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46316 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750922AbeEUJEl (ORCPT ); Mon, 21 May 2018 05:04:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70A8540122A0; Mon, 21 May 2018 09:04:41 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0E7D4AF1; Mon, 21 May 2018 09:04:35 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 00/12] XDP batching for TUN/vhost_net Date: Mon, 21 May 2018 17:04:21 +0800 Message-Id: <1526893473-20128-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 21 May 2018 09:04:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 21 May 2018 09:04:41 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all: We do not support XDP batching for TUN since it can only receive one packet a time from vhost_net. This series tries to remove this limitation by: - introduce a TUN specific msg_control that can hold a pointer to an array of XDP buffs - try copy and build XDP buff in vhost_net - store XDP buffs in an array and submit them once for every N packets from vhost_net - since TUN can only do native XDP for datacopy packet, to simplify the logic, split datacopy out logic and only do batching for datacopy. With this series, TX PPS can improve about 34% from 2.9Mpps to 3.9Mpps when doing xdp_redirect_map between TAP and ixgbe. Thanks Jason Wang (12): vhost_net: introduce helper to initialize tx iov iter vhost_net: introduce vhost_exceeds_weight() vhost_net: introduce vhost_has_more_pkts() vhost_net: split out datacopy logic vhost_net: batch update used ring for datacopy TX tuntap: enable premmption early tuntap: simplify error handling in tun_build_skb() tuntap: tweak on the path of non-xdp case in tun_build_skb() tuntap: split out XDP logic vhost_net: build xdp buff vhost_net: passing raw xdp buff to tun vhost_net: batch submitting XDP buffers to underlayer sockets drivers/net/tun.c | 226 +++++++++++++++++++++++++++---------- drivers/vhost/net.c | 297 ++++++++++++++++++++++++++++++++++++++++++++----- include/linux/if_tun.h | 7 ++ 3 files changed, 444 insertions(+), 86 deletions(-) -- 2.7.4