diff mbox series

[2.0,v2,1/4] linux-gen: pktio: move socket stats function prototypes

Message ID 1509544807-5034-2-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 socket stats function prototypes from linux-generic version
of odp_packet_io_internal.h.
This is part of an attempt to remove from this header file 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
 **/
 .../linux-generic/include/odp_packet_io_internal.h |  4 ----
 platform/linux-generic/pktio/common.c              | 10 +++++++++
 platform/linux-generic/pktio/common.h              | 25 ++++++++++++++++++++++
 3 files changed, 35 insertions(+), 4 deletions(-)
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 b26a35d25..e078cc826 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -149,10 +149,6 @@  static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena)
 
 int sysfs_stats(pktio_entry_t *pktio_entry,
 		odp_pktio_stats_t *stats);
-int sock_stats_fd(pktio_entry_t *pktio_entry,
-		  odp_pktio_stats_t *stats,
-		  int fd);
-int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd);
 
 int pktin_poll_one(int pktio_index,
 		   int rx_queue,
diff --git a/platform/linux-generic/pktio/common.c b/platform/linux-generic/pktio/common.c
index 4c952e467..050d2d950 100644
--- a/platform/linux-generic/pktio/common.c
+++ b/platform/linux-generic/pktio/common.c
@@ -21,6 +21,11 @@ 
 #include <linux/if_packet.h>
 #include <linux/if_ether.h>
 
+/*
+ * ODP_PACKET_SOCKET_MMSG:
+ * ODP_PACKET_SOCKET_MMAP:
+ * ODP_PACKET_NETMAP:
+ */
 int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd)
 {
 	int err = 0;
@@ -51,6 +56,11 @@  int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd)
 	return err;
 }
 
+/*
+ * ODP_PACKET_SOCKET_MMSG:
+ * ODP_PACKET_SOCKET_MMAP:
+ * ODP_PACKET_NETMAP:
+ */
 int sock_stats_fd(pktio_entry_t *pktio_entry,
 		  odp_pktio_stats_t *stats,
 		  int fd)
diff --git a/platform/linux-generic/pktio/common.h b/platform/linux-generic/pktio/common.h
index 2940af143..025e1893d 100644
--- a/platform/linux-generic/pktio/common.h
+++ b/platform/linux-generic/pktio/common.h
@@ -78,4 +78,29 @@  int rss_conf_set_fd(int fd, const char *name,
  */
 void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto);
 
+/**
+ * Get statistics for pktio entry
+ *
+ * @param pktio_entry     Packet IO entry
+ * @param stats[out]	   Output buffer for counters
+ * @param fd              Socket file descriptor
+ *
+ * @retval 0 on success
+ * @retval != 0 on failure
+ */
+int sock_stats_fd(pktio_entry_t *pktio_entry,
+		  odp_pktio_stats_t *stats,
+		  int fd);
+
+/**
+ * Reset statistics for pktio entry
+ *
+ * @param pktio_entry     Packet IO entry
+ * @param fd              Socket file descriptor
+ *
+ * @retval  0 on success
+ * @retval != 0 on failure
+ */
+int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd);
+
 #endif /*ODP_PKTIO_COMMON_H_*/