From patchwork Fri Dec 11 08:23:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 555589 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 1FE0A1402D9 for ; Fri, 11 Dec 2015 19:24:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b=z92ZOHk3; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E9C2C22C3DB; Fri, 11 Dec 2015 00:24:11 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 16EEB22C3C0 for ; Fri, 11 Dec 2015 00:24:11 -0800 (PST) Received: from bar3.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 1ECF7162152 for ; Fri, 11 Dec 2015 01:24:10 -0700 (MST) X-ASG-Debug-ID: 1449822248-03dd7b04df04fb0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id QKeOdpNy33rCR1hd (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Dec 2015 01:24:08 -0700 (MST) X-Barracuda-Envelope-From: simon.horman@netronome.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pf0-f169.google.com) (209.85.192.169) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 11 Dec 2015 08:24:03 -0000 Received-SPF: none (mx3-pf2.cudamail.com: domain at netronome.com does not designate permitted sender hosts) X-Barracuda-RBL-Trusted-Forwarder: 209.85.192.169 Received: by pfbu66 with SMTP id u66so18858893pfb.3 for ; Fri, 11 Dec 2015 00:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/H6UA8dFBAd/Vj26H6m++juubUZFtT7la1RC3ohvwTs=; b=z92ZOHk3dfo1wywfihAAdwBQ5i83aV1edvSj45HzJ/EAfAD4cQdJ067TSdunPmU/r2 shhZpCqLRtz66mGwD5Ul1ycrlNqYNKdIAvlQWtPP0Dvhp/Jn84Jd+90n/JG/PGmdVxZv gy47N+LAKZvI2PzC9riPRGsmypeRh5Q3EwiG5p5ysIyXrQRjDV7AAHnJpt9zkKA9Ioe3 wOO3wzdgg0s1c/Y4o/fHJZQOTBQBLNqdO1nApiMKgQtbORt4dKuNLw2ptsR/TRMu+skI Xh2B8IKcXrbaPIzzAhUVlHdPu7/ciNWfpOFq3Tlun+x1Y4fLU9MX/6Eqlzn/4sGrCoI2 4l4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=/H6UA8dFBAd/Vj26H6m++juubUZFtT7la1RC3ohvwTs=; b=OIjY2Ec3Zr7MXtg7QewYXP0rzUHN34uX4kOCQBYlo0uMNoQQ/muw9F/yMJm+d5ffQv FFXHfvmXXHlIekgCH/dI/8y+zoOMsJv8BI9l7NyszLfj9VBH8z44jfTUPCX649xuUQKi 53y31xXmCXzNhxpUzcaVUotJo0vM4gYL42Gt4W0j0WX+Bna5XIZDkB1XwAU7OK1bNORt CkwwcEtDkW0SIBl42z0rsjxIxYLS3O5ve3bq/5gtctC8KDkkMXJGRHJYNbiEA24EHLyn ZftnAfWz8tRbEiHdoK34SfN2Hi3h5aT2bjlg8rm6ntk28JCbjiRJ293NkjppyVvX84GC Bd9A== X-Gm-Message-State: ALoCoQnMiO2JpTaoJCOqGaSpqHH2eC88Ip8TiDHXJtDdmZRMq9Al2c07jEvBxMZsLz3wLKcI2Q0sO5GHLO2z/zIjm5BOPzVf7w== X-Received: by 10.98.66.80 with SMTP id p77mr13408675pfa.100.1449822242694; Fri, 11 Dec 2015 00:24:02 -0800 (PST) Received: from vergenet.net (reginn.isobedori.kobe.vergenet.net. [2001:470:4832:303:d63d:7eff:fe99:ac9d]) by smtp.gmail.com with ESMTPSA id 1sm23281597pfo.72.2015.12.11.00.23.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Dec 2015 00:24:01 -0800 (PST) Date: Fri, 11 Dec 2015 17:23:54 +0900 X-Barracuda-Apparent-Source-IP: 2001:470:4832:303:d63d:7eff:fe99:ac9d X-CudaMail-Envelope-Sender: simon.horman@netronome.com From: Simon Horman To: Joe Stringer X-CudaMail-MID: CM-V2-1210001043 X-CudaMail-DTE: 121115 X-CudaMail-Originating-IP: 209.85.192.169 Message-ID: <20151211082350.GA14773@vergenet.net> X-ASG-Orig-Subj: [##CM-V2-1210001043##]Re: [ovs-dev] [PATCHv2 14/20] datapath: Add conntrack action References: <1449129236-5038-1-git-send-email-joe@ovn.org> <1449129236-5038-15-git-send-email-joe@ovn.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1449129236-5038-15-git-send-email-joe@ovn.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-GBUdb-Analysis: 0, 209.85.192.169, Ugly c=0.387593 p=-0.302326 Source Normal X-MessageSniffer-Rules: 0-0-0-9421-c X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1449822248 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.25161 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS Cc: dev@openvswitch.org, Justin Pettit Subject: Re: [ovs-dev] [PATCHv2 14/20] datapath: Add conntrack action X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" Hi Joe, On Wed, Dec 02, 2015 at 11:53:50PM -0800, Joe Stringer wrote: [snip] > diff --git a/datapath/actions.c b/datapath/actions.c > index 0397bfe3dba4..0625d7e01176 100644 > --- a/datapath/actions.c > +++ b/datapath/actions.c [snip] > @@ -37,6 +39,7 @@ > #include > > #include "datapath.h" > +#include "conntrack.h" > #include "gso.h" > #include "vlan.h" > #include "vport.h" > @@ -53,6 +56,20 @@ struct deferred_action { > struct sw_flow_key pkt_key; > }; > > +#define MAX_L2_LEN (VLAN_ETH_HLEN + 3 * MPLS_HLEN) > +struct ovs_frag_data { > + unsigned long dst; > + struct vport *vport; > + struct ovs_skb_cb cb; > + __be16 inner_protocol; > + __u16 vlan_tci; > + __be16 vlan_proto; > + unsigned int l2_len; > + u8 l2_data[MAX_L2_LEN]; > +}; > + > +static DEFINE_PER_CPU(struct ovs_frag_data, ovs_frag_data_storage); > + > #define DEFERRED_ACTION_FIFO_SIZE 10 > struct action_fifo { > int head; > @@ -606,14 +623,157 @@ static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key, > return 0; > } > > -static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port) > +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,0) [snip] > +static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, > + __be16 ethertype) > +{ > + if (skb_network_offset(skb) > MAX_L2_LEN) { > + OVS_NLERR(1, "L2 header too long to fragment"); > + return; > + } > + > + if (ethertype == htons(ETH_P_IP)) { > + struct dst_entry ovs_dst; > + unsigned long orig_dst; > + > + prepare_frag(vport, skb); > + dst_init(&ovs_dst, &ovs_dst_ops, NULL, 1, > + DST_OBSOLETE_NONE, DST_NOCOUNT); > + ovs_dst.dev = vport->dev; > + > + orig_dst = (unsigned long) skb_dst(skb); > + skb_dst_set_noref(skb, &ovs_dst); > + IPCB(skb)->frag_max_size = mru; > + > + ip_do_fragment(skb->sk, skb, ovs_vport_output); It seems that this code is compiled for kernel versions > 3.9 but that a backport of ip_do_fragment is only provided for kernels >= 3.10. I'm unsure of the intention but perhaps the code above should not be compiled for when building against 3.9. With the following building succeeds against v3.9.11. diff --git a/datapath/actions.c b/datapath/actions.c index 0f1f4bc06ba1..ffa97e3e0231 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -68,7 +68,7 @@ struct ovs_frag_data { u8 l2_data[MAX_L2_LEN]; }; -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) static DEFINE_PER_CPU(struct ovs_frag_data, ovs_frag_data_storage); #endif @@ -625,7 +625,7 @@ static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key, return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) static int ovs_vport_output(OVS_VPORT_OUTPUT_PARAMS) { struct ovs_frag_data *data = get_pcpu_ptr(ovs_frag_data_storage); @@ -740,7 +740,7 @@ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, err: kfree_skb(skb); } -#else /* <= 3.9 */ +#else /* < 3.10 */ static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru, __be16 ethertype) {