[PATCH] ipsec: fix NAT-T length calculation

2023-04-18 Thread Xiao Liang
UDP header length is included in sa->hdr_len. Take care of that in L3 header and pakcet length calculation. Fixes: 01eef5907fc3 ("ipsec: support NAT-T") Signed-off-by: Xiao Liang --- lib/ipsec/esp_outb.c | 2 +- lib/ipsec/sa.c | 2 +- 2 files changed, 2 insertions(+)

Re: [EXT] [PATCH] ipsec: fix NAT-T length calculation

2023-07-06 Thread Xiao Liang
> >>> struct > >>> rte_ipsec_sa_prm *prm) > >>> > >>> /* update l2_len and l3_len fields for outbound mbuf */ > >>> sa->tx_offload.val = rte_mbuf_tx_offload(sa->hdr_l3_off, > >>> - sa->hdr_len - sa->hdr_l3_off, 0, 0, 0, 0, 0); > >>> + prm->tun.hdr_len - sa->hdr_l3_off, 0, 0, 0, 0, 0); > >>> > >>> esp_outb_init(sa, sa->hdr_len, prm->ipsec_xform.esn.value); > >>> } Again sa->hdr_len includes UDP header, which is not part of L3, so use the original prm->tun.hdr_len. Thanks, Xiao Liang

Re: [EXT] [PATCH] ipsec: fix NAT-T length calculation

2023-07-06 Thread Xiao Liang
kt_len - sqh_len - sa->hdr_len + sizeof(struct rte_udp_hdr); and l3_len = prm->tun.hdr_len - sa->hdr_l3_off; Correct me if anything wrong. Thanks, Xiao Liang On Thu, Jul 6, 2023 at 6:20 PM Radu Nicolau wrote: > > > On 06-Jul-23 10:08 AM, Konstantin Ananyev wrote: > >

Re: [EXT] [PATCH] ipsec: fix NAT-T length calculation

2023-07-07 Thread Xiao Liang
> sa->hdr_len and prm->tun.hdr_len don't include L2 length so both should > start in the diagram at the end of the ETH header. > > So the right way to compute datagram length is > > dgram_len = mb->pkt_len - sqh_len - sa->hdr_l3_off - sa->hdr_len + > sizeof(struct rte_udp_hdr) > |<- mb->

Re: [EXT] [PATCH] ipsec: fix NAT-T length calculation

2023-07-07 Thread Xiao Liang
included in sa->hdr_len. Even if hdr_len doesn't include L2, then mb->pkt_len won't either, so UDP datagram length should still be mb->pkt_len - sqh_len - sa->hdr_len + sizeof(struct rte_udp_hdr); On Fri, Jul 7, 2023 at 8:51 PM Xiao Liang wrote: > > > sa->hdr

[PATCH v2] ipsec: fix NAT-T header length calculation

2023-07-10 Thread Xiao Liang
UDP header and L2 header (if any) length is included in sa->hdr_len. Take care of that in L3 header and pakcet length caculation. Fixes: 01eef5907fc3 ("ipsec: support NAT-T") Cc: sta...@dpdk.org Signed-off-by: Xiao Liang Acked-by: Konstantin Ananyev Acked-by: Radu Nicolau -

[PATCH v2] ipsec: fix NAT-T header length calculation

2023-07-10 Thread Xiao Liang
UDP header and L2 header (if any) length is included in sa->hdr_len. Take care of that in L3 header and pakcet length calculation. Fixes: 01eef5907fc3 ("ipsec: support NAT-T") Cc: sta...@dpdk.org Signed-off-by: Xiao Liang Acked-by: Konstantin Ananyev Acked-by: Radu Nicolau -

[dpdk-dev] [PATCH] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8

2018-12-18 Thread Xiao Liang
ndo_change_mtu_rh74 ^~~ Signed-off-by: Xiao Liang --- kernel/linux/kni/compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 5aadebbcd..bc81d0c8d 100644 --- a/kernel/linux/kni/c

[dpdk-dev] [PATCH] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8

2018-12-18 Thread Xiao Liang
ndo_change_mtu_rh74 ^~~ Signed-off-by: Xiao Liang --- kernel/linux/kni/compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 5aadebbcd..bc81d0c8d 100644 --- a/kernel/linux/kni/c

[dpdk-dev] [PATCH v2] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8

2018-12-18 Thread Xiao Liang
ndo_change_mtu_rh74 ^~~ Signed-off-by: Xiao Liang --- kernel/linux/kni/compat.h | 3 ++- kernel/linux/kni/ethtool/igb/kcompat.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/comp

[dpdk-dev] [PATCH v2] kni:fix build failure as "ndo_change_mtu_rh74" not found in RHEL8

2018-12-18 Thread Xiao Liang
ndo_change_mtu_rh74 ^~~ Signed-off-by: Xiao Liang --- kernel/linux/kni/compat.h | 3 ++- kernel/linux/kni/ethtool/igb/kcompat.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/comp