From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: tc H/W offload issue with vxlan tunnels [was: nfp: flower vxlan tunnel offload] Date: Wed, 27 Sep 2017 14:55:09 +0200 Message-ID: <20170927125509.GG1944@nanopsycho.orion> References: <1506500975.2867.19.camel@redhat.com> <20170927091700.GC1944@nanopsycho.orion> <1506505618.2867.34.camel@redhat.com> <20170927111150.GE1944@nanopsycho.orion> <1506515496.6840.6.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Or Gerlitz , Jiri Benc , Simon Horman , David Miller , Jakub Kicinski , Linux Netdev List , oss-drivers@netronome.com, John Hurley , Paul Blakey , Jiri Pirko , Roi Dayan To: Paolo Abeni Return-path: Received: from mail-wr0-f179.google.com ([209.85.128.179]:55260 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbdI0MzM (ORCPT ); Wed, 27 Sep 2017 08:55:12 -0400 Received: by mail-wr0-f179.google.com with SMTP id g29so16282294wrg.11 for ; Wed, 27 Sep 2017 05:55:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1506515496.6840.6.camel@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Sep 27, 2017 at 02:31:36PM CEST, pabeni@redhat.com wrote: >On Wed, 2017-09-27 at 13:11 +0200, Jiri Pirko wrote: >> Wed, Sep 27, 2017 at 11:46:58AM CEST, pabeni@redhat.com wrote: >> > On Wed, 2017-09-27 at 11:17 +0200, Jiri Pirko wrote: >> > > Wed, Sep 27, 2017 at 10:29:35AM CEST, pabeni@redhat.com wrote: >> > > > So it looks like the H/W offload hook will still be called with the >> > > > same arguments in both case, and 'bad' rule will still be pushed to the >> > > > H/W as the driver itself has no way to distinct between the two >> > > > scenarios. >> > > >> > > Why "bad"? >> > >> > Such rule is coped differently by the SW and the HW data path. >> > >> > a rule like: >> > >> > tc filter add dev eth0 protocol ip parent ffff: flower \ >> > enc_key_id 102 enc_dst_port 4789 src_ip 3.4.5.6 skip_hw \ >> > action action mirred redirect eth0_vf_1 >> > >> > will match 0 packets, while: >> > >> > tc filter add dev eth0 protocol ip parent ffff: flower \ >> > enc_key_id 102 enc_dst_port 4789 src_ip 3.4.5.6 skip_sw \ >> > action action mirred redirect eth0_vf_1 >> > >> > [just flipped 'skip_sw' and 'skip_hw' ] >> > will match the vxlan-tunneled packets. I understand that one of the >> > design goal for the h/w offload path is being consistent with the sw >> > one, but that does not hold in the above scenario. >> >> Sure, the consistency is important. Howcome "skip_hw" won't match and >> "skip_sw" will match? What's different? > >For the SW datapath, we need a metadata based/lwt tunnel to collect the >tunnel information. eth0 is not a such device and does not provide the >metadata. Any match on tunnel based field will fail - correctly. So where do you attach the tc filter instead of eth0? vxlan0? > >When the HW datapath is used, the underlaying NIC is programmed exactly >as done when we replace eth0 with vxlan0. The programmed flow matches >vxlan encapsulated traffic. Ok, so we should unify the behaviour with sw path and don't allow such mathing in hw. > >Cheers, > >Paolo