* [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
@ 2019-05-16 11:21 Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:21 UTC (permalink / raw)
To: dev; +Cc: skori
Patchset contains below changes:
------------------------------------------------------------
1. Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags
during fragmentation and reassemble operation implicitly.
Because of this, application is forced to use checksum offload
whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags
in returned mbuf (reassembled or fragmented) so application will
never come to know that which offloads are enabled. So transmission may
gets failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
2. Enabling PKT_TX_IP_CKSUM into mbuf->ol_flags in fragmentation
and reassembly application itself.
Sunil Kumar Kori (3):
lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
examples/ip_fragmentation: Enabling IP checksum offload in mbuf
examples/ip_reassembly: Enabling IP checksum offload in mbuf
examples/ip_fragmentation/main.c | 7 +++++--
examples/ip_reassembly/main.c | 6 ++++++
lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 -
lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 ---
lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 ---
5 files changed, 11 insertions(+), 9 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
2019-05-16 11:21 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
@ 2019-05-16 11:21 ` Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
2 siblings, 0 replies; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:21 UTC (permalink / raw)
To: dev; +Cc: skori
Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags
during fragmentation and reassemble operation implicitly.
Because of this, application is forced to use checksum offload
whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags
in returned mbuf (reassembled or fragmented) so application will never
come to know that which offloads are enabled. So transmission may be failed
for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
Change-Id: I151272e75b8bfb776278f00455b34e399e4c38bc
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 -
lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 ---
lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 ---
3 files changed, 7 deletions(-)
diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
index a96fb03..13e60fb 100644
--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
@@ -173,7 +173,6 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num)
fragment_offset = (uint16_t)(fragment_offset +
out_pkt->pkt_len - sizeof(struct ipv4_hdr));
- out_pkt->ol_flags |= PKT_TX_IP_CKSUM;
out_pkt->l3_len = sizeof(struct ipv4_hdr);
/* Write the fragment to the output list */
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index 1029b7a..4e20431 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -66,9 +66,6 @@ struct rte_mbuf *
m = fp->frags[IP_FIRST_FRAG_IDX].mb;
fp->frags[IP_FIRST_FRAG_IDX].mb = NULL;
- /* update mbuf fields for reassembled packet. */
- m->ol_flags |= PKT_TX_IP_CKSUM;
-
/* update ipv4 header for the reassembled packet */
ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);
diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
index 855e3f7..eb8b849 100644
--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
@@ -89,9 +89,6 @@ struct rte_mbuf *
m = fp->frags[IP_FIRST_FRAG_IDX].mb;
fp->frags[IP_FIRST_FRAG_IDX].mb = NULL;
- /* update mbuf fields for reassembled packet. */
- m->ol_flags |= PKT_TX_IP_CKSUM;
-
/* update ipv6 header for the reassembled datagram */
ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, m->l2_len);
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
2019-05-16 11:21 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
@ 2019-05-16 11:21 ` Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
2 siblings, 0 replies; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:21 UTC (permalink / raw)
To: dev; +Cc: skori
Change-Id: I616dc217a96f0bd4c77dd70959dff3c208524f84
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
examples/ip_fragmentation/main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..d821967 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
/* src addr */
ether_addr_copy(&ports_eth_addr[port_out], ð_hdr->s_addr);
- if (ipv6)
+ if (ipv6) {
eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv6);
- else
+ m->ol_flags |= PKT_TX_IPV6;
+ } else {
eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
+ m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
+ }
}
len += len2;
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf
2019-05-16 11:21 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
@ 2019-05-16 11:21 ` Sunil Kumar Kori
2 siblings, 0 replies; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:21 UTC (permalink / raw)
To: dev; +Cc: skori
Change-Id: Idce2db6b3e9437bcbe1ff42281fde42f36902c24
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
examples/ip_reassembly/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..686e364 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = {
struct ether_hdr *);
ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
}
+
+ /* update offloading flags */
+ m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
}
ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
@@ -391,6 +394,9 @@ struct rte_lpm6_config lpm6_config = {
eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
}
+
+ /* update offloading flags */
+ m->ol_flags |= PKT_TX_IPV6;
}
/* Find destination port */
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
@ 2019-05-16 11:24 Sunil Kumar Kori
2019-05-16 11:24 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf Sunil Kumar Kori
0 siblings, 1 reply; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
To: dev; +Cc: skori
Patchset contains below changes:
------------------------------------------------------------
1. Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags
during fragmentation and reassemble operation implicitly.
Because of this, application is forced to use checksum offload
whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags
in returned mbuf (reassembled or fragmented) so application will never
come to know that which offloads are enabled. So transmission may gets
failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
2. Enabling PKT_TX_IP_CKSUM into mbuf->ol_flags at fragmentation
and reassembly application itself.
Sunil Kumar Kori (3):
lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
examples/ip_fragmentation: Enabling IP checksum offload in mbuf
examples/ip_reassembly: Enabling IP checksum offload in mbuf
examples/ip_fragmentation/main.c | 7 +++++--
examples/ip_reassembly/main.c | 6 ++++++
lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 -
lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 ---
lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 ---
5 files changed, 11 insertions(+), 9 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf
2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
@ 2019-05-16 11:24 ` Sunil Kumar Kori
0 siblings, 0 replies; 5+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
To: dev; +Cc: skori
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
examples/ip_reassembly/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..686e364 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = {
struct ether_hdr *);
ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
}
+
+ /* update offloading flags */
+ m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
}
ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
@@ -391,6 +394,9 @@ struct rte_lpm6_config lpm6_config = {
eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
}
+
+ /* update offloading flags */
+ m->ol_flags |= PKT_TX_IPV6;
}
/* Find destination port */
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-05-16 11:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 11:21 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
2019-05-16 11:21 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:24 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf Sunil Kumar Kori
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).