diff mbox series

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

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

Commit Message

Github ODP bot Nov. 9, 2017, noon 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: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: 02aa905e6f9d4be66e19ccdb577e40a293be2902
 **/
 platform/linux-generic/odp_packet.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index 3b2fac212..84790ba23 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -1284,6 +1284,14 @@  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, odp_packet_data_range_t *range)
+{
+	(void)pkt;
+	range->length = 0;
+	range->offset = 0;
+	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);