Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-27 Thread Louis Peens
On Fri, Jun 14, 2019 at 6:01 PM Eli Britstein  wrote:

>
> On 6/14/2019 5:40 PM, Louis Peens wrote:
>
>
>
> On Wed, Jun 12, 2019 at 11:53 AM Eli Britstein  wrote:
>
>>
>> On 6/11/2019 2:21 PM, Ilya Maximets wrote:
>> >> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman > netronome.com
>> 
>> >
>> >> wrote:
>> >>
>> >>> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
>>  Sorry Eli,
>> 
>>  I had missed this but I have it now.
>> 
>>  On Fri, 31 May 2019 at 09:35, Eli Britstein 
>> wrote:
>> 
>> > Ping
>> > --
>> > *From:* Eli Britstein 
>> > *Sent:* Tuesday, May 21, 2019 3:11:51 PM
>> > *To:* dev at openvswitch.org
>> ;
>> Simon Horman
>> > *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
>> > *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
>> >>> tags
>> > The logic by which a TC rule has a VLAN match is by the VLAN TCI
>> field,
>> > either the VID, PCP or CFI are non-zero. For priority-tag packets
>> > there is a VLAN tag header with a zero VLAN TCI. Match on existence
>> of
>> > VLAN header (TPID) regardless of TCI matching.
>> >
>> > Signed-off-by: Eli Britstein 
>> > Reviewed-by: Roi Dayan 
>> >>> Thanks this seems to be a nice enhancement, applied to master.
>> >>>
>> >> Hey
>> >>
>> >> During some internal testing we found that this patch broke some
>> >> set-L4 cases when using tc-offloads. Setting up a simple bridge and
>> >> flow rule looking something like this:
>> >>
>> >>ovs-vsctl show:
>> >>  Bridge "br0"
>> >>  Port "br0"
>> >>  Interface "br0"
>> >>  type: internal
>> >>  Port "veth0r"
>> >>  Interface "veth0r"
>> >>  Port "veth1r"
>> >>  Interface "veth1r"
>> >>
>> >>ovs-ofctl add-flow br0
>> cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
>> >>  actions=set_field:4002-\>tcp_dst,output:veth1r
>> >>
>> >> and then sending VLAN tagged traffic leads to packets not egressing the
>> >> port.
>> >>
>> >> The TC rule that gets installed looks like this:
>> >>vlan_ethtype ip
>> > There must be no vlan_ethertype match just because there was no such
>> field match
>> > in the original flow.
>> >
>> > Looking at the code I see that it checks for key.tpid which makes no
>> sense,
>> > because it must check for the mask first. At least there must be
>> something like
>> > this:
>> >
>> > diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
>> > index 2af0f10d9..7e7160426 100644
>> > --- a/lib/netdev-offload-tc.c
>> > +++ b/lib/netdev-offload-tc.c
>> > @@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct
>> match *match,
>> >   }
>> >   mask->mpls_lse[0] = 0;
>> >
>> > -if (eth_type_vlan(key->vlans[0].tpid)) {
>> > +if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
>> >   flower.key.encap_eth_type[0] = flower.key.eth_type;
>> > +flower.mask.encap_eth_type[0] = flower.mask.eth_type;
>> >   flower.key.eth_type = key->vlans[0].tpid;
>> > +flower.mask.eth_type = mask->vlans[0].tpid;
>> >   }
>> >   if (mask->vlans[0].tci) {
>> >   ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
>> > @@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct
>> match *match,
>> >   }
>> >   }
>> >
>> > -if (eth_type_vlan(key->vlans[1].tpid)) {
>> > +if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
>> >   flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
>> > +flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
>> >   flower.key.encap_eth_type[0] = key->vlans[1].tpid;
>> > +flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
>> >   }
>> >   if (mask->vlans[1].tci) {
>> >   ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
>> > ---
>> >
>> > I'm not an expert here, so it needs checking and review form someone
>> more
>> > familiar with flower.
>> This seems correct. Need to test it.
>> >
>> >
>> >>eth_type ipv4
>> >>ip_proto tcp
>> >>dst_port 4000
>> >>ip_flags nofrag
>> >>not_in_hw
>> >>  action order 1:  pedit action pipe keys 1
>> >>   index 1 ref 1 bind 1 installed 3 sec used 3 sec
>> >>   key #0  at tcp+0: val 0fa2 mask 
>> >>  Action statistics:
>> >>

Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-19 Thread Ilya Maximets
On 12.06.2019 12:53, Eli Britstein wrote:
> 
> On 6/11/2019 2:21 PM, Ilya Maximets wrote:
>>> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman 
>>> wrote:
>>>
 On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
> Sorry Eli,
>
> I had missed this but I have it now.
>
> On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:
>
>> Ping
>> --
>> *From:* Eli Britstein 
>> *Sent:* Tuesday, May 21, 2019 3:11:51 PM
>> *To:* dev at openvswitch.org; Simon Horman
>> *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
>> *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
 tags
>> The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
>> either the VID, PCP or CFI are non-zero. For priority-tag packets
>> there is a VLAN tag header with a zero VLAN TCI. Match on existence of
>> VLAN header (TPID) regardless of TCI matching.
>>
>> Signed-off-by: Eli Britstein 
>> Reviewed-by: Roi Dayan 
 Thanks this seems to be a nice enhancement, applied to master.

>>> Hey
>>>
>>> During some internal testing we found that this patch broke some
>>> set-L4 cases when using tc-offloads. Setting up a simple bridge and
>>> flow rule looking something like this:
>>>
>>>ovs-vsctl show:
>>>  Bridge "br0"
>>>  Port "br0"
>>>  Interface "br0"
>>>  type: internal
>>>  Port "veth0r"
>>>  Interface "veth0r"
>>>  Port "veth1r"
>>>  Interface "veth1r"
>>>
>>>ovs-ofctl add-flow br0 cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, 
>>> \
>>>  actions=set_field:4002-\>tcp_dst,output:veth1r
>>>
>>> and then sending VLAN tagged traffic leads to packets not egressing the
>>> port.
>>>
>>> The TC rule that gets installed looks like this:
>>>vlan_ethtype ip
>> There must be no vlan_ethertype match just because there was no such field 
>> match
>> in the original flow.
>>
>> Looking at the code I see that it checks for key.tpid which makes no sense,
>> because it must check for the mask first. At least there must be something 
>> like
>> this:
>>
>> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
>> index 2af0f10d9..7e7160426 100644
>> --- a/lib/netdev-offload-tc.c
>> +++ b/lib/netdev-offload-tc.c
>> @@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct 
>> match *match,
>>   }
>>   mask->mpls_lse[0] = 0;
>>   
>> -if (eth_type_vlan(key->vlans[0].tpid)) {
>> +if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
>>   flower.key.encap_eth_type[0] = flower.key.eth_type;
>> +flower.mask.encap_eth_type[0] = flower.mask.eth_type;
>>   flower.key.eth_type = key->vlans[0].tpid;
>> +flower.mask.eth_type = mask->vlans[0].tpid;
>>   }
>>   if (mask->vlans[0].tci) {
>>   ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
>> @@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct 
>> match *match,
>>   }
>>   }
>>   
>> -if (eth_type_vlan(key->vlans[1].tpid)) {
>> +if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
>>   flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
>> +flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
>>   flower.key.encap_eth_type[0] = key->vlans[1].tpid;
>> +flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
>>   }
>>   if (mask->vlans[1].tci) {
>>   ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
>> ---
>>
>> I'm not an expert here, so it needs checking and review form someone more
>> familiar with flower.
> This seems correct. Need to test it.

I'll send this as an official patch.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-14 Thread Eli Britstein


On 6/14/2019 5:40 PM, Louis Peens wrote:


On Wed, Jun 12, 2019 at 11:53 AM Eli Britstein 
mailto:el...@mellanox.com>> wrote:

On 6/11/2019 2:21 PM, Ilya Maximets wrote:
>> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman > netronome.com>
>> wrote:
>>
>>> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
 Sorry Eli,

 I had missed this but I have it now.

 On Fri, 31 May 2019 at 09:35, Eli Britstein >>> mellanox.com> wrote:

> Ping
> --
> *From:* Eli Britstein http://mellanox.com>>
> *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> *To:* dev at 
> openvswitch.org;
>  Simon Horman
> *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
>>> tags
> The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
> either the VID, PCP or CFI are non-zero. For priority-tag packets
> there is a VLAN tag header with a zero VLAN TCI. Match on existence of
> VLAN header (TPID) regardless of TCI matching.
>
> Signed-off-by: Eli Britstein http://mellanox.com>>
> Reviewed-by: Roi Dayan http://mellanox.com>>
>>> Thanks this seems to be a nice enhancement, applied to master.
>>>
>> Hey
>>
>> During some internal testing we found that this patch broke some
>> set-L4 cases when using tc-offloads. Setting up a simple bridge and
>> flow rule looking something like this:
>>
>>ovs-vsctl show:
>>  Bridge "br0"
>>  Port "br0"
>>  Interface "br0"
>>  type: internal
>>  Port "veth0r"
>>  Interface "veth0r"
>>  Port "veth1r"
>>  Interface "veth1r"
>>
>>ovs-ofctl add-flow br0 cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
>>  actions=set_field:4002-\>tcp_dst,output:veth1r
>>
>> and then sending VLAN tagged traffic leads to packets not egressing the
>> port.
>>
>> The TC rule that gets installed looks like this:
>>vlan_ethtype ip
> There must be no vlan_ethertype match just because there was no such field 
> match
> in the original flow.
>
> Looking at the code I see that it checks for key.tpid which makes no sense,
> because it must check for the mask first. At least there must be something 
> like
> this:
>
> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> index 2af0f10d9..7e7160426 100644
> --- a/lib/netdev-offload-tc.c
> +++ b/lib/netdev-offload-tc.c
> @@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
> *match,
>   }
>   mask->mpls_lse[0] = 0;
>
> -if (eth_type_vlan(key->vlans[0].tpid)) {
> +if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
>   flower.key.encap_eth_type[0] = flower.key.eth_type;
> +flower.mask.encap_eth_type[0] = flower.mask.eth_type;
>   flower.key.eth_type = key->vlans[0].tpid;
> +flower.mask.eth_type = mask->vlans[0].tpid;
>   }
>   if (mask->vlans[0].tci) {
>   ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
> @@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
> *match,
>   }
>   }
>
> -if (eth_type_vlan(key->vlans[1].tpid)) {
> +if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
>   flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
> +flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
>   flower.key.encap_eth_type[0] = key->vlans[1].tpid;
> +flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
>   }
>   if (mask->vlans[1].tci) {
>   ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
> ---
>
> I'm not an expert here, so it needs checking and review form someone more
> familiar with flower.
This seems correct. Need to test it.
>
>
>>eth_type ipv4
>>ip_proto tcp
>>dst_port 4000
>>ip_flags nofrag
>>not_in_hw
>>  action order 1:  pedit action pipe keys 1
>>   index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>   key #0  at tcp+0: val 0fa2 mask 
>>  Action statistics:
>>  Sent 368 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
>>  backlog 0b 0p requeues 0
>>
>>  action order 2: csum (tcp) action pipe
>>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>  Action statistics:
>>  Sent 368 bytes 8 pkt 

Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-14 Thread Louis Peens
On Wed, Jun 12, 2019 at 11:53 AM Eli Britstein  wrote:

>
> On 6/11/2019 2:21 PM, Ilya Maximets wrote:
> >> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman  netronome.com>
> >> wrote:
> >>
> >>> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
>  Sorry Eli,
> 
>  I had missed this but I have it now.
> 
>  On Fri, 31 May 2019 at 09:35, Eli Britstein 
> wrote:
> 
> > Ping
> > --
> > *From:* Eli Britstein 
> > *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> > *To:* dev at openvswitch.org; Simon Horman
> > *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> > *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
> >>> tags
> > The logic by which a TC rule has a VLAN match is by the VLAN TCI
> field,
> > either the VID, PCP or CFI are non-zero. For priority-tag packets
> > there is a VLAN tag header with a zero VLAN TCI. Match on existence
> of
> > VLAN header (TPID) regardless of TCI matching.
> >
> > Signed-off-by: Eli Britstein 
> > Reviewed-by: Roi Dayan 
> >>> Thanks this seems to be a nice enhancement, applied to master.
> >>>
> >> Hey
> >>
> >> During some internal testing we found that this patch broke some
> >> set-L4 cases when using tc-offloads. Setting up a simple bridge and
> >> flow rule looking something like this:
> >>
> >>ovs-vsctl show:
> >>  Bridge "br0"
> >>  Port "br0"
> >>  Interface "br0"
> >>  type: internal
> >>  Port "veth0r"
> >>  Interface "veth0r"
> >>  Port "veth1r"
> >>  Interface "veth1r"
> >>
> >>ovs-ofctl add-flow br0
> cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
> >>  actions=set_field:4002-\>tcp_dst,output:veth1r
> >>
> >> and then sending VLAN tagged traffic leads to packets not egressing the
> >> port.
> >>
> >> The TC rule that gets installed looks like this:
> >>vlan_ethtype ip
> > There must be no vlan_ethertype match just because there was no such
> field match
> > in the original flow.
> >
> > Looking at the code I see that it checks for key.tpid which makes no
> sense,
> > because it must check for the mask first. At least there must be
> something like
> > this:
> >
> > diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> > index 2af0f10d9..7e7160426 100644
> > --- a/lib/netdev-offload-tc.c
> > +++ b/lib/netdev-offload-tc.c
> > @@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
> >   }
> >   mask->mpls_lse[0] = 0;
> >
> > -if (eth_type_vlan(key->vlans[0].tpid)) {
> > +if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
> >   flower.key.encap_eth_type[0] = flower.key.eth_type;
> > +flower.mask.encap_eth_type[0] = flower.mask.eth_type;
> >   flower.key.eth_type = key->vlans[0].tpid;
> > +flower.mask.eth_type = mask->vlans[0].tpid;
> >   }
> >   if (mask->vlans[0].tci) {
> >   ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
> > @@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
> >   }
> >   }
> >
> > -if (eth_type_vlan(key->vlans[1].tpid)) {
> > +if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
> >   flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
> > +flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
> >   flower.key.encap_eth_type[0] = key->vlans[1].tpid;
> > +flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
> >   }
> >   if (mask->vlans[1].tci) {
> >   ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
> > ---
> >
> > I'm not an expert here, so it needs checking and review form someone more
> > familiar with flower.
> This seems correct. Need to test it.
> >
> >
> >>eth_type ipv4
> >>ip_proto tcp
> >>dst_port 4000
> >>ip_flags nofrag
> >>not_in_hw
> >>  action order 1:  pedit action pipe keys 1
> >>   index 1 ref 1 bind 1 installed 3 sec used 3 sec
> >>   key #0  at tcp+0: val 0fa2 mask 
> >>  Action statistics:
> >>  Sent 368 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
> >>  backlog 0b 0p requeues 0
> >>
> >>  action order 2: csum (tcp) action pipe
> >>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
> >>  Action statistics:
> >>  Sent 368 bytes 8 pkt (dropped 8, overlimits 0 requeues 0)
> >>  backlog 0b 0p requeues 0
> >>
> >>  action order 3: mirred (Egress Redirect to device ens260np1)
> stolen
> >>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
> >>  Action statistics:
> >>  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> >>  backlog 0b 0p requeues 0
> >>  cookie 8eb331199f4d41dc739e769a2f79f1ba
> >>
> >> Note the drop counters in the csum(tcp) 

Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-12 Thread Eli Britstein


On 6/11/2019 2:21 PM, Ilya Maximets wrote:
>> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman 
>> wrote:
>>
>>> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
 Sorry Eli,

 I had missed this but I have it now.

 On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:

> Ping
> --
> *From:* Eli Britstein 
> *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> *To:* dev at openvswitch.org; Simon Horman
> *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
>>> tags
> The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
> either the VID, PCP or CFI are non-zero. For priority-tag packets
> there is a VLAN tag header with a zero VLAN TCI. Match on existence of
> VLAN header (TPID) regardless of TCI matching.
>
> Signed-off-by: Eli Britstein 
> Reviewed-by: Roi Dayan 
>>> Thanks this seems to be a nice enhancement, applied to master.
>>>
>> Hey
>>
>> During some internal testing we found that this patch broke some
>> set-L4 cases when using tc-offloads. Setting up a simple bridge and
>> flow rule looking something like this:
>>
>>ovs-vsctl show:
>>  Bridge "br0"
>>  Port "br0"
>>  Interface "br0"
>>  type: internal
>>  Port "veth0r"
>>  Interface "veth0r"
>>  Port "veth1r"
>>  Interface "veth1r"
>>
>>ovs-ofctl add-flow br0 cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
>>  actions=set_field:4002-\>tcp_dst,output:veth1r
>>
>> and then sending VLAN tagged traffic leads to packets not egressing the
>> port.
>>
>> The TC rule that gets installed looks like this:
>>vlan_ethtype ip
> There must be no vlan_ethertype match just because there was no such field 
> match
> in the original flow.
>
> Looking at the code I see that it checks for key.tpid which makes no sense,
> because it must check for the mask first. At least there must be something 
> like
> this:
>
> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
> index 2af0f10d9..7e7160426 100644
> --- a/lib/netdev-offload-tc.c
> +++ b/lib/netdev-offload-tc.c
> @@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
> *match,
>   }
>   mask->mpls_lse[0] = 0;
>   
> -if (eth_type_vlan(key->vlans[0].tpid)) {
> +if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
>   flower.key.encap_eth_type[0] = flower.key.eth_type;
> +flower.mask.encap_eth_type[0] = flower.mask.eth_type;
>   flower.key.eth_type = key->vlans[0].tpid;
> +flower.mask.eth_type = mask->vlans[0].tpid;
>   }
>   if (mask->vlans[0].tci) {
>   ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
> @@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
> *match,
>   }
>   }
>   
> -if (eth_type_vlan(key->vlans[1].tpid)) {
> +if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
>   flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
> +flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
>   flower.key.encap_eth_type[0] = key->vlans[1].tpid;
> +flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
>   }
>   if (mask->vlans[1].tci) {
>   ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
> ---
>
> I'm not an expert here, so it needs checking and review form someone more
> familiar with flower.
This seems correct. Need to test it.
>
>
>>eth_type ipv4
>>ip_proto tcp
>>dst_port 4000
>>ip_flags nofrag
>>not_in_hw
>>  action order 1:  pedit action pipe keys 1
>>   index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>   key #0  at tcp+0: val 0fa2 mask 
>>  Action statistics:
>>  Sent 368 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
>>  backlog 0b 0p requeues 0
>>
>>  action order 2: csum (tcp) action pipe
>>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>  Action statistics:
>>  Sent 368 bytes 8 pkt (dropped 8, overlimits 0 requeues 0)
>>  backlog 0b 0p requeues 0
>>
>>  action order 3: mirred (Egress Redirect to device ens260np1) stolen
>>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>  Action statistics:
>>  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>>  backlog 0b 0p requeues 0
>>  cookie 8eb331199f4d41dc739e769a2f79f1ba
>>
>> Note the drop counters in the csum(tcp) section. Before the patch the rule
>> looks like this:
>>eth_type ipv4
>>ip_proto tcp
>>dst_port 4000
>>ip_flags nofrag
>>not_in_hw
>>  action order 1:  pedit action pipe keys 1
>>   index 1 ref 1 bind 1 installed 3 sec used 3 sec
>>   key #0  at tcp+0: val 0fa2 mask 

Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-11 Thread Ilya Maximets
> On Mon, Jun 3, 2019 at 4:42 PM Simon Horman 
> wrote:
> 
>> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
>> > Sorry Eli,
>> >
>> > I had missed this but I have it now.
>> >
>> > On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:
>> >
>> > > Ping
>> > > --
>> > > *From:* Eli Britstein 
>> > > *Sent:* Tuesday, May 21, 2019 3:11:51 PM
>> > > *To:* dev at openvswitch.org; Simon Horman
>> > > *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
>> > > *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
>> tags
>> > >
>> > > The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
>> > > either the VID, PCP or CFI are non-zero. For priority-tag packets
>> > > there is a VLAN tag header with a zero VLAN TCI. Match on existence of
>> > > VLAN header (TPID) regardless of TCI matching.
>> > >
>> > > Signed-off-by: Eli Britstein 
>> > > Reviewed-by: Roi Dayan 
>>
>> Thanks this seems to be a nice enhancement, applied to master.
>>
> 
> Hey
> 
> During some internal testing we found that this patch broke some
> set-L4 cases when using tc-offloads. Setting up a simple bridge and
> flow rule looking something like this:
> 
>   ovs-vsctl show:
> Bridge "br0"
> Port "br0"
> Interface "br0"
> type: internal
> Port "veth0r"
> Interface "veth0r"
> Port "veth1r"
> Interface "veth1r"
> 
>   ovs-ofctl add-flow br0 cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
> actions=set_field:4002-\>tcp_dst,output:veth1r
> 
> and then sending VLAN tagged traffic leads to packets not egressing the
> port.
> 
> The TC rule that gets installed looks like this:
>   vlan_ethtype ip

There must be no vlan_ethertype match just because there was no such field match
in the original flow.

Looking at the code I see that it checks for key.tpid which makes no sense,
because it must check for the mask first. At least there must be something like
this:

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 2af0f10d9..7e7160426 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1146,9 +1146,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 mask->mpls_lse[0] = 0;
 
-if (eth_type_vlan(key->vlans[0].tpid)) {
+if (mask->vlans[0].tpid && eth_type_vlan(key->vlans[0].tpid)) {
 flower.key.encap_eth_type[0] = flower.key.eth_type;
+flower.mask.encap_eth_type[0] = flower.mask.eth_type;
 flower.key.eth_type = key->vlans[0].tpid;
+flower.mask.eth_type = mask->vlans[0].tpid;
 }
 if (mask->vlans[0].tci) {
 ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
@@ -1179,9 +1181,11 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 }
 
-if (eth_type_vlan(key->vlans[1].tpid)) {
+if (mask->vlans[1].tpid && eth_type_vlan(key->vlans[1].tpid)) {
 flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
+flower.mask.encap_eth_type[1] = flower.mask.encap_eth_type[0];
 flower.key.encap_eth_type[0] = key->vlans[1].tpid;
+flower.mask.encap_eth_type[0] = mask->vlans[1].tpid;
 }
 if (mask->vlans[1].tci) {
 ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
---

I'm not an expert here, so it needs checking and review form someone more
familiar with flower.


>   eth_type ipv4
>   ip_proto tcp
>   dst_port 4000
>   ip_flags nofrag
>   not_in_hw
> action order 1:  pedit action pipe keys 1
>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
>  key #0  at tcp+0: val 0fa2 mask 
> Action statistics:
> Sent 368 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> 
> action order 2: csum (tcp) action pipe
> index 1 ref 1 bind 1 installed 3 sec used 3 sec
> Action statistics:
> Sent 368 bytes 8 pkt (dropped 8, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> 
> action order 3: mirred (Egress Redirect to device ens260np1) stolen
> index 1 ref 1 bind 1 installed 3 sec used 3 sec
> Action statistics:
> Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> cookie 8eb331199f4d41dc739e769a2f79f1ba
> 
> Note the drop counters in the csum(tcp) section. Before the patch the rule
> looks like this:
>   eth_type ipv4
>   ip_proto tcp
>   dst_port 4000
>   ip_flags nofrag
>   not_in_hw
> action order 1:  pedit action pipe keys 1
>  index 1 ref 1 bind 1 installed 3 sec used 3 sec
>  key #0  at tcp+0: val 0fa2 mask 
> Action statistics:
> Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> 
> action order 2: csum (tcp) action pipe
> index 1 ref 1 bind 1 installed 3 sec used 3 sec
> Action 

Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-11 Thread Louis Peens
On Mon, Jun 3, 2019 at 4:42 PM Simon Horman 
wrote:

> On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
> > Sorry Eli,
> >
> > I had missed this but I have it now.
> >
> > On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:
> >
> > > Ping
> > > --
> > > *From:* Eli Britstein 
> > > *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> > > *To:* d...@openvswitch.org; Simon Horman
> > > *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> > > *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority
> tags
> > >
> > > The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
> > > either the VID, PCP or CFI are non-zero. For priority-tag packets
> > > there is a VLAN tag header with a zero VLAN TCI. Match on existence of
> > > VLAN header (TPID) regardless of TCI matching.
> > >
> > > Signed-off-by: Eli Britstein 
> > > Reviewed-by: Roi Dayan 
>
> Thanks this seems to be a nice enhancement, applied to master.
>

Hey

During some internal testing we found that this patch broke some
set-L4 cases when using tc-offloads. Setting up a simple bridge and
flow rule looking something like this:

  ovs-vsctl show:
Bridge "br0"
Port "br0"
Interface "br0"
type: internal
Port "veth0r"
Interface "veth0r"
Port "veth1r"
Interface "veth1r"

  ovs-ofctl add-flow br0 cookie=1,table=0,in_port=veth0r,tcp,tcp_dst=4000, \
actions=set_field:4002-\>tcp_dst,output:veth1r

and then sending VLAN tagged traffic leads to packets not egressing the
port.

The TC rule that gets installed looks like this:
  vlan_ethtype ip
  eth_type ipv4
  ip_proto tcp
  dst_port 4000
  ip_flags nofrag
  not_in_hw
action order 1:  pedit action pipe keys 1
 index 1 ref 1 bind 1 installed 3 sec used 3 sec
 key #0  at tcp+0: val 0fa2 mask 
Action statistics:
Sent 368 bytes 8 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0

action order 2: csum (tcp) action pipe
index 1 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 368 bytes 8 pkt (dropped 8, overlimits 0 requeues 0)
backlog 0b 0p requeues 0

action order 3: mirred (Egress Redirect to device ens260np1) stolen
index 1 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
cookie 8eb331199f4d41dc739e769a2f79f1ba

Note the drop counters in the csum(tcp) section. Before the patch the rule
looks like this:
  eth_type ipv4
  ip_proto tcp
  dst_port 4000
  ip_flags nofrag
  not_in_hw
action order 1:  pedit action pipe keys 1
 index 1 ref 1 bind 1 installed 3 sec used 3 sec
 key #0  at tcp+0: val 0fa2 mask 
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0

action order 2: csum (tcp) action pipe
index 1 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0

action order 3: mirred (Egress Redirect to device ens260np1) stolen
index 1 ref 1 bind 1 installed 3 sec used 3 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
cookie 83b3464d0c47e3747956bca7e8857a53

Here I suspect there may be a different issue as none of the counters
increase
so the TC rule is probably never hit (confirmed by the datapath rule timing
out even with continuous traffic), but at least packets are correctly
egressing via the userspace fallback path. It looks like this patch is
installing a rule in TC that does get hit, but is now mysteriously
dropping packets in the middle of the action processing pipeline.

Another strange observation is that this only seems to happen when setting
one of the layer4 fields, setting layer3 seems to work as expected.

Regards
Louis Peens


> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-06-03 Thread Simon Horman
On Fri, May 31, 2019 at 02:45:25PM +0200, Simon Horman wrote:
> Sorry Eli,
> 
> I had missed this but I have it now.
> 
> On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:
> 
> > Ping
> > --
> > *From:* Eli Britstein 
> > *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> > *To:* d...@openvswitch.org; Simon Horman
> > *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> > *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority tags
> >
> > The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
> > either the VID, PCP or CFI are non-zero. For priority-tag packets
> > there is a VLAN tag header with a zero VLAN TCI. Match on existence of
> > VLAN header (TPID) regardless of TCI matching.
> >
> > Signed-off-by: Eli Britstein 
> > Reviewed-by: Roi Dayan 

Thanks this seems to be a nice enhancement, applied to master.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-05-31 Thread Simon Horman
Sorry Eli,

I had missed this but I have it now.

On Fri, 31 May 2019 at 09:35, Eli Britstein  wrote:

> Ping
> --
> *From:* Eli Britstein 
> *Sent:* Tuesday, May 21, 2019 3:11:51 PM
> *To:* d...@openvswitch.org; Simon Horman
> *Cc:* Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
> *Subject:* [PATCH 1/1] netdev-tc-offloads: Support match on priority tags
>
> The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
> either the VID, PCP or CFI are non-zero. For priority-tag packets
> there is a VLAN tag header with a zero VLAN TCI. Match on existence of
> VLAN header (TPID) regardless of TCI matching.
>
> Signed-off-by: Eli Britstein 
> Reviewed-by: Roi Dayan 
> ---
>  lib/netdev-tc-offloads.c | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
> index d5c66acc1..ef9ee0786 100644
> --- a/lib/netdev-tc-offloads.c
> +++ b/lib/netdev-tc-offloads.c
> @@ -1146,6 +1146,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
>  }
>  mask->mpls_lse[0] = 0;
>
> +if (eth_type_vlan(key->vlans[0].tpid)) {
> +flower.key.encap_eth_type[0] = flower.key.eth_type;
> +flower.key.eth_type = key->vlans[0].tpid;
> +}
>  if (mask->vlans[0].tci) {
>  ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
>  ovs_be16 pcp_mask = mask->vlans[0].tci & htons(VLAN_PCP_MASK);
> @@ -1166,8 +1170,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
>  VLOG_DBG_RL(, "vlan_prio[0]: %d\n",
>  flower.key.vlan_prio[0]);
>  }
> -flower.key.encap_eth_type[0] = flower.key.eth_type;
> -flower.key.eth_type = key->vlans[0].tpid;
>  } else if (mask->vlans[0].tci == htons(0x) &&
> ntohs(key->vlans[0].tci) == 0) {
>  /* exact && no vlan */
> @@ -1177,6 +1179,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
>  }
>  }
>
> +if (eth_type_vlan(key->vlans[1].tpid)) {
> +flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
> +flower.key.encap_eth_type[0] = key->vlans[1].tpid;
> +}
>  if (mask->vlans[1].tci) {
>  ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
>  ovs_be16 pcp_mask = mask->vlans[1].tci & htons(VLAN_PCP_MASK);
> @@ -1196,8 +1202,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct
> match *match,
>  flower.mask.vlan_prio[1] =
> vlan_tci_to_pcp(mask->vlans[1].tci);
>  VLOG_DBG_RL(, "vlan_prio[1]: %d",
> flower.key.vlan_prio[1]);
>  }
> -flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
> -flower.key.encap_eth_type[0] = key->vlans[1].tpid;
>  } else if (mask->vlans[1].tci == htons(0x) &&
> ntohs(key->vlans[1].tci) == 0) {
>  /* exact && no vlan */
> --
> 2.17.2
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-05-31 Thread Eli Britstein
Ping

From: Eli Britstein 
Sent: Tuesday, May 21, 2019 3:11:51 PM
To: d...@openvswitch.org; Simon Horman
Cc: Roi Dayan; Paul Blakey; Eli Cohen; Eli Britstein
Subject: [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
either the VID, PCP or CFI are non-zero. For priority-tag packets
there is a VLAN tag header with a zero VLAN TCI. Match on existence of
VLAN header (TPID) regardless of TCI matching.

Signed-off-by: Eli Britstein 
Reviewed-by: Roi Dayan 
---
 lib/netdev-tc-offloads.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index d5c66acc1..ef9ee0786 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -1146,6 +1146,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 mask->mpls_lse[0] = 0;

+if (eth_type_vlan(key->vlans[0].tpid)) {
+flower.key.encap_eth_type[0] = flower.key.eth_type;
+flower.key.eth_type = key->vlans[0].tpid;
+}
 if (mask->vlans[0].tci) {
 ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
 ovs_be16 pcp_mask = mask->vlans[0].tci & htons(VLAN_PCP_MASK);
@@ -1166,8 +1170,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 VLOG_DBG_RL(, "vlan_prio[0]: %d\n",
 flower.key.vlan_prio[0]);
 }
-flower.key.encap_eth_type[0] = flower.key.eth_type;
-flower.key.eth_type = key->vlans[0].tpid;
 } else if (mask->vlans[0].tci == htons(0x) &&
ntohs(key->vlans[0].tci) == 0) {
 /* exact && no vlan */
@@ -1177,6 +1179,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 }

+if (eth_type_vlan(key->vlans[1].tpid)) {
+flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
+flower.key.encap_eth_type[0] = key->vlans[1].tpid;
+}
 if (mask->vlans[1].tci) {
 ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
 ovs_be16 pcp_mask = mask->vlans[1].tci & htons(VLAN_PCP_MASK);
@@ -1196,8 +1202,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 flower.mask.vlan_prio[1] = vlan_tci_to_pcp(mask->vlans[1].tci);
 VLOG_DBG_RL(, "vlan_prio[1]: %d", flower.key.vlan_prio[1]);
 }
-flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
-flower.key.encap_eth_type[0] = key->vlans[1].tpid;
 } else if (mask->vlans[1].tci == htons(0x) &&
ntohs(key->vlans[1].tci) == 0) {
 /* exact && no vlan */
--
2.17.2

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 1/1] netdev-tc-offloads: Support match on priority tags

2019-05-21 Thread Eli Britstein
The logic by which a TC rule has a VLAN match is by the VLAN TCI field,
either the VID, PCP or CFI are non-zero. For priority-tag packets
there is a VLAN tag header with a zero VLAN TCI. Match on existence of
VLAN header (TPID) regardless of TCI matching.

Signed-off-by: Eli Britstein 
Reviewed-by: Roi Dayan 
---
 lib/netdev-tc-offloads.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index d5c66acc1..ef9ee0786 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -1146,6 +1146,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 mask->mpls_lse[0] = 0;
 
+if (eth_type_vlan(key->vlans[0].tpid)) {
+flower.key.encap_eth_type[0] = flower.key.eth_type;
+flower.key.eth_type = key->vlans[0].tpid;
+}
 if (mask->vlans[0].tci) {
 ovs_be16 vid_mask = mask->vlans[0].tci & htons(VLAN_VID_MASK);
 ovs_be16 pcp_mask = mask->vlans[0].tci & htons(VLAN_PCP_MASK);
@@ -1166,8 +1170,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 VLOG_DBG_RL(, "vlan_prio[0]: %d\n",
 flower.key.vlan_prio[0]);
 }
-flower.key.encap_eth_type[0] = flower.key.eth_type;
-flower.key.eth_type = key->vlans[0].tpid;
 } else if (mask->vlans[0].tci == htons(0x) &&
ntohs(key->vlans[0].tci) == 0) {
 /* exact && no vlan */
@@ -1177,6 +1179,10 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 }
 }
 
+if (eth_type_vlan(key->vlans[1].tpid)) {
+flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
+flower.key.encap_eth_type[0] = key->vlans[1].tpid;
+}
 if (mask->vlans[1].tci) {
 ovs_be16 vid_mask = mask->vlans[1].tci & htons(VLAN_VID_MASK);
 ovs_be16 pcp_mask = mask->vlans[1].tci & htons(VLAN_PCP_MASK);
@@ -1196,8 +1202,6 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
 flower.mask.vlan_prio[1] = vlan_tci_to_pcp(mask->vlans[1].tci);
 VLOG_DBG_RL(, "vlan_prio[1]: %d", flower.key.vlan_prio[1]);
 }
-flower.key.encap_eth_type[1] = flower.key.encap_eth_type[0];
-flower.key.encap_eth_type[0] = key->vlans[1].tpid;
 } else if (mask->vlans[1].tci == htons(0x) &&
ntohs(key->vlans[1].tci) == 0) {
 /* exact && no vlan */
-- 
2.17.2

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev