diff mbox series

[API-NEXT,v2,2/3] linux-gen: packet: dummy ones complement implementation

Message ID 1508752825-12017-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v2,1/3] api: packet: ones complement sum | expand

Commit Message

Github ODP bot Oct. 23, 2017, 10 a.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Added dummy implementation of ones complement calls. Linux
generic implementation does not calculate the sum for all
incoming packets as it would be wasteful in SW. It's better
to wait until application asks it with odp_chksum_ones_comp16().
Later on, the sum could be stored into the packet header,
if we found a way to get it from the HW.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 242 (psavol:next-checksum-metadata)
 ** https://github.com/Linaro/odp/pull/242
 ** Patch: https://github.com/Linaro/odp/pull/242.patch
 ** Base sha: ec6510b33e8b96d6d6670efb9dc3c9101baed6c6
 ** Merge commit sha: 19351e51472213736d5301c666500b459ccabff7
 **/
 platform/linux-generic/odp_packet.c       | 6 ++++++
 platform/linux-generic/odp_packet_flags.c | 6 ++++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 603ac7181..1ad51339d 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -1255,6 +1255,12 @@  int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset)
 	return 0;
 }
 
+uint16_t odp_packet_ones_comp(odp_packet_t pkt)
+{
+	(void)pkt;
+	return 0;
+}
+
 void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash)
 {
 	odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c
index 2e26ad601..1436bf303 100644
--- a/platform/linux-generic/odp_packet_flags.c
+++ b/platform/linux-generic/odp_packet_flags.c
@@ -143,6 +143,12 @@  int odp_packet_has_icmp(odp_packet_t pkt)
 	retflag(pkt, input_flags.icmp);
 }
 
+int odp_packet_has_ones_comp(odp_packet_t pkt)
+{
+	(void)pkt;
+	return 0;
+}
+
 odp_packet_color_t odp_packet_color(odp_packet_t pkt)
 {
 	retflag(pkt, input_flags.color);