Message ID | 20190320144944.147862-1-willemdebruijn.kernel@gmail.com |
---|---|
Headers | show
Return-Path: <netdev-owner@vger.kernel.org> X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@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=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oOklLKiB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44PXrc6KkFz9sNf for <patchwork-incoming-netdev@ozlabs.org>; Thu, 21 Mar 2019 01:49:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728030AbfCTOtv (ORCPT <rfc822;patchwork-incoming-netdev@ozlabs.org>); Wed, 20 Mar 2019 10:49:51 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:44767 "EHLO mail-qk1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfCTOtu (ORCPT <rfc822;netdev@vger.kernel.org>); Wed, 20 Mar 2019 10:49:50 -0400 Received: by mail-qk1-f181.google.com with SMTP id m65so6661209qkl.11 for <netdev@vger.kernel.org>; Wed, 20 Mar 2019 07:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WBU/WK6DOVAmBQClf3jJjAy17XsTGy5hYEnD4iAar7U=; b=oOklLKiBlm5vQVpOmyk9dygtPsk6LHkpZiCtcp8DkSZKsFFJnrj7IjGBSjDC20H7C1 zH3uZD2/lDAwHXnlezMguxqN55Bz0mjJRwnjYmdPpQA1WoSz2Wk1Cp1EBuVwWQt/jdwn hSrOCzyy4C2pBz1Y/xPshBzqvwILiJy/1cdZSm/Si2wlqlZ9wLVSTN5Bp7sfMSKoTPg4 1aQC4yozATayLfDE0NWss7TfgpFL7PRtiSfEJNOwnflyOEWf8YPCSCoRWnJzS+ltvczN kPPnWrKoWsoEAKrBuqIiW9PMgOMhi2t/uFi3+AJdiKmBDOqynagTPXVNWb3it1ViMeH4 jNMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WBU/WK6DOVAmBQClf3jJjAy17XsTGy5hYEnD4iAar7U=; b=rKTZEVEdZlwnTZjmWGFrmIfodRiz67Nqd5yuX2j6FDUjc3bCJCqWTRWjDoEsUoqKNj ZF5B0vGwr29Hs+rPpTNc38s/sCGuHhwMYTMkpmDAtk14778XvT9xbLU9dYX65OvzdjXp 8glJhlNqhrhH1Fj+5cKQGHUnrEYvfBkNI5oRJD/UEHDVj9wYiOrxv+QPUy0EzxCqBZB+ gqhxdxPQ02RiKe/ZFg3S11Jz8FMOGdJAo6HC+U8BoqeXJQCcmYNIh4AnQtjCmI/N81PW 1nN8Nzhs3LgYuHMvq20nHqFkl9HjaEtLyB42+xjv+cgZiWRn07VT++QSGLC4R6yhqk4D aTjg== X-Gm-Message-State: APjAAAWiMzH2T3oxLtHP1Xzfb7NTKBvCwGSZ0YzDk9Ow7kK6LTM6fSO4 d2PZKCzaWCFhXAlY8NXOiG/OkqAf X-Google-Smtp-Source: APXvYqxVdqMy2TTGZGPqH5SUS0hIqp1DnOZV2rt8dd+OymcVyuIxJ7J/PN7I2jHyvoCOn8maRBV/yw== X-Received: by 2002:a37:c094:: with SMTP id v20mr7020837qkv.14.1553093389261; Wed, 20 Mar 2019 07:49:49 -0700 (PDT) Received: from willemb1.nyc.corp.google.com ([2620:0:1003:315:3fa1:a34c:1128:1d39]) by smtp.gmail.com with ESMTPSA id x201sm1142257qkb.92.2019.03.20.07.49.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 07:49:48 -0700 (PDT) From: Willem de Bruijn <willemdebruijn.kernel@gmail.com> To: netdev@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, sdf@google.com, posk@google.com, Willem de Bruijn <willemb@google.com> Subject: [PATCH bpf-next 00/13] bpf tc tunneling Date: Wed, 20 Mar 2019 10:49:31 -0400 Message-Id: <20190320144944.147862-1-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
bpf tc tunneling
|
expand
|
From: Willem de Bruijn <willemb@google.com> BPF allows for dynamic tunneling, choosing the tunnel destination and features on-demand. Extend bpf_skb_adjust_room to allow for efficient tunneling at the TC hooks. Patch 1 is a performance optimization, avoiding an unnecessary unclone for the TCP hot path. Patches 2..6 introduce a regression test. These can be squashed, but the code is arguably more readable when gradually expanding the feature set. Patch 7 is a performance optimization, avoid copying network headers that are going to be overwritten. This also simplifies the bpf program. Patch 8 reenables bpf_skb_adjust_room for UDP packets. Patch 9 add support for gso packets, which require additional metadata set in the skb. It does this through new flags to bpf_skb_adjust_room. other alternatives considered: - individual bpf_{ipip, gre, udp, ..}_encap functions that combine adjust room and bpf_skb_store_bytes. - new bpf_encap_fixup function called after bpf_skb_adjust_room and bpf_skb_store_bytes that parses the tunnel and sets the metadata. Patches 10..13 expand the regression test to make use of the new features and enable the GSO testcases. these could be interleaved with each of the new features, were it not for the separate sync bpf.h patch. Willem de Bruijn (13): bpf: in bpf_skb_adjust_room avoid copy in tx fast path selftests/bpf: bpf tunnel encap test selftests/bpf: expand bpf tunnel test with decap selftests/bpf: expand bpf tunnel test to ipv6 selftests/bpf: extend bpf tunnel test with gre selftests/bpf: extend bpf tunnel test with tso bpf: add bpf_skb_adjust_room mode BPF_ADJ_ROOM_MAC bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_FIXED_GSO bpf: add bpf_skb_adjust_room encap flags bpf: Sync bpf.h to tools selftests/bpf: convert bpf tunnel test to BPF_ADJ_ROOM_MAC selftests/bpf: convert bpf tunnel test to BPF_F_ADJ_ROOM_FIXED_GSO selftests/bpf: convert bpf tunnel test to encap modes include/uapi/linux/bpf.h | 22 +- net/core/filter.c | 124 +++++++-- tools/include/uapi/linux/bpf.h | 22 +- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/config | 2 + .../selftests/bpf/progs/test_tc_tunnel.c | 261 ++++++++++++++++++ tools/testing/selftests/bpf/test_tc_tunnel.sh | 178 ++++++++++++ 7 files changed, 580 insertions(+), 32 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_tc_tunnel.c create mode 100755 tools/testing/selftests/bpf/test_tc_tunnel.sh