-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support using TLDK as gVisor plugin stack
This commit supports using TLDK-v2 as a third-party plugin network stack. - lib/libtle_glue/gvisor_glue.h: includes plugin stack interfaces defined by gVisor. - lib/libtle_glue/gvisor_glue_sockops.c: implements socket operations used by gVisor. - lib/libtle_glue/gvisor_glue_stackops.c: implements stack operations used by gVisor, including pre_initstack and initstack. Co-developed-by: Tianyu Zhou <albert.zty@antgroup.com> Co-developed-by: Jianfeng Tan <henry.tjf@antgroup.com> Signed-off-by: Anqi Shen <amy.saq@antgroup.com>
- Loading branch information
1 parent
78c896b
commit 9efb0da
Showing
23 changed files
with
4,160 additions
and
1,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
dpdk/dpdk-v18.11_patches/0001-eal-don-t-start-the-interrupt-mp-thread.patch
This file was deleted.
Oops, something went wrong.
95 changes: 95 additions & 0 deletions
95
dpdk/dpdk-v18.11_patches/0001-ip_frag-fix-IPv6-when-MTU-sizes-not-aligned-to-8.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
From b8d96c46dd4ba4c542d2df78db81ee607328c0a7 Mon Sep 17 00:00:00 2001 | ||
From: Chas Williams <chas3@att.com> | ||
Date: Sun, 12 Apr 2020 12:07:27 +0800 | ||
Subject: [PATCH] ip_frag: fix IPv6 when MTU sizes not aligned to 8 | ||
|
||
bytes The same issue was fixed on for the ipv4 version of this routine | ||
in commit 8d4d3a4f7337 ("ip_frag: handle MTU sizes not aligned to 8 bytes"). | ||
Briefly, the size of an ipv6 header is always 40 bytes. With an MTU of | ||
1500, this will never produce a multiple of 8 bytes for the frag_size | ||
and this routine can never succeed. Since RTE_ASSERTS are disabled by | ||
default, this failure is typically ignored. | ||
|
||
To fix this, round down to the nearest 8 bytes and use this when | ||
producing the fragments. | ||
|
||
Fixes: 0aa31d7a5929 ("ip_frag: add IPv6 fragmentation support") | ||
Cc: stable@dpdk.org | ||
|
||
Signed-off-by: Chas Williams <chas3@att.com> | ||
Acked-by: Luca Boccassi <bluca@debian.org> | ||
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> | ||
--- | ||
lib/librte_ip_frag/rte_ip_frag.h | 1 + | ||
lib/librte_ip_frag/rte_ipv6_fragmentation.c | 18 +++++++++++------- | ||
2 files changed, 12 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h | ||
index a4ccaf9d1..04fd9df52 100644 | ||
--- a/lib/librte_ip_frag/rte_ip_frag.h | ||
+++ b/lib/librte_ip_frag/rte_ip_frag.h | ||
@@ -115,6 +115,7 @@ struct rte_ip_frag_tbl { | ||
#define RTE_IPV6_EHDR_MF_MASK 1 | ||
#define RTE_IPV6_EHDR_FO_SHIFT 3 | ||
#define RTE_IPV6_EHDR_FO_MASK (~((1 << RTE_IPV6_EHDR_FO_SHIFT) - 1)) | ||
+#define RTE_IPV6_EHDR_FO_ALIGN (1 << RTE_IPV6_EHDR_FO_SHIFT) | ||
|
||
#define RTE_IPV6_FRAG_USED_MASK \ | ||
(RTE_IPV6_EHDR_MF_MASK | RTE_IPV6_EHDR_FO_MASK) | ||
diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c | ||
index 62a7e4e83..b9437eb11 100644 | ||
--- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c | ||
+++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c | ||
@@ -77,11 +77,14 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, | ||
uint32_t out_pkt_pos, in_seg_data_pos; | ||
uint32_t more_in_segs; | ||
uint16_t fragment_offset, frag_size; | ||
+ uint64_t frag_bytes_remaining; | ||
|
||
- frag_size = (uint16_t)(mtu_size - sizeof(struct ipv6_hdr)); | ||
- | ||
- /* Fragment size should be a multiple of 8. */ | ||
- RTE_ASSERT((frag_size & ~RTE_IPV6_EHDR_FO_MASK) == 0); | ||
+ /* | ||
+ * Ensure the IP payload length of all fragments (except the | ||
+ * the last fragment) are a multiple of 8 bytes per RFC2460. | ||
+ */ | ||
+ frag_size = RTE_ALIGN_FLOOR(mtu_size - sizeof(struct ipv6_hdr), | ||
+ RTE_IPV6_EHDR_FO_ALIGN); | ||
|
||
/* Check that pkts_out is big enough to hold all fragments */ | ||
if (unlikely (frag_size * nb_pkts_out < | ||
@@ -111,6 +114,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, | ||
/* Reserve space for the IP header that will be built later */ | ||
out_pkt->data_len = sizeof(struct ipv6_hdr) + sizeof(struct ipv6_extension_fragment); | ||
out_pkt->pkt_len = sizeof(struct ipv6_hdr) + sizeof(struct ipv6_extension_fragment); | ||
+ frag_bytes_remaining = frag_size; | ||
|
||
out_seg_prev = out_pkt; | ||
more_out_segs = 1; | ||
@@ -130,7 +134,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, | ||
|
||
/* Prepare indirect buffer */ | ||
rte_pktmbuf_attach(out_seg, in_seg); | ||
- len = mtu_size - out_pkt->pkt_len; | ||
+ len = frag_bytes_remaining; | ||
if (len > (in_seg->data_len - in_seg_data_pos)) { | ||
len = in_seg->data_len - in_seg_data_pos; | ||
} | ||
@@ -140,11 +144,11 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, | ||
out_pkt->pkt_len); | ||
out_pkt->nb_segs += 1; | ||
in_seg_data_pos += len; | ||
+ frag_bytes_remaining -= len; | ||
|
||
/* Current output packet (i.e. fragment) done ? */ | ||
- if (unlikely(out_pkt->pkt_len >= mtu_size)) { | ||
+ if (unlikely(frag_bytes_remaining == 0)) | ||
more_out_segs = 0; | ||
- } | ||
|
||
/* Current input segment done ? */ | ||
if (unlikely(in_seg_data_pos == in_seg->data_len)) { | ||
-- | ||
2.19.1.6.gb485710b | ||
|
25 changes: 0 additions & 25 deletions
25
dpdk/dpdk-v18.11_patches/0002-eal-prioritize-constructor.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 8c4cf399015681eb26487021854fd2c3f7da61b7 Mon Sep 17 00:00:00 2001 | ||
From: Jerin Jacob <jerinj@marvell.com> | ||
Date: Tue, 30 Jul 2019 16:34:06 +0530 | ||
Subject: [PATCH] net/virtio: fix build | ||
|
||
Add extern to variable declaration to avoid some compiler treating it | ||
as variable definition. | ||
|
||
build error log: | ||
|
||
lib/librte_pmd_virtio.a(vhost_kernel.o):(.rodata+0x110): | ||
multiple definition of `vhost_msg_strings' | ||
lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0): | ||
first defined here | ||
lib/librte_pmd_virtio.a(virtio_user_dev.o):(.rodata+0xe8): | ||
multiple definition of `vhost_msg_strings' | ||
lib/librte_pmd_virtio.a(vhost_user.o):(.data.rel.ro.local+0x0): | ||
first defined here | ||
|
||
Fixes: 33d24d65fe2b ("net/virtio-user: abstract backend operations") | ||
Cc: stable@dpdk.org | ||
|
||
Signed-off-by: Jerin Jacob <jerinj@marvell.com> | ||
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> | ||
--- | ||
drivers/net/virtio/virtio_user/vhost.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h | ||
index 83a85cc6f..fec85e2d6 100644 | ||
--- a/drivers/net/virtio/virtio_user/vhost.h | ||
+++ b/drivers/net/virtio/virtio_user/vhost.h | ||
@@ -67,7 +67,7 @@ enum vhost_user_request { | ||
VHOST_USER_MAX | ||
}; | ||
|
||
-const char * const vhost_msg_strings[VHOST_USER_MAX]; | ||
+extern const char * const vhost_msg_strings[VHOST_USER_MAX]; | ||
|
||
struct vhost_memory_region { | ||
uint64_t guest_phys_addr; | ||
-- | ||
2.19.1.6.gb485710b | ||
|
46 changes: 46 additions & 0 deletions
46
dpdk/dpdk-v18.11_patches/0003-PATCH-mk-disable-warning-for-packed-member-pointer.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From 1e0bcf34c6d9e3feaebb379caa9bd2c3aa734a46 Mon Sep 17 00:00:00 2001 | ||
From: Reshma Pattan <reshma.pattan@intel.com> | ||
Date: Thu, 2 May 2019 10:33:34 +0100 | ||
Subject: [PATCH] [PATCH] mk: disable warning for packed member pointer | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
gcc 9 on Fedora 30 gives an error | ||
"taking address of packed member may result in an | ||
unaligned pointer value" warnings. | ||
|
||
For clang builds this warning is already disabled, | ||
so disable "-Waddress-of-packed-member" for gcc builds | ||
also. | ||
|
||
Snippet of build error: | ||
lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’: | ||
lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: | ||
taking address of packed member of ‘struct rte_mem_config’ may result | ||
in an unaligned pointer value [-Werror=address-of-packed-member] | ||
768 | cur_msl = &mcfg->memsegs[msl_idx]; | ||
| ^~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> | ||
Tested-by: David Marchand <david.marchand@redhat.com> | ||
--- | ||
mk/toolchain/gcc/rte.vars.mk | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk | ||
index d8b99faf6..b852fcfd7 100644 | ||
--- a/mk/toolchain/gcc/rte.vars.mk | ||
+++ b/mk/toolchain/gcc/rte.vars.mk | ||
@@ -87,5 +87,8 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2 | ||
WERROR_FLAGS += -Wno-format-truncation | ||
endif | ||
|
||
+# disable packed member unalign warnings | ||
+WERROR_FLAGS += -Wno-address-of-packed-member | ||
+ | ||
export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF | ||
export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS | ||
-- | ||
2.19.1.6.gb485710b | ||
|
33 changes: 0 additions & 33 deletions
33
dpdk/dpdk-v18.11_patches/0003-mbuf-add-single-linked-list.patch
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.