netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
@ 2014-01-22 15:15 Or Gerlitz
  2014-01-22 17:02 ` Jesse Gross
  0 siblings, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2014-01-22 15:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, Or Gerlitz, Joseph Gasparakis, Pravin B Shelar

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(-)

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);
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
  2014-01-22 15:15 [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation Or Gerlitz
@ 2014-01-22 17:02 ` Jesse Gross
  2014-01-22 17:23   ` Or Gerlitz
  0 siblings, 1 reply; 6+ messages in thread
From: Jesse Gross @ 2014-01-22 17:02 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: David Miller, netdev, Joseph Gasparakis, Pravin B Shelar

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
  2014-01-22 17:02 ` Jesse Gross
@ 2014-01-22 17:23   ` Or Gerlitz
  2014-01-22 18:02     ` Jesse Gross
  0 siblings, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2014-01-22 17:23 UTC (permalink / raw)
  To: Jesse Gross
  Cc: Or Gerlitz, David Miller, netdev, Joseph Gasparakis, Pravin B Shelar

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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
  2014-01-22 17:23   ` Or Gerlitz
@ 2014-01-22 18:02     ` Jesse Gross
  2014-01-22 18:49       ` Or Gerlitz
  0 siblings, 1 reply; 6+ messages in thread
From: Jesse Gross @ 2014-01-22 18:02 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Or Gerlitz, David Miller, netdev, Joseph Gasparakis, Pravin B Shelar

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
  2014-01-22 18:02     ` Jesse Gross
@ 2014-01-22 18:49       ` Or Gerlitz
  2014-01-22 19:17         ` Joseph Gasparakis
  0 siblings, 1 reply; 6+ messages in thread
From: Or Gerlitz @ 2014-01-22 18:49 UTC (permalink / raw)
  To: Jesse Gross, Joseph Gasparakis
  Cc: Or Gerlitz, David Miller, netdev, Pravin B Shelar

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation
  2014-01-22 18:49       ` Or Gerlitz
@ 2014-01-22 19:17         ` Joseph Gasparakis
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph Gasparakis @ 2014-01-22 19:17 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Jesse Gross, Joseph Gasparakis, Or Gerlitz, David Miller, netdev,
	Pravin B Shelar



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.
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-22 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 15:15 [PATCH] net/openvswitch: Remove the skb encapsulation mark after decapsulation Or Gerlitz
2014-01-22 17:02 ` Jesse Gross
2014-01-22 17:23   ` Or Gerlitz
2014-01-22 18:02     ` Jesse Gross
2014-01-22 18:49       ` Or Gerlitz
2014-01-22 19:17         ` Joseph Gasparakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).