diff mbox series

[2.0,v2,2/4] linux-gen: pktio: move sysfs stats function prototype

Message ID 1509544807-5034-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [2.0,v2,1/4] linux-gen: pktio: move socket stats function prototypes | expand

Commit Message

Github ODP bot Nov. 1, 2017, 2 p.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Move sysfs stats function prototype from linux-generic version
of odp_packet_io_internal.h to a new header file.
This is part of an attempt to remove from linux-generic version
of odp_packet_io_internal.h all the references to symbols implemented
only in linux-generic platform before enabling it for linux-dpdk
platform as well.

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 267 (bogdanPricope:2_0_pktio_internal_pr)
 ** https://github.com/Linaro/odp/pull/267
 ** Patch: https://github.com/Linaro/odp/pull/267.patch
 ** Base sha: ca1be967bd4f6aec7dc99b72de643718cb8a32b8
 ** Merge commit sha: 29fab9a6071107a8bb565ceee1837755d3ca1eee
 **/
 platform/linux-generic/Makefile.am                 |  1 +
 .../linux-generic/include/odp_packet_io_internal.h |  3 ---
 platform/linux-generic/pktio/common.c              |  1 +
 platform/linux-generic/pktio/socket.c              |  1 +
 platform/linux-generic/pktio/socket_mmap.c         |  1 +
 platform/linux-generic/pktio/sysfs.c               |  1 +
 platform/linux-generic/pktio/sysfs.h               | 23 ++++++++++++++++++++++
 7 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 platform/linux-generic/pktio/sysfs.h
diff mbox series

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 277418142..db466dd2a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -177,6 +177,7 @@  noinst_HEADERS = \
 		  ${srcdir}/include/odp_packet_io_ring_internal.h \
 		  ${srcdir}/pktio/ethtool.h \
 		  ${srcdir}/pktio/common.h \
+		  ${srcdir}/pktio/sysfs.h \
 		  ${srcdir}/pktio/dpdk.h \
 		  ${srcdir}/include/odp_pktio_ops_ipc.h \
 		  ${srcdir}/include/odp_pktio_ops_loopback.h \
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index e078cc826..1302a59bf 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -147,9 +147,6 @@  static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena)
 	entry->s.cls_enabled = ena;
 }
 
-int sysfs_stats(pktio_entry_t *pktio_entry,
-		odp_pktio_stats_t *stats);
-
 int pktin_poll_one(int pktio_index,
 		   int rx_queue,
 		   odp_event_t evt_tbl[]);
diff --git a/platform/linux-generic/pktio/common.c b/platform/linux-generic/pktio/common.c
index 050d2d950..900dcbba2 100644
--- a/platform/linux-generic/pktio/common.c
+++ b/platform/linux-generic/pktio/common.c
@@ -11,6 +11,7 @@ 
 #include <odp_classification_internal.h>
 #include <pktio/ethtool.h>
 #include <pktio/common.h>
+#include <pktio/sysfs.h>
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c
index 7481f4f7f..d9f85b29a 100644
--- a/platform/linux-generic/pktio/socket.c
+++ b/platform/linux-generic/pktio/socket.c
@@ -47,6 +47,7 @@ 
 #include <odp/api/hints.h>
 #include <odp_pktio_ops_socket.h>
 #include <pktio/common.h>
+#include <pktio/sysfs.h>
 #include <pktio/ethtool.h>
 
 #include <protocols/eth.h>
diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c
index 67d2b9206..9b35d89fe 100644
--- a/platform/linux-generic/pktio/socket_mmap.c
+++ b/platform/linux-generic/pktio/socket_mmap.c
@@ -36,6 +36,7 @@ 
 #include <odp/api/hints.h>
 #include <odp_pktio_ops_socket.h>
 #include <pktio/common.h>
+#include <pktio/sysfs.h>
 #include <pktio/ethtool.h>
 
 #include <protocols/eth.h>
diff --git a/platform/linux-generic/pktio/sysfs.c b/platform/linux-generic/pktio/sysfs.c
index c3d4faea1..f674ac42c 100644
--- a/platform/linux-generic/pktio/sysfs.c
+++ b/platform/linux-generic/pktio/sysfs.c
@@ -8,6 +8,7 @@ 
 
 #include <odp_api.h>
 #include <odp_packet_io_internal.h>
+#include <pktio/sysfs.h>
 #include <errno.h>
 #include <string.h>
 #include <inttypes.h>
diff --git a/platform/linux-generic/pktio/sysfs.h b/platform/linux-generic/pktio/sysfs.h
new file mode 100644
index 000000000..f8fe3072a
--- /dev/null
+++ b/platform/linux-generic/pktio/sysfs.h
@@ -0,0 +1,23 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_PKTIO_SYSFS_H_
+#define ODP_PKTIO_SYSFS_H_
+
+/**
+ * Get statistics for a pktio entry
+ *
+ * @param pktio_entry     Packet IO entry
+ * @param stats[out]	   Output buffer for counters
+ *
+ * @retval 0 on success
+ * @retval != 0 on failure
+ */
+
+int sysfs_stats(pktio_entry_t *pktio_entry,
+		odp_pktio_stats_t *stats);
+
+#endif /* ODP_PKTIO_SYSFS_H_ */