diff mbox

net/openvswitch: Remove the skb encapsulation mark after decapsulation

Message ID 1390403705-28690-1-git-send-email-ogerlitz@mellanox.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Or Gerlitz Jan. 22, 2014, 3:15 p.m. UTC
We must unset the skb encapsulation mark before injecting the
decapsulated packet into ovs for the rest of its journey.

This follows the practice set by 0afb166 "vxlan: Add capability of Rx
checksum offload for inner packet" and the overall idea behind the
skb encapsulation field.

Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 net/openvswitch/vport-vxlan.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Jesse Gross Jan. 22, 2014, 5:02 p.m. UTC | #1
On Wed, Jan 22, 2014 at 7:15 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
> We must unset the skb encapsulation mark before injecting the
> decapsulated packet into ovs for the rest of its journey.
>
> This follows the practice set by 0afb166 "vxlan: Add capability of Rx
> checksum offload for inner packet" and the overall idea behind the
> skb encapsulation field.
>
> Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>

This should be in the common decapsulation code. It doesn't make sense
to do this here when we set the layer pointers, encap bit, etc. in
common code on transmit.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Or Gerlitz Jan. 22, 2014, 5:23 p.m. UTC | #2
On Wed, Jan 22, 2014 at 7:02 PM, Jesse Gross <jesse@nicira.com> wrote:
> On Wed, Jan 22, 2014 at 7:15 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
>> We must unset the skb encapsulation mark before injecting the
>> decapsulated packet into ovs for the rest of its journey.
>>
>> This follows the practice set by 0afb166 "vxlan: Add capability of Rx
>> checksum offload for inner packet" and the overall idea behind the
>> skb encapsulation field.
>>
>> Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
>> Cc: Pravin B Shelar <pshelar@nicira.com>
>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>
> This should be in the common decapsulation code. It doesn't make sense
> to do this here when we set the layer pointers, encap bit, etc. in
> common code on transmit.

well that's a bit problematic, since the code in the vxlan driver vxlan_rcv()
which has the potential to be common refers to vxlan->dev-> which is
irrelevant for ovs, thoughts?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesse Gross Jan. 22, 2014, 6:02 p.m. UTC | #3
On Wed, Jan 22, 2014 at 9:23 AM, Or Gerlitz <or.gerlitz@gmail.com> wrote:
> On Wed, Jan 22, 2014 at 7:02 PM, Jesse Gross <jesse@nicira.com> wrote:
>> On Wed, Jan 22, 2014 at 7:15 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
>>> We must unset the skb encapsulation mark before injecting the
>>> decapsulated packet into ovs for the rest of its journey.
>>>
>>> This follows the practice set by 0afb166 "vxlan: Add capability of Rx
>>> checksum offload for inner packet" and the overall idea behind the
>>> skb encapsulation field.
>>>
>>> Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
>>> Cc: Pravin B Shelar <pshelar@nicira.com>
>>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>>
>> This should be in the common decapsulation code. It doesn't make sense
>> to do this here when we set the layer pointers, encap bit, etc. in
>> common code on transmit.
>
> well that's a bit problematic, since the code in the vxlan driver vxlan_rcv()
> which has the potential to be common refers to vxlan->dev-> which is
> irrelevant for ovs, thoughts?

Well, as I said before, I don't really see the value in the
NETIF_F_RXCSUM flag on a VXLAN device but in any case you could break
that if statement in half and move the part that doesn't refer to
vxlan->dev into common code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Or Gerlitz Jan. 22, 2014, 6:49 p.m. UTC | #4
On Wed, Jan 22, 2014 at 8:02 PM, Jesse Gross <jesse@nicira.com> wrote:
> On Wed, Jan 22, 2014 at 9:23 AM, Or Gerlitz <or.gerlitz@gmail.com> wrote:
>> On Wed, Jan 22, 2014 at 7:02 PM, Jesse Gross <jesse@nicira.com> wrote:
>>> On Wed, Jan 22, 2014 at 7:15 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
>>>> We must unset the skb encapsulation mark before injecting the
>>>> decapsulated packet into ovs for the rest of its journey.
>>>>
>>>> This follows the practice set by 0afb166 "vxlan: Add capability of Rx
>>>> checksum offload for inner packet" and the overall idea behind the
>>>> skb encapsulation field.
>>>>
>>>> Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
>>>> Cc: Pravin B Shelar <pshelar@nicira.com>
>>>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
>>>
>>> This should be in the common decapsulation code. It doesn't make sense
>>> to do this here when we set the layer pointers, encap bit, etc. in
>>> common code on transmit.
>>
>> well that's a bit problematic, since the code in the vxlan driver vxlan_rcv()
>> which has the potential to be common refers to vxlan->dev-> which is
>> irrelevant for ovs, thoughts?
>
> Well, as I said before, I don't really see the value in the
> NETIF_F_RXCSUM flag on a VXLAN device

I am OK with that too, Joseph?

> but in any case you could break that if statement in half and
> move the part that doesn't refer to vxlan->dev into common code.

So if Joseph is OK with the above I'll just remove the check and move
the code to common  code and if not, I'll have most of it common and
this one separately, good, we have a plan.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joseph Gasparakis Jan. 22, 2014, 7:17 p.m. UTC | #5
On Wed, 22 Jan 2014, Or Gerlitz wrote:

> On Wed, Jan 22, 2014 at 8:02 PM, Jesse Gross <jesse@nicira.com> wrote:
> > On Wed, Jan 22, 2014 at 9:23 AM, Or Gerlitz <or.gerlitz@gmail.com> wrote:
> >> On Wed, Jan 22, 2014 at 7:02 PM, Jesse Gross <jesse@nicira.com> wrote:
> >>> On Wed, Jan 22, 2014 at 7:15 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
> >>>> We must unset the skb encapsulation mark before injecting the
> >>>> decapsulated packet into ovs for the rest of its journey.
> >>>>
> >>>> This follows the practice set by 0afb166 "vxlan: Add capability of Rx
> >>>> checksum offload for inner packet" and the overall idea behind the
> >>>> skb encapsulation field.
> >>>>
> >>>> Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>
> >>>> Cc: Pravin B Shelar <pshelar@nicira.com>
> >>>> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> >>>
> >>> This should be in the common decapsulation code. It doesn't make sense
> >>> to do this here when we set the layer pointers, encap bit, etc. in
> >>> common code on transmit.
> >>
> >> well that's a bit problematic, since the code in the vxlan driver vxlan_rcv()
> >> which has the potential to be common refers to vxlan->dev-> which is
> >> irrelevant for ovs, thoughts?
> >
> > Well, as I said before, I don't really see the value in the
> > NETIF_F_RXCSUM flag on a VXLAN device
> 
> I am OK with that too, Joseph?

Yes, looks good to me, too.

> 
> > but in any case you could break that if statement in half and
> > move the part that doesn't refer to vxlan->dev into common code.
> 
> So if Joseph is OK with the above I'll just remove the check and move
> the code to common  code and if not, I'll have most of it common and
> this one separately, good, we have a plan.
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index e797a50..3742c71 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -68,6 +68,9 @@  static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, __be32 vx_vni)
 	key = cpu_to_be64(ntohl(vx_vni) >> 8);
 	ovs_flow_tun_key_init(&tun_key, iph, key, TUNNEL_KEY);
 
+	/* we must unset the encapsulation mark after decapsulation */
+	skb->encapsulation = 0;
+
 	ovs_vport_receive(vport, skb, &tun_key);
 }