diff mbox series

[ovs-dev,ovs,v1] tunnel: Remove the padding from packet when encapsulating.

Message ID 20201214030936.87354-1-xiangxia.m.yue@gmail.com
State New
Headers show
Series [ovs-dev,ovs,v1] tunnel: Remove the padding from packet when encapsulating. | expand

Commit Message

Tonghao Zhang Dec. 14, 2020, 3:09 a.m. UTC
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

The root cause is that the old version of openvswitch doesn't
remove the padding from packet before L3+ conntrack processing
and then packets is dropped in linux kernel stack. The patch [1]
fixes the issue. We fix this issue on gateway which running ovs-dpdk
as a quick workaround. Padding should be removed because tunnel size
+ inner size > 64B. More detailes, see [1]

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9382fe71c0058465e942a633869629929102843d
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 lib/netdev-native-tnl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Tonghao Zhang April 1, 2021, 1:34 p.m. UTC | #1
On Mon, Dec 14, 2020 at 11:11 AM <xiangxia.m.yue@gmail.com> wrote:
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The root cause is that the old version of openvswitch doesn't
> remove the padding from packet before L3+ conntrack processing
> and then packets is dropped in linux kernel stack. The patch [1]
> fixes the issue. We fix this issue on gateway which running ovs-dpdk
> as a quick workaround. Padding should be removed because tunnel size
> + inner size > 64B. More detailes, see [1]
>
> [1] - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9382fe71c0058465e942a633869629929102843d
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
ping :)
> ---
>  lib/netdev-native-tnl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
> index b89dfdd52..acfbb13c4 100644
> --- a/lib/netdev-native-tnl.c
> +++ b/lib/netdev-native-tnl.c
> @@ -149,11 +149,15 @@ void *
>  netdev_tnl_push_ip_header(struct dp_packet *packet,
>                 const void *header, int size, int *ip_tot_size)
>  {
> +    int padding = dp_packet_l2_pad_size(packet);
>      struct eth_header *eth;
>      struct ip_header *ip;
>      struct ovs_16aligned_ip6_hdr *ip6;
>
>      eth = dp_packet_push_uninit(packet, size);
> +    if (padding) {
> +        dp_packet_set_size(packet, dp_packet_size(packet) - padding);
> +    }
>      *ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header);
>
>      memcpy(eth, header, size);
> --
> 2.14.1
>
Tonghao Zhang June 28, 2021, 2:07 a.m. UTC | #2
On Thu, Apr 1, 2021 at 9:34 PM Tonghao Zhang <xiangxia.m.yue@gmail.com> wrote:
>
> On Mon, Dec 14, 2020 at 11:11 AM <xiangxia.m.yue@gmail.com> wrote:
> >
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > The root cause is that the old version of openvswitch doesn't
> > remove the padding from packet before L3+ conntrack processing
> > and then packets is dropped in linux kernel stack. The patch [1]
> > fixes the issue. We fix this issue on gateway which running ovs-dpdk
> > as a quick workaround. Padding should be removed because tunnel size
> > + inner size > 64B. More detailes, see [1]
> >
> > [1] - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9382fe71c0058465e942a633869629929102843d
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ping :)
friendly ping.
> > ---
> >  lib/netdev-native-tnl.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
> > index b89dfdd52..acfbb13c4 100644
> > --- a/lib/netdev-native-tnl.c
> > +++ b/lib/netdev-native-tnl.c
> > @@ -149,11 +149,15 @@ void *
> >  netdev_tnl_push_ip_header(struct dp_packet *packet,
> >                 const void *header, int size, int *ip_tot_size)
> >  {
> > +    int padding = dp_packet_l2_pad_size(packet);
> >      struct eth_header *eth;
> >      struct ip_header *ip;
> >      struct ovs_16aligned_ip6_hdr *ip6;
> >
> >      eth = dp_packet_push_uninit(packet, size);
> > +    if (padding) {
> > +        dp_packet_set_size(packet, dp_packet_size(packet) - padding);
> > +    }
> >      *ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header);
> >
> >      memcpy(eth, header, size);
> > --
> > 2.14.1
> >
>
>
> --
> Best regards, Tonghao
Tonghao Zhang July 12, 2021, 12:33 p.m. UTC | #3
On Mon, Jun 28, 2021 at 10:07 AM Tonghao Zhang <xiangxia.m.yue@gmail.com>
wrote:

> On Thu, Apr 1, 2021 at 9:34 PM Tonghao Zhang <xiangxia.m.yue@gmail.com>
> wrote:
> >
> > On Mon, Dec 14, 2020 at 11:11 AM <xiangxia.m.yue@gmail.com> wrote:
> > >
> > > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > >
> > > The root cause is that the old version of openvswitch doesn't
> > > remove the padding from packet before L3+ conntrack processing
> > > and then packets is dropped in linux kernel stack. The patch [1]
> > > fixes the issue. We fix this issue on gateway which running ovs-dpdk
> > > as a quick workaround. Padding should be removed because tunnel size
> > > + inner size > 64B. More detailes, see [1]
> > >
> > > [1] -
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9382fe71c0058465e942a633869629929102843d
> > > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > ping :)
> friendly ping.

Hi Ilya
Can you help me to review this patch?


> > > ---
> > >  lib/netdev-native-tnl.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
> > > index b89dfdd52..acfbb13c4 100644
> > > --- a/lib/netdev-native-tnl.c
> > > +++ b/lib/netdev-native-tnl.c
> > > @@ -149,11 +149,15 @@ void *
> > >  netdev_tnl_push_ip_header(struct dp_packet *packet,
> > >                 const void *header, int size, int *ip_tot_size)
> > >  {
> > > +    int padding = dp_packet_l2_pad_size(packet);
> > >      struct eth_header *eth;
> > >      struct ip_header *ip;
> > >      struct ovs_16aligned_ip6_hdr *ip6;
> > >
> > >      eth = dp_packet_push_uninit(packet, size);
> > > +    if (padding) {
> > > +        dp_packet_set_size(packet, dp_packet_size(packet) - padding);
> > > +    }
> > >      *ip_tot_size = dp_packet_size(packet) - sizeof (struct
> eth_header);
> > >
> > >      memcpy(eth, header, size);
> > > --
> > > 2.14.1
> > >
> >
> >
> > --
> > Best regards, Tonghao
>
>
>
> --
> Best regards, Tonghao
>
diff mbox series

Patch

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index b89dfdd52..acfbb13c4 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -149,11 +149,15 @@  void *
 netdev_tnl_push_ip_header(struct dp_packet *packet,
                const void *header, int size, int *ip_tot_size)
 {
+    int padding = dp_packet_l2_pad_size(packet);
     struct eth_header *eth;
     struct ip_header *ip;
     struct ovs_16aligned_ip6_hdr *ip6;
 
     eth = dp_packet_push_uninit(packet, size);
+    if (padding) {
+        dp_packet_set_size(packet, dp_packet_size(packet) - padding);
+    }
     *ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header);
 
     memcpy(eth, header, size);