From patchwork Thu Sep 28 21:46:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 819757 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=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quantonium-net.20150623.gappssmtp.com header.i=@quantonium-net.20150623.gappssmtp.com header.b="PevDwBax"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y37Zd3KCTz9sP1 for ; Fri, 29 Sep 2017 07:47:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751495AbdI1VrT (ORCPT ); Thu, 28 Sep 2017 17:47:19 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:46803 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbdI1VrS (ORCPT ); Thu, 28 Sep 2017 17:47:18 -0400 Received: by mail-pg0-f54.google.com with SMTP id v3so1644438pgv.3 for ; Thu, 28 Sep 2017 14:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantonium-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Q+Qumjx4ETdzJCHzjZv69EAB3c6x0UsdW9FemcY7dI8=; b=PevDwBaxW8TjEytD9UCxxaCovTWoqRFdHgWkDNP/zIpmd/moQPFpWEJVdekJ7MSoid 9UR6Fd5r0HjEvxN7pd6uxKJxDyTWVmsJXAnrvkwtpe1bdj2U1CY8jgYtpTfdn+fSVPE/ HGko8jjVCOMHIYYBUnwcjqJ6ESEi59mqpg9SMMkAZks/OX61iHDVJFkPs9yzcIOH38Qb 3s7pkPF8+FJybiCaLDNd8INV93HORTkLL6Kq+k/Ab0EVJ8MyBMZUvKPhMOEHVHiosuQn q8bdKnIl8RD3Pif1QOQOn5TMtxstA6Jupcq0x1XdVOdy38MV8unX3NeVsv5znarPOCXY +8Iw== 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; bh=Q+Qumjx4ETdzJCHzjZv69EAB3c6x0UsdW9FemcY7dI8=; b=taZud7PhAMr80yAMrUSOgIT0EgTKD/vCljJd1fcfYHOgYgfGP7+GoI6uZdJX+HbZyp wQT8XiuScFL/SkFQNZO+FJb//RIJljYEtmo9cMTHPir1GJcUeVpuG2vysxsrpSta++0U OMcs52S/W2qLJzcWhGNsrm2qwwTevtimO+LSr3n3okSWleqbsg8TEleSzOgSnRLzQiiA 8UfMjqCIk1V6q7q2ga9bf2+oz9GFnWQHjhIpojDyH5VsvkHOd7eVBGOsf5FaShDTKX83 v8/gEFnFvPFiQvMzvq/ZStt4UoemcFgpswRUpgMD6GuA0BadguPFVkAtvNXbAWVvd8qT 6KwA== X-Gm-Message-State: AHPjjUiurxbqXeA2kcBa9ZQmPFe/hdD751vFwEwGmH2/Olw1w+5jVppT RwDPW6W3lA2n4UYFsnWpkAeOMevP X-Google-Smtp-Source: AOwi7QBrv/nrBcDACDveH2bNuAbgut6QkOwHJR6CENh8FzT252C8yZIRfzAV8VxIDhqhXa7BTlnlgg== X-Received: by 10.98.80.200 with SMTP id g69mr5404579pfj.325.1506635237561; Thu, 28 Sep 2017 14:47:17 -0700 (PDT) Received: from localhost.localdomain (67-207-98-108.static.wiline.com. [67.207.98.108]) by smtp.gmail.com with ESMTPSA id b1sm4380364pgn.94.2017.09.28.14.47.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Sep 2017 14:47:16 -0700 (PDT) From: Tom Herbert To: davem@davemloft.net Cc: netdev@vger.kernel.org, rohit@quantonium.net, Tom Herbert Subject: [PATCH v3 net-next 0/8] flow_dissector: Protocol specific flow dissector offload Date: Thu, 28 Sep 2017 14:46:53 -0700 Message-Id: <20170928214701.31458-1-tom@quantonium.net> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch set adds a new offload type to perform flow dissection for specific protocols (either by EtherType or by IP protocol). This is primary useful to crack open UDP encapsulations (like VXLAN, GUE) for the purposes of parsing the encapsulated packet. Items in this patch set: - Create new protocol case in __skb_dissect for ETH_P_TEB. This is based on the code in the GRE dissect function and the special handling in GRE can now be removed (it sets protocol to ETH_P_TEB and returns so goto proto_again is done) - Add infrastructure for protocol specific flow dissection offload - Add infrastructure to perform UDP flow dissection. Uses same model of GRO where a flow_dissect callback can be associated with a UDP socket - Use the infrastructure to support flow dissection of VXLAN and GUE Tested: Forced RPS to call flow dissection for VXLAN, FOU, and GUE. Observed that inner packet was being properly dissected. v2: Add signed off v3: - Make skb argument of flow dissector to be non const - Change UDP GRO to only do something if encap_needed static key is set - don't reference inet6_offloads or inet_offloads, get to them through ptype Tom Herbert (8): flow_dissector: Change skbuf argument to be non const flow_dissector: Move ETH_P_TEB processing to main switch udp: Check static key udp_encap_needed in udp_gro_receive flow_dissector: Add protocol specific flow dissection offload ip: Add callbacks to flow dissection by IP protocol udp: flow dissector offload fou: Support flow dissection vxlan: support flow dissect drivers/net/vxlan.c | 40 +++++++++++++++++++++++++ include/linux/netdevice.h | 27 +++++++++++++++++ include/linux/skbuff.h | 12 ++++---- include/linux/udp.h | 8 +++++ include/net/flow_dissector.h | 1 + include/net/ip_fib.h | 4 +-- include/net/route.h | 4 +-- include/net/udp.h | 10 +++++++ include/net/udp_tunnel.h | 8 +++++ net/core/dev.c | 65 ++++++++++++++++++++++++++++++++++++++++ net/core/flow_dissector.c | 71 +++++++++++++++++++++++++++----------------- net/ipv4/af_inet.c | 27 +++++++++++++++++ net/ipv4/fib_semantics.c | 2 +- net/ipv4/fou.c | 63 +++++++++++++++++++++++++++++++++++++++ net/ipv4/route.c | 10 ++++--- net/ipv4/udp.c | 4 ++- net/ipv4/udp_offload.c | 55 ++++++++++++++++++++++++++++++++++ net/ipv4/udp_tunnel.c | 1 + net/ipv6/ip6_offload.c | 27 +++++++++++++++++ net/ipv6/udp_offload.c | 23 ++++++++++++++ net/sched/sch_sfq.c | 2 +- 21 files changed, 419 insertions(+), 45 deletions(-)