diff mbox series

[v1,1/9] linux-gen: pktio: introduce generic pktio_ops data storage

Message ID 1508414408-10456-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/9] linux-gen: pktio: introduce generic pktio_ops data storage | expand

Commit Message

Github ODP bot Oct. 19, 2017, noon UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


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

---
/** Email created from pull request 241 (bogdanPricope:2_0_pktio_ops_pr)
 ** https://github.com/Linaro/odp/pull/241
 ** Patch: https://github.com/Linaro/odp/pull/241.patch
 ** Base sha: 76f82972ecb51aa64215c97cb3d7f94e5de980f9
 ** Merge commit sha: 24c411a2875cbcd686833666d481a0197cc82e90
 **/
 platform/linux-dpdk/include/odp_packet_io_internal.h     | 5 ++++-
 platform/linux-generic/include/odp_packet_io_internal.h  | 5 ++++-
 platform/linux-generic/include/odp_pktio_ops_subsystem.h | 7 +++++++
 3 files changed, 15 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h
index 10760ca47..d31c449e2 100644
--- a/platform/linux-dpdk/include/odp_packet_io_internal.h
+++ b/platform/linux-dpdk/include/odp_packet_io_internal.h
@@ -42,7 +42,10 @@  typedef union pktio_entry_u pktio_entry_t;
 
 struct pktio_entry {
 	const pktio_ops_module_t *ops;	/**< Implementation specific methods */
-	pktio_ops_data_t ops_data;
+	union {
+		pktio_ops_data_t ops_data;
+		uint8_t _ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE];
+	};
 	/* These two locks together lock the whole pktio device */
 	odp_ticketlock_t rxl;		/**< RX ticketlock */
 	odp_ticketlock_t txl;		/**< TX ticketlock */
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index dacea47c9..79f5b1082 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -50,7 +50,10 @@  typedef union pktio_entry_u pktio_entry_t;
 
 struct pktio_entry {
 	const pktio_ops_module_t *ops;	/**< Implementation specific methods */
-	pktio_ops_data_t ops_data;	/**< IO operation specific data */
+	union {
+		pktio_ops_data_t ops_data;  /**< IO operation specific data */
+		uint8_t _ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE];
+	};
 	/* These two locks together lock the whole pktio device */
 	odp_ticketlock_t rxl;		/**< RX ticketlock */
 	odp_ticketlock_t txl;		/**< TX ticketlock */
diff --git a/platform/linux-generic/include/odp_pktio_ops_subsystem.h b/platform/linux-generic/include/odp_pktio_ops_subsystem.h
index 3843ac709..07c5dbee7 100644
--- a/platform/linux-generic/include/odp_pktio_ops_subsystem.h
+++ b/platform/linux-generic/include/odp_pktio_ops_subsystem.h
@@ -105,4 +105,11 @@  typedef union {
 /* Extract pktio ops data from pktio entry structure */
 #define ops_data(mod) s.ops_data.mod
 
+/* Maximum size of pktio specific ops data.*/
+#define ODP_PKTIO_ODPS_DATA_MAX_SIZE 80000
+
+/* Extract pktio ops data from pktio entry structure */
+#define odp_ops_data(_p, _mod) \
+	((pktio_ops_ ## _mod ## _data_t *)(uintptr_t)_p->s._ops_data)
+
 #endif