summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
diff options
context:
space:
mode:
authorHarry van Haaren <harry.van.haaren@intel.com>2019-01-11 11:32:39 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-14 16:03:28 +0100
commit6af649a44c4ccc6a830bab2d6c928776b99b934c (patch)
tree859e9d6265829e09987ba32a2a6825ef3549475b /lib/librte_mbuf
parentba07193e0343680ae5665efd45ecc41c0ec0059d (diff)
downloaddpdk-6af649a44c4ccc6a830bab2d6c928776b99b934c.zip
dpdk-6af649a44c4ccc6a830bab2d6c928776b99b934c.tar.gz
dpdk-6af649a44c4ccc6a830bab2d6c928776b99b934c.tar.xz
mbuf: fix C++ compatibility by making sched struct visible
Although C compilation works with the struct rte_mbuf_sched declared inside the struct rte_mbuf namespace, C++ fails to compile. This fix moves the rte_mbuf_sched struct up to the global namespace, instead of declaring it inside the struct mbuf namespace. The struct rte_mbuf_sched is being used on the stack in rte_mbuf_sched_get() and as a cast in _set(). For this reason, it must be exposed as an available type. Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'lib/librte_mbuf')
-rw-r--r--lib/librte_mbuf/rte_mbuf.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index bc562dc..d53b682 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -468,6 +468,17 @@ __extension__
typedef uint64_t MARKER64[0]; /**< marker that allows us to overwrite 8 bytes
* with a single assignment */
+struct rte_mbuf_sched {
+ uint32_t queue_id; /**< Queue ID. */
+ uint8_t traffic_class;
+ /**< Traffic class ID. Traffic class 0
+ * is the highest priority traffic class.
+ */
+ uint8_t color;
+ /**< Color. @see enum rte_color.*/
+ uint16_t reserved; /**< Reserved. */
+}; /**< Hierarchical scheduler */
+
/**
* The generic rte_mbuf, containing a packet mbuf.
*/
@@ -574,16 +585,8 @@ struct rte_mbuf {
* on PKT_RX_FDIR_* flag in ol_flags.
*/
} fdir; /**< Filter identifier if FDIR enabled */
- struct rte_mbuf_sched {
- uint32_t queue_id; /**< Queue ID. */
- uint8_t traffic_class;
- /**< Traffic class ID. Traffic class 0
- * is the highest priority traffic class.
- */
- uint8_t color;
- /**< Color. @see enum rte_color.*/
- uint16_t reserved; /**< Reserved. */
- } sched; /**< Hierarchical scheduler */
+ struct rte_mbuf_sched sched;
+ /**< Hierarchical scheduler : 8 bytes */
struct {
uint32_t reserved1;
uint16_t reserved2;