Re: [Cake] [PATCH net v3] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread David Miller
From: Toke Høiland-Jørgensen Date: Fri, 3 Jul 2020 22:26:43 +0200 > There are a couple of places in net/sched/ that check skb->protocol and act > on the value there. However, in the presence of VLAN tags, the value stored > in skb->protocol can be inconsistent based on whether VLAN acceleration

Re: [Cake] [PATCH net v3] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Daniel Borkmann
On 7/3/20 10:26 PM, Toke Høiland-Jørgensen wrote: There are a couple of places in net/sched/ that check skb->protocol and act on the value there. However, in the presence of VLAN tags, the value stored in skb->protocol can be inconsistent based on whether VLAN acceleration is enabled. The commit

[Cake] [PATCH net v3] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
There are a couple of places in net/sched/ that check skb->protocol and act on the value there. However, in the presence of VLAN tags, the value stored in skb->protocol can be inconsistent based on whether VLAN acceleration is enabled. The commit quoted in the Fixes tag below fixed the users of skb

Re: [Cake] [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
Roman Mashak writes: > Toke Høiland-Jørgensen writes: > > > [...] > >> +/* A getter for the SKB protocol field which will handle VLAN tags >> consistently >> + * whether VLAN acceleration is enabled or not. >> + */ >> +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan)

Re: [Cake] [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Cong Wang
On Fri, Jul 3, 2020 at 8:22 AM Toke Høiland-Jørgensen wrote: > diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h > index b05e855f1ddd..d0c1cb0d264d 100644 > --- a/include/linux/if_vlan.h > +++ b/include/linux/if_vlan.h > @@ -308,6 +308,35 @@ static inline bool eth_type_vlan(__be16 eth

Re: [Cake] [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Roman Mashak
Toke Høiland-Jørgensen writes: [...] > +/* A getter for the SKB protocol field which will handle VLAN tags > consistently > + * whether VLAN acceleration is enabled or not. > + */ > +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan) > +{ > + unsigned int offset =

Re: [Cake] [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
Cong Wang writes: > On Fri, Jul 3, 2020 at 8:22 AM Toke Høiland-Jørgensen wrote: >> diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h >> index b05e855f1ddd..d0c1cb0d264d 100644 >> --- a/include/linux/if_vlan.h >> +++ b/include/linux/if_vlan.h >> @@ -308,6 +308,35 @@ static inline bo

[Cake] [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
There are a couple of places in net/sched/ that check skb->protocol and act on the value there. However, in the presence of VLAN tags, the value stored in skb->protocol can be inconsistent based on whether VLAN acceleration is enabled. The commit quoted in the Fixes tag below fixed the users of skb

Re: [Cake] [PATCH net] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
Davide Caratti writes: > hello Toke, > > thanks for answering! > > On Fri, 2020-07-03 at 14:05 +0200, Toke Høiland-Jørgensen wrote: >> while (proto == htons(ETH_P_8021Q) || proto == htons(ETH_P_8021AD)) { > > maybe this line be shortened, since if_vlan.h has [1]: > > while (eth_type_vlan(proto)

Re: [Cake] [PATCH net] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Davide Caratti
hello Toke, thanks for answering! On Fri, 2020-07-03 at 14:05 +0200, Toke Høiland-Jørgensen wrote: > while (proto == htons(ETH_P_8021Q) || proto == htons(ETH_P_8021AD)) { maybe this line be shortened, since if_vlan.h has [1]: while (eth_type_vlan(proto)) { ... } If I read well, the b

[Cake] [PATCH net] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Toke Høiland-Jørgensen
There are a couple of places in net/sched/ that check skb->protocol and act on the value there. However, in the presence of VLAN tags, the value stored in skb->protocol can be inconsistent based on whether VLAN acceleration is enabled. The commit quoted in the Fixes tag below fixed the users of skb