diff mbox series

[v3,WIP,3/7] linux-gen: pktio: introduce checksum settings

Message ID 1515884413-15125-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,WIP,1/7] validation: ipsec: fix packet checksums | expand

Commit Message

Github ODP bot Jan. 13, 2018, 11 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 389 (lumag:parse-checksums)
 ** https://github.com/Linaro/odp/pull/389
 ** Patch: https://github.com/Linaro/odp/pull/389.patch
 ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea
 ** Merge commit sha: e6a448356c90f142122e5b5d4796bdf19e04e8c6
 **/
 platform/linux-generic/include/odp_packet_io_internal.h | 1 +
 platform/linux-generic/odp_packet_io.c                  | 6 ++++++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index 25e037182..851515810 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -151,6 +151,7 @@  struct pktio_entry {
 	odp_pktio_config_t config;	/**< Device configuration */
 	classifier_t cls;		/**< classifier linked with this pktio*/
 	odp_pktio_stats_t stats;	/**< statistic counters for pktio */
+	odp_proto_chksums_t in_chksums; /**< Checksums validation settings */
 	enum {
 		STATS_SYSFS = 0,
 		STATS_ETHTOOL,
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index ffbc73b26..1f1d46423 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -432,6 +432,12 @@  int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config)
 
 	entry->s.config = *config;
 
+	entry->s.in_chksums.all_chksum = 0;
+	entry->s.in_chksums.chksum.ipv4 = config->pktin.bit.ipv4_chksum;
+	entry->s.in_chksums.chksum.tcp = config->pktin.bit.tcp_chksum;
+	entry->s.in_chksums.chksum.udp = config->pktin.bit.udp_chksum;
+	entry->s.in_chksums.chksum.sctp = config->pktin.bit.sctp_chksum;
+
 	if (entry->s.ops->config)
 		res = entry->s.ops->config(entry, config);