diff mbox series

[ovs-dev,ovs] lib/tc: reject offloading of non-Ethernet packets

Message ID 1536153984-16529-1-git-send-email-louis.peens@netronome.com
State Accepted
Commit 662a6fd4c2c34e0fb02f82e583c6ced8717c346c
Headers show
Series [ovs-dev,ovs] lib/tc: reject offloading of non-Ethernet packets | expand

Commit Message

Louis Peens Sept. 5, 2018, 1:26 p.m. UTC
When a packet is marked with the special ethtype of OFP_DL_TYPE_NOT_ETH_TYPE
it got wrongly installed into tc datapath as a match on a packet with that
ethtype. This prevents that from happening.

Signed-off-by: Louis Peens <louis.peens@netronome.com>
Reviewed-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
 lib/netdev-tc-offloads.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Horman Sept. 6, 2018, 8:08 a.m. UTC | #1
On Wed, Sep 05, 2018 at 03:26:24PM +0200, Louis Peens wrote:
> When a packet is marked with the special ethtype of OFP_DL_TYPE_NOT_ETH_TYPE
> it got wrongly installed into tc datapath as a match on a packet with that
> ethtype. This prevents that from happening.
> 
> Signed-off-by: Louis Peens <louis.peens@netronome.com>
> Reviewed-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>

Thanks Louis,

this looks good to me. I would, however, like to wait a little
before applying in order to allow time for others to review this patch. 

> ---
>  lib/netdev-tc-offloads.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
> index 7bc745e..ccf6d6b 100644
> --- a/lib/netdev-tc-offloads.c
> +++ b/lib/netdev-tc-offloads.c
> @@ -918,6 +918,10 @@ test_key_and_mask(struct match *match)
>                          "offloading attribute icmp_code isn't supported");
>              return EOPNOTSUPP;
>          }
> +    } else if (key->dl_type == htons(OFP_DL_TYPE_NOT_ETH_TYPE)) {
> +        VLOG_DBG_RL(&rl,
> +                    "offloading of non-ethernet packets isn't supported");
> +        return EOPNOTSUPP;
>      }
>  
>      if (!is_all_zeros(mask, sizeof *mask)) {
> -- 
> 2.7.4
>
Simon Horman Sept. 10, 2018, 11:54 a.m. UTC | #2
On Thu, Sep 06, 2018 at 10:08:15AM +0200, Simon Horman wrote:
> On Wed, Sep 05, 2018 at 03:26:24PM +0200, Louis Peens wrote:
> > When a packet is marked with the special ethtype of OFP_DL_TYPE_NOT_ETH_TYPE
> > it got wrongly installed into tc datapath as a match on a packet with that
> > ethtype. This prevents that from happening.
> > 
> > Signed-off-by: Louis Peens <louis.peens@netronome.com>
> > Reviewed-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
> > Reviewed-by: Simon Horman <simon.horman@netronome.com>
> 
> Thanks Louis,
> 
> this looks good to me. I would, however, like to wait a little
> before applying in order to allow time for others to review this patch. 

Thanks again Louis,

applied to master, branch-2.10 and branch-2.9.

As discussed elsewhere, please consider posting a backport to branch-2.8 at
your convenience.

> 
> > ---
> >  lib/netdev-tc-offloads.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
> > index 7bc745e..ccf6d6b 100644
> > --- a/lib/netdev-tc-offloads.c
> > +++ b/lib/netdev-tc-offloads.c
> > @@ -918,6 +918,10 @@ test_key_and_mask(struct match *match)
> >                          "offloading attribute icmp_code isn't supported");
> >              return EOPNOTSUPP;
> >          }
> > +    } else if (key->dl_type == htons(OFP_DL_TYPE_NOT_ETH_TYPE)) {
> > +        VLOG_DBG_RL(&rl,
> > +                    "offloading of non-ethernet packets isn't supported");
> > +        return EOPNOTSUPP;
> >      }
> >  
> >      if (!is_all_zeros(mask, sizeof *mask)) {
> > -- 
> > 2.7.4
> >
diff mbox series

Patch

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index 7bc745e..ccf6d6b 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -918,6 +918,10 @@  test_key_and_mask(struct match *match)
                         "offloading attribute icmp_code isn't supported");
             return EOPNOTSUPP;
         }
+    } else if (key->dl_type == htons(OFP_DL_TYPE_NOT_ETH_TYPE)) {
+        VLOG_DBG_RL(&rl,
+                    "offloading of non-ethernet packets isn't supported");
+        return EOPNOTSUPP;
     }
 
     if (!is_all_zeros(mask, sizeof *mask)) {