Introduce pktio offload functions api to enable and disable
such offload features like rx and tx check sum, tso, gro, lro
and etc..
Getting state of that features if needed might be retrieved with
odp_pktio_print().

Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
---
 include/odp/api/spec/packet_io.h         |   1 +
 include/odp/api/spec/packet_io_offload.h | 140 +++++++++++++++++++++++++++++++
 platform/Makefile.inc                    |   1 +
 3 files changed, 142 insertions(+)
 create mode 100644 include/odp/api/spec/packet_io_offload.h

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 6fe2cac..b237a58 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -18,6 +18,7 @@
 extern "C" {
 #endif
 
+#include <odp/api/spec/packet_io_offload.h>
 #include <odp/api/spec/packet_io_stats.h>
 #include <odp/api/spec/queue.h>
 
diff --git a/include/odp/api/spec/packet_io_offload.h 
b/include/odp/api/spec/packet_io_offload.h
new file mode 100644
index 0000000..ba19af6
--- /dev/null
+++ b/include/odp/api/spec/packet_io_offload.h
@@ -0,0 +1,140 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Packet IO
+ */
+
+#ifndef ODP_API_PACKET_IO_OFFLOAD_H_
+#define ODP_API_PACKET_IO_OFFLOAD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @addtogroup odp_packet_io
+ *  @{
+ */
+
+/**
+ * Specifies whether RX checksumming should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_rx_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether TX checksumming should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_tx_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether TCP segmentation offload should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_tso_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether UDP fragmentation offload should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_ufo_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether generic segmentation offload should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_gso_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether generic receive offload should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_gro_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether large receive offload should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_lro_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether RX VLAN acceleration should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_rxvlan_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * Specifies whether RX VLAN acceleration should be enabled.
+ *
+ * @param[in]  pktio           Ingress port pktio handle.
+ * @param[in]  enable          1 - enable.
+ *                             0 - disable.
+ *
+ * @retval                     0 on success
+ * @retval                     !0 on failure
+ */
+int odp_pktio_offload_txvlan_set(odp_pktio_t pktio, odp_bool_t enable);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 62375a6..3138de8 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -41,6 +41,7 @@ odpapispecinclude_HEADERS = \
                  $(top_srcdir)/include/odp/api/spec/packet.h \
                  $(top_srcdir)/include/odp/api/spec/packet_flags.h \
                  $(top_srcdir)/include/odp/api/spec/packet_io.h \
+                 $(top_srcdir)/include/odp/api/spec/packet_io_offload.h \
                  $(top_srcdir)/include/odp/api/spec/packet_io_stats.h \
                  $(top_srcdir)/include/odp/api/spec/pool.h \
                  $(top_srcdir)/include/odp/api/spec/queue.h \
-- 
2.7.1.250.gff4ea60

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to