aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2014-11-20 11:44:12 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-11-21 18:38:20 +0300
commit553a993f5e323e89050b0f7b74009e9b4227157c (patch)
treeb9409d7f9fa6308be81f8e19f9878440f4b90bc1 /platform/linux-generic/include
parent7c671645c1478dcabc2288c7d736e5bca4888037 (diff)
pktio: add MTU manipulation functions
Implement pktio mtu functions: odp_pktio_mtu() to get mtu value; odp_pktio_set_mtu() to set mtu value. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'platform/linux-generic/include')
-rw-r--r--platform/linux-generic/include/api/odp_packet_io.h23
-rw-r--r--platform/linux-generic/include/odp_packet_io_internal.h4
2 files changed, 27 insertions, 0 deletions
diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h
index 47daeda30..667395c3f 100644
--- a/platform/linux-generic/include/api/odp_packet_io.h
+++ b/platform/linux-generic/include/api/odp_packet_io.h
@@ -126,6 +126,29 @@ void odp_pktio_set_input(odp_packet_t pkt, odp_pktio_t id);
odp_pktio_t odp_pktio_get_input(odp_packet_t pkt);
/**
+ * Configure the MTU for a packet IO interface.
+ *
+ * @param[in] id ODP packet IO handle.
+ * @param[in] mtu The value of MTU that the interface will be configured to
+ * use.
+ *
+ * @retval 0 on success.
+ * @retval -1 if specified mtu can not be handled.
+ * @retval -1 on any other error or illegal input parameters.
+ */
+int odp_pktio_set_mtu(odp_pktio_t id, int mtu);
+
+/**
+ * Return the currently configured MTU value of a packet IO interface.
+ *
+ * @param[in] id ODP packet IO handle.
+ *
+ * @retval MTU value >0 on success.
+ * @retval -1 on any error or not existance pktio id.
+ */
+int odp_pktio_mtu(odp_pktio_t id);
+
+/**
* @}
*/
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index 23633ed69..0bc1e2197 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -21,6 +21,8 @@ extern "C" {
#include <odp_spinlock.h>
#include <odp_packet_socket.h>
+#include <linux/if.h>
+
/**
* Packet IO types
*/
@@ -38,6 +40,8 @@ struct pktio_entry {
odp_pktio_type_t type; /**< pktio type */
pkt_sock_t pkt_sock; /**< using socket API for IO */
pkt_sock_mmap_t pkt_sock_mmap; /**< using socket mmap API for IO */
+ char name[IFNAMSIZ]; /**< name of pktio provided to
+ pktio_open() */
};
typedef union {