[PATCH net v3] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-20 Thread Eric Garver
skb_vlan_pop() expects skb->protocol to be a valid TPID for double tagged frames. So set skb->protocol to the TPID and let skb_vlan_pop() shift the true ethertype into position for us. Fixes: 5108bbaddc37 ("openvswitch: add processing of L3 packets") Signed-off-by: Eric Garv

Re: [PATCH net v2] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-20 Thread Eric Garver
On Wed, Dec 20, 2017 at 06:41:17PM +0100, Jiri Benc wrote: > On Wed, 20 Dec 2017 10:39:32 -0500, Eric Garver wrote: > > + if (is_flow_key_valid(key) && key->eth.vlan.tci && key->eth.cvlan.tci) > > Maybe (key->eth.vlan.tci & htons(VLAN_TAG_PRESENT))

[PATCH net v2] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-20 Thread Eric Garver
skb_vlan_pop() expects skb->protocol to be a valid TPID for double tagged frames, but skb->protocol is set to the ethertype by key_extract(). So temporarily set it to the TPID when doing a pop_vlan. Fixes: 5108bbaddc37 ("openvswitch: add processing of L3 packets") Signed-off-by

Re: [PATCH net] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-19 Thread Eric Garver
On Tue, Dec 19, 2017 at 03:42:47PM -0500, Eric Garver wrote: > On Tue, Dec 19, 2017 at 08:39:29PM +0100, Jiri Benc wrote: > > On Tue, 19 Dec 2017 13:57:53 -0500, Eric Garver wrote: > > > --- a/net/openvswitch/flow.c > > > +++ b/net/openvswitch/flow.c > > > @@ -

Re: [PATCH net] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-19 Thread Eric Garver
On Tue, Dec 19, 2017 at 08:39:29PM +0100, Jiri Benc wrote: > On Tue, 19 Dec 2017 13:57:53 -0500, Eric Garver wrote: > > --- a/net/openvswitch/flow.c > > +++ b/net/openvswitch/flow.c > > @@ -559,8 +559,9 @@ static int parse_nsh(struct sk_buff *skb, struct

[PATCH net] openvswitch: Fix pop_vlan action for double tagged frames

2017-12-19 Thread Eric Garver
skb_vlan_pop() expects skb->protocol to be a valid TPID for double tagged frames. As such don't override skb->protocol for normal ethernet frames when extracting the key. Fixes: 5108bbaddc37 ("openvswitch: add processing of L3 packets") Signed-off-by: Eric Garver <e..

Re: [PATCH net] geneve: show remote address and checksum info even after link down

2017-11-14 Thread Eric Garver
On Tue, Nov 14, 2017 at 10:39:41AM +0800, Hangbin Liu wrote: > Hi Eric, > > Thanks for the comments. > > On Mon, Nov 13, 2017 at 03:27:25PM -0500, Eric Garver wrote: > > > Fixes: 11387fe4a98 ("geneve: fix fill_info when using collect_metadata") > &g

Re: [PATCH net] geneve: show remote address and checksum info even after link down

2017-11-13 Thread Eric Garver
On Mon, Nov 13, 2017 at 05:03:26PM +0800, Hangbin Liu wrote: > geneve->sock4/6 were added with geneve_open and released with geneve_stop. > So when geneve link down, we will not able to show remote address and > checksum info after commit 11387fe4a98 ("geneve: fix fill_info when using >

Re: [PATCH net-next v15] openvswitch: enable NSH support

2017-11-01 Thread Eric Garver
On Wed, Nov 01, 2017 at 12:03:01PM +0800, Yi Yang wrote: > v14->v15 > - Check size in nsh_hdr_from_nlattr > - Fixed four small issues pointed out By Jiri and Eric Thanks Yi. Acked-by: Eric Garver <e...@erig.me>

Re: [PATCH net-next v14] openvswitch: enable NSH support

2017-10-31 Thread Eric Garver
On Mon, Oct 30, 2017 at 09:29:34AM +0800, Yi Yang wrote: [...] > +int nsh_pop(struct sk_buff *skb) > +{ > + struct nshhdr *nh; > + size_t length; > + __be16 inner_proto; > + > + if (!pskb_may_pull(skb, NSH_BASE_HDR_LEN)) > + return -ENOMEM; > + nh = (struct nshhdr

[PATCH net-next v2] openvswitch: add ct_clear action

2017-10-10 Thread Eric Garver
This adds a ct_clear action for clearing conntrack state. ct_clear is currently implemented in OVS userspace, but is not backed by an action in the kernel datapath. This is useful for flows that may modify a packet tuple after a ct lookup has already occurred. Signed-off-by: Eric Garver &l

Re: [ovs-dev] [PATCH net-next] openvswitch: add ct_clear action

2017-10-10 Thread Eric Garver
On Tue, Oct 10, 2017 at 10:24:20AM -0700, Joe Stringer wrote: > On 10 October 2017 at 08:09, Eric Garver <e...@erig.me> wrote: > > On Tue, Oct 10, 2017 at 05:33:48AM -0700, Joe Stringer wrote: > >> On 9 October 2017 at 21:41, Pravin Shelar <pshe...@ovn.org> wrote: &

Re: [PATCH net-next] openvswitch: add ct_clear action

2017-10-10 Thread Eric Garver
On Tue, Oct 10, 2017 at 05:33:48AM -0700, Joe Stringer wrote: > On 9 October 2017 at 21:41, Pravin Shelar <pshe...@ovn.org> wrote: > > On Fri, Oct 6, 2017 at 9:44 AM, Eric Garver <e...@erig.me> wrote: > >> This adds a ct_clear action for clearing conntrack sta

Re: [PATCH net-next] openvswitch: add ct_clear action

2017-10-10 Thread Eric Garver
On Mon, Oct 09, 2017 at 09:41:53PM -0700, Pravin Shelar wrote: > On Fri, Oct 6, 2017 at 9:44 AM, Eric Garver <e...@erig.me> wrote: > > This adds a ct_clear action for clearing conntrack state. ct_clear is > > currently implemented in OVS userspace, but is not backed by an act

[PATCH net-next] openvswitch: add ct_clear action

2017-10-06 Thread Eric Garver
This adds a ct_clear action for clearing conntrack state. ct_clear is currently implemented in OVS userspace, but is not backed by an action in the kernel datapath. This is useful for flows that may modify a packet tuple after a ct lookup has already occurred. Signed-off-by: Eric Garver &l

Re: [ovs-dev] [PATCH net-next v9] openvswitch: enable NSH support

2017-09-26 Thread Eric Garver
On Tue, Sep 26, 2017 at 01:02:15PM +0800, Yang, Yi wrote: > On Tue, Sep 26, 2017 at 03:28:42AM +0800, Eric Garver wrote: > > On Mon, Sep 25, 2017 at 10:16:09PM +0800, Yi Yang wrote: > > > + > > > + length = nsh_hdr_len(nsh_hdr); > > > + skb_pull(skb, length); &g

Re: [ovs-dev] [PATCH net-next v9] openvswitch: enable NSH support

2017-09-25 Thread Eric Garver
SO patch series > > v5->v6 > - Fix the rest comments for v4. > - Add NSH GSO support for VxLAN-gpe + NSH and >Eth + NSH. > > v4->v5 > - Fix many comments by Jiri Benc and Eric Garver >for v4. > > v3->v4 > - Add new NSH match field ttl >

Re: [PATCH net-next v4] openvswitch: enable NSH support

2017-08-18 Thread Eric Garver
On Fri, Aug 18, 2017 at 03:24:31PM +0800, Yi Yang wrote: > v3->v4 > - Add new NSH match field ttl > - Update NSH header to the latest format >which will be final format and won't change >per its author's confirmation. > - Fix comments for v3. Hi Yi, Only a few comments below since Jiri

Re: [ovs-dev] [PATCH v3] openvswitch: enable NSH support

2017-08-17 Thread Eric Garver
On Thu, Aug 17, 2017 at 07:49:41AM +0800, Yang, Yi wrote: > On Wed, Aug 16, 2017 at 11:15:28PM +0800, Eric Garver wrote: > > On Wed, Aug 16, 2017 at 01:35:30PM +0800, Yi Yang wrote: > > > + > > > +#define NSH_DST_PORT4790 /* UDP Port for NSH on VXLAN.

Re: [PATCH v3] openvswitch: enable NSH support

2017-08-16 Thread Eric Garver
On Wed, Aug 16, 2017 at 01:35:30PM +0800, Yi Yang wrote: > v2->v3 > - Change OVS_KEY_ATTR_NSH to nested key to handle >length-fixed attributes and length-variable >attriubte more flexibly. > - Remove struct ovs_action_push_nsh completely > - Add code to handle nested attribute for

Re: [PATCH net-next v2] openvswitch: enable NSH support

2017-08-14 Thread Eric Garver
On Thu, Aug 10, 2017 at 09:21:15PM +0800, Yi Yang wrote: > OVS master and 2.8 branch has merged NSH userspace > patch series, this patch is to enable NSH support > in kernel data path in order that OVS can support > NSH in 2.8 release in compat mode by porting this. > > Signed-off-by: Yi Yang

[PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata

2017-06-02 Thread Eric Garver
ATA and we mistakenly fall into the IPv4 case. For COLLECT_METADATA, always use the worst case of ipv6 since both sockets are created. Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") Signed-off-by: Eric Garver <e...@erig.me> --- drivers/net/geneve.c | 2 +- 1 file

Re: [PATCH net-next] geneve: fix fill_info when using collect_metadata

2017-05-24 Thread Eric Garver
On Wed, May 24, 2017 at 12:20:36PM -0700, Pravin Shelar wrote: > On Tue, May 23, 2017 at 3:37 PM, Eric Garver <e...@erig.me> wrote: > > Since 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") fill_info > > does not return UDP_ZERO_CSUM6_RX when using COLLEC

[PATCH net-next] geneve: fix fill_info when using collect_metadata

2017-05-23 Thread Eric Garver
the actual sockets. Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") Signed-off-by: Eric Garver <e...@erig.me> --- drivers/net/geneve.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index dec5d56

Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration

2017-05-22 Thread Eric Garver
On Sat, May 20, 2017 at 09:56:44PM -0700, Pravin Shelar wrote: > On Sat, May 20, 2017 at 6:35 AM, Eric Garver <e...@erig.me> wrote: > > On Fri, May 19, 2017 at 06:57:46PM -0700, Pravin Shelar wrote: > >> On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e...@erig

Re: [PATCH net-next] geneve: always fill CSUM6_RX configuration

2017-05-20 Thread Eric Garver
On Fri, May 19, 2017 at 06:57:46PM -0700, Pravin Shelar wrote: > On Thu, May 18, 2017 at 12:59 PM, Eric Garver <e...@erig.me> wrote: > > CSMU6_RX is relevant for collect_metadata as well. As such leave it > > outside of the dev's IPv4/IPv6 checks. > > > Can you exp

[PATCH net-next] geneve: always fill CSUM6_RX configuration

2017-05-18 Thread Eric Garver
CSMU6_RX is relevant for collect_metadata as well. As such leave it outside of the dev's IPv4/IPv6 checks. Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.") Signed-off-by: Eric Garver <e...@erig.me> --- drivers/net/geneve.c | 8 1 file changed, 4 insertions

[PATCH net] udp: inuse checks can quit early for reuseport

2017-01-05 Thread Eric Garver
. With this change it takes 11s. Also add a cond_resched() when the port is not specified. Signed-off-by: Eric Garver <e...@erig.me> --- net/ipv4/udp.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1307a7

Re: [PATCH v3 net-next 2/3] openvswitch: Use is_skb_forwardable() for length check.

2016-12-08 Thread Eric Garver
On Sun, Dec 04, 2016 at 04:22:40PM -0800, Pravin Shelar wrote: > On Fri, Dec 2, 2016 at 1:25 AM, Jiri Benc wrote: > > On Thu, 1 Dec 2016 11:50:00 -0800, Pravin Shelar wrote: > >> This is not changing any behavior compared to current OVS vlan checks. > >> Single vlan header is

Re: [PATCH v3 net] flow_dissector: fix vlan tag handling

2016-10-25 Thread Eric Garver
ears. > > Fixes: 3805a938a6c2 ("flow_dissector: Check skb for VLAN only if skb > specified.") > Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from > skb->vlan_tci") > Signed-off-by: Arnd Bergmann <a...@arndb.de> Acked-by: Eric Garver <e...@erig.me>

Re: [PATCH] flow_dissector: avoid uninitialized variable access

2016-10-22 Thread Eric Garver
On Sat, Oct 22, 2016 at 12:16:29AM +0200, Arnd Bergmann wrote: > On Friday, October 21, 2016 11:05:45 PM CEST Arnd Bergmann wrote: > > > > Can you explain why "dissector_uses_key(flow_dissector, > > FLOW_DISSECTOR_KEY_VLAN) && skb_vlan_tag_present(skb)" implies > > "eth_type_vlan(proto))"? > > >

Re: [PATCH net v2] flow_dissector: Check skb for VLAN only if skb specified.

2016-10-19 Thread Eric Garver
On Wed, Oct 19, 2016 at 11:44:10AM +0300, Amir Vadai wrote: > On Tue, Oct 18, 2016 at 4:59 PM, Or Gerlitz <gerlitz...@gmail.com> wrote: > > On Mon, Oct 17, 2016 at 11:30 PM, Eric Garver <e...@erig.me> wrote: > >> Fixes a panic when calling eth_get_headlen(). Noticed o

[PATCH net v2] flow_dissector: Check skb for VLAN only if skb specified.

2016-10-17 Thread Eric Garver
Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver. Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci") Signed-off-by: Eric Garver <e...@erig.me> --- net/core/flow_dissector.c | 6 ++ 1 file changed, 2 inserti

[PATCH net] flow_dissector: Check skb for VLAN only if skb specified.

2016-10-17 Thread Eric Garver
From: Eric Garver <egar...@redhat.com> Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver. Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci") Signed-off-by: Eric Garver <e...@erig.me> --- net/core/flow_disse

Re: [PATCH net] flow_dissector: Check skb for VLAN only if skb specified.

2016-10-17 Thread Eric Garver
On Mon, Oct 17, 2016 at 04:21:57PM -0400, Eric Garver wrote: > From: Eric Garver <egar...@redhat.com> > > Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver. > > Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from > skb->

Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

2016-10-11 Thread Eric Garver
On Mon, Oct 10, 2016 at 05:02:44PM +0200, Jiri Benc wrote: > The internal device does support 802.1AD offloading since 018c1dda5ff1 > ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink > attributes"). > > Signed-off-by: Jiri Benc <jb...@redhat.co

Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length

2016-10-11 Thread Eric Garver
ctions, vlan > parsing, netlink attributes") > Signed-off-by: Jiri Benc <jb...@redhat.com> Acked-by: Eric Garver <e...@erig.me>

Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement

2016-10-11 Thread Eric Garver
, netlink attributes") > Signed-off-by: Jiri Benc <jb...@redhat.com> Acked-by: Eric Garver <e...@erig.me>

Re: [PATCH net-next v2 1/3] openvswitch: normalize vlan rx path

2016-10-05 Thread Eric Garver
On Wed, Oct 05, 2016 at 09:07:09PM +0200, Jiri Benc wrote: > On Wed, 5 Oct 2016 14:44:26 -0400, Eric Garver wrote: > > On Wed, Oct 05, 2016 at 08:31:52PM +0300, Eyal Birger wrote: > > > Just seemed less future safe to keep a pointer to an old packet lying > > &g

Re: [PATCH net-next v2 1/3] openvswitch: normalize vlan rx path

2016-10-05 Thread Eric Garver
On Wed, Oct 05, 2016 at 08:31:52PM +0300, Eyal Birger wrote: > On Wed, Oct 5, 2016 at 8:23 PM, Jiri Benc wrote: > > On Wed, 5 Oct 2016 17:18:08 +0300, Eyal Birger wrote: > >> I think at this point, 'eth' may point to a freed packet. > > > > It may but how does that matter? eth

Re: [PATCH net-next 1/2] openvswitch: remove nonreachable code in vlan parsing

2016-10-04 Thread Eric Garver
Hi Jiri, On Tue, Oct 04, 2016 at 02:30:01PM +0200, Jiri Benc wrote: > It can never happen that there's a vlan tag in the packet but not in > skb->vlan_tci. This is ensured in __netif_receive_skb_core and honored by > skb_vlan_push and skb_vlan_pop. The code dealing with such case is a dead >

[PATCH net-next v22 0/3] openvswitch: add 802.1ad support

2016-09-07 Thread Eric Garver
- fix if/else dangling assignment in {push,pop}_vlan() - simplify parse_vlan() Eric Garver (2): vlan: Check for vlan ethernet types for 8021.q or 802.1ad openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes Thomas F Herbert (1): openvswitch: 802.1ad uapi

[PATCH net-next v22 3/3] openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes

2016-09-07 Thread Eric Garver
F Herbert's original v20 patch. I made some small clean ups and bug fixes. Signed-off-by: Thomas F Herbert <thomasfherb...@gmail.com> Signed-off-by: Eric Garver <e...@erig.me> --- net/openvswitch/actions.c | 16 ++- net/openvswitch/flow.c | 65 ++--- net/openvs

[PATCH net-next v22 1/3] openvswitch: 802.1ad uapi changes.

2016-09-07 Thread Eric Garver
From: Thomas F Herbert openvswitch: Add support for 8021.AD Change the description of the VLAN tpid field. Signed-off-by: Thomas F Herbert --- include/uapi/linux/openvswitch.h | 17 + 1 file changed, 9 insertions(+), 8

[PATCH net-next v22 2/3] vlan: Check for vlan ethernet types for 8021.q or 802.1ad

2016-09-07 Thread Eric Garver
<thomasfherb...@gmail.com> Signed-off-by: Eric Garver <e...@erig.me> --- include/linux/if_vlan.h | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 49d4aef1f789..3319d97

Re: [ovs-dev] [PATCH net-next v21 3/4] openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes

2016-09-06 Thread Eric Garver
On Sun, Sep 04, 2016 at 01:05:46PM +0200, Jiri Benc wrote: > On Sat, 3 Sep 2016 13:30:12 -0400, Eric Garver wrote: > > Would a BUG_ON(!(encap && in_encap)) be better? > > Please don't crash the kernel for something that could very well > continue without problems. Us

Re: [ovs-dev] [PATCH net-next v21 3/4] openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes

2016-09-03 Thread Eric Garver
Pravin, Thanks for the feedback. Some replies below. Thanks. Eric. On Fri, Sep 02, 2016 at 02:42:30PM -0700, pravin shelar wrote: > On Thu, Sep 1, 2016 at 1:45 PM, Eric Garver <e...@erig.me> wrote: > > Add support for 802.1ad including the ability to push and pop double > &

Re: [ovs-dev] [PATCH net-next v21 4/4] openvswitch: report error on VLAN nlattr in ovs_key_from_nlattrs()

2016-09-03 Thread Eric Garver
On Fri, Sep 02, 2016 at 02:42:41PM -0700, pravin shelar wrote: > On Thu, Sep 1, 2016 at 1:45 PM, Eric Garver <e...@erig.me> wrote: > > With 802.1ad support these are parsed and set upfront by > > parse_vlan_from_nlattrs() before ovs_key_from_nlattrs() is ever called. > &

[PATCH net-next v21 4/4] openvswitch: report error on VLAN nlattr in ovs_key_from_nlattrs()

2016-09-01 Thread Eric Garver
With 802.1ad support these are parsed and set upfront by parse_vlan_from_nlattrs() before ovs_key_from_nlattrs() is ever called. As such we should never see a VLAN attribute in ovs_key_from_nlattrs(). Signed-off-by: Eric Garver <e...@erig.me> --- net/openvswitch/flow_netlink.

[PATCH net-next v21 2/4] vlan: Check for vlan ethernet types for 8021.q or 802.1ad

2016-09-01 Thread Eric Garver
<thomasfherb...@gmail.com> Signed-off-by: Eric Garver <e...@erig.me> --- include/linux/if_vlan.h | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 49d4aef1f789..3319d97

[PATCH net-next v21 3/4] openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes

2016-09-01 Thread Eric Garver
F Herbert's original v20 patch. I made some small clean ups and bug fixes. Signed-off-by: Thomas F Herbert <thomasfherb...@gmail.com> Signed-off-by: Eric Garver <e...@erig.me> --- net/openvswitch/actions.c | 16 +-- net/openvswitch/flow.c | 64 net/openvs

[PATCH net-next v21 0/4] openvswitch: add 802.1ad support

2016-09-01 Thread Eric Garver
. This patch series has been tested using the most recent version of userspace (v3) and tests (v2). v21 changes: - Fix (and simplify) netlink attribute parsing - re-add handling of truncated VLAN tags - fix if/else dangling assignment in {push,pop}_vlan() - simplify parse_vlan() Eric

[PATCH net-next v21 1/4] openvswitch: 802.1ad uapi changes.

2016-09-01 Thread Eric Garver
From: Thomas F Herbert openvswitch: Add support for 8021.AD Change the description of the VLAN tpid field. Signed-off-by: Thomas F Herbert --- include/uapi/linux/openvswitch.h | 17 + 1 file changed, 9 insertions(+), 8

[PATCH] Documentation: ip-sysctl.txt: clarify secure_redirects

2016-05-26 Thread Eric Garver
Clarify how secure_redirects works. Mention that RFC1122 always applies. Signed-off-by: Eric Garver <e...@erig.me> --- Documentation/networking/ip-sysctl.txt | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/ip-sysctl.txt b/Documen