Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2653717imm; Sun, 12 Aug 2018 20:25:00 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwOU/DvTnbNvUpZkiDhTSpkaCXpL6dkWICpHl6cfCl3jATbv+YfzNbvbz1RnrD+kbK5GJAI X-Received: by 2002:a63:ff4d:: with SMTP id s13-v6mr15429205pgk.150.1534130699933; Sun, 12 Aug 2018 20:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534130699; cv=none; d=google.com; s=arc-20160816; b=NoSBFac2s8lF24L+htV7nQGsTNGiKhDibiqUxBO0DCTcw2X4vgkyj3XHuJs0SnrCiw irxB2srkgxPbWvqhTAlw9WLS7nwo+LFGAmD9sfGnen77iTSX3RZZNF/omkpRlSYhsbLb 8n/orBpPHEplJA85w+RlUqM87cuvN6XV32HUnOQKVH4uZi78577LRy4hSBpzECkpQcUl +QrC2AFMxQbWQM2ucEYd4dfxVSucqsxmOR/gr01+U02G0Sn3OBom71IYvFheCxtUYGBI 0ncndBIiETLFyza2Xavq9w7vAdukcqxdJL7x1Lgb2XRHYh9uIsPPNUDR7AqrbeqAAYa0 dpbg== 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=XoBC2HYUBS4WG3UNwlOz2G/wVsKYFjKMIoBiktVFJF8=; b=XHVRtKJSYZBdADZAO7mpOO1m40zPORrP76Ho/ySN5gIP+TkvwVZzs9l06VzBMGpr1D fApo75e3lJTJflVNTYsJVMEaRRoYGsHGvGQqjVRxHYUgTGAtHds4F6GrdVprlJlhgRSY HKjb0SfZ1ITThagmrcFOob7JazqqxsR0TPlBHfaWWgjakHbEZ8fIOMdkTuvOkdlDaKv1 +/+8pHp7GLmK4RgRbiWNKP6WFbwvAiboPMEGzF9xxrpd7BmlminnC+iDaMuJB8nNcFy2 KwYnK/3j6yF2T22XSZjUUk/SSbU7/Vc5sDiJDmRB5cy1lClgHGp+uxwBjGfbQu5+XJi2 0q5g== 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 87-v6si17547833pfi.60.2018.08.12.20.24.44; Sun, 12 Aug 2018 20:24:59 -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 S1727966AbeHMF5v (ORCPT + 99 others); Mon, 13 Aug 2018 01:57:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726037AbeHMF5v (ORCPT ); Mon, 13 Aug 2018 01:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0083E401B3A9; Mon, 13 Aug 2018 03:17:36 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-183.pek2.redhat.com [10.72.12.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id E77552156712; Mon, 13 Aug 2018 03:17:32 +0000 (UTC) From: Jason Wang To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, jbrouer@redhat.com, mst@redhat.com, Jason Wang Subject: [RFC PATCH net-next V2 0/6] XDP rx handler Date: Mon, 13 Aug 2018 11:17:24 +0800 Message-Id: <1534130250-5302-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 13 Aug 2018 03:17:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 13 Aug 2018 03:17:36 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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: This series tries to implement XDP support for rx hanlder. This would be useful for doing native XDP on stacked device like macvlan, bridge or even bond. The idea is simple, let stacked device register a XDP rx handler. And when driver return XDP_PASS, it will call a new helper xdp_do_pass() which will try to pass XDP buff to XDP rx handler directly. XDP rx handler may then decide how to proceed, it could consume the buff, ask driver to drop the packet or ask the driver to fallback to normal skb path. A sample XDP rx handler was implemented for macvlan. And virtio-net (mergeable buffer case) was converted to call xdp_do_pass() as an example. For ease comparision, generic XDP support for rx handler was also implemented. Compared to skb mode XDP on macvlan, native XDP on macvlan (XDP_DROP) shows about 83% improvement. Please review. Thanks Jason Wang (6): net: core: factor out generic XDP check and process routine net: core: generic XDP support for stacked device net: core: introduce XDP rx handler macvlan: count the number of vlan in source mode macvlan: basic XDP support virtio-net: support XDP rx handler drivers/net/macvlan.c | 189 +++++++++++++++++++++++++++++++++++++++++++-- drivers/net/virtio_net.c | 11 +++ include/linux/filter.h | 1 + include/linux/if_macvlan.h | 1 + include/linux/netdevice.h | 12 +++ net/core/dev.c | 69 +++++++++++++---- net/core/filter.c | 28 +++++++ 7 files changed, 293 insertions(+), 18 deletions(-) -- 2.7.4