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(+)
> >>> 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
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:
> >
> 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->
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
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
-
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
-
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
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
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
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
11 matches
Mail list logo