From patchwork Tue Oct 31 10:32:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 832326 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yR73q6hSjz9sRg for ; Tue, 31 Oct 2017 21:33:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753308AbdJaKc0 (ORCPT ); Tue, 31 Oct 2017 06:32:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738AbdJaKcZ (ORCPT ); Tue, 31 Oct 2017 06:32:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 104985AFD9; Tue, 31 Oct 2017 10:32:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 104985AFD9 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jasowang@redhat.com Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-23.pek2.redhat.com [10.72.12.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86A0F60317; Tue, 31 Oct 2017 10:32:20 +0000 (UTC) From: Jason Wang To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mst@redhat.com, willemdebruijn.kernel@gmail.com, tom@herbertland.com, Jason Wang Subject: [PATCH net-next V2 0/3] support changing steering policies in tuntap Date: Tue, 31 Oct 2017 18:32:15 +0800 Message-Id: <1509445938-4345-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 31 Oct 2017 10:32:25 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi all: We use flow caches based flow steering policy now. This is good for connection-oriented communication such as TCP but not for the others e.g connectionless unidirectional workload which cares only about pps. This calls the ability of supporting changing steering policies in tuntap which was done by this series. Flow steering policy was abstracted into tun_steering_ops in the first patch. Then new ioctls to set or query current policy were introduced, and the last patch introduces a very simple policy that select txq based on processor id as an example. An example policy was implemented which allows user to load an eBPF to choose the txq. Test was done by using xdp_redirect to redirect traffic generated from MoonGen that was running on a remote machine. And I see 37% improvement for processor id policy compared to automatic flow steering policy. Changes from V1: - drop processor id example, implement an eBPF based queue selection policy instead Jason Wang (3): tun: abstract flow steering logic tun: introduce ioctls to set and get steering policies tun: add eBPF based queue selection method drivers/net/tun.c | 197 ++++++++++++++++++++++++++++++++++++++------ include/uapi/linux/if_tun.h | 9 ++ 2 files changed, 183 insertions(+), 23 deletions(-)