]> git.droids-corp.org - dpdk.git/commitdiff
sched: allow more subports
authorStephen Hemminger <shemming@brocade.com>
Fri, 13 Nov 2015 17:58:36 +0000 (09:58 -0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 24 Nov 2015 23:59:58 +0000 (00:59 +0100)
Increase the number of possible subports per port to allow up to 16 bits.
It is still possible that this will require excessive RAM.

Although mbuf structure is changed, it is ABI compatiable since it
just expands existing sched part of structure to overlap pre-existing hole
in the hash element of structure.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
doc/guides/rel_notes/deprecation.rst
lib/librte_mbuf/rte_mbuf.h
lib/librte_sched/rte_sched.c

index 549ecb91027e1e532717f224f0bb379e10e36bb6..dcd17cf96426609a7119e9de31bc20bc3ed3a765 100644 (file)
@@ -12,12 +12,6 @@ Deprecation Notices
   ibadcrc, ibadlen, imcasts, fdirmatch, fdirmiss,
   tx_pause_xon, rx_pause_xon, tx_pause_xoff, rx_pause_xoff
 
-* The scheduler hierarchy structure (rte_sched_port_hierarchy) will change to
-  allow for a larger number of subport entries.
-  The number of available traffic_classes and queues may also change.
-  The mbuf structure element for sched hierarchy will also change from a single
-  32 bit to a 64 bit structure.
-
 * The scheduler statistics structure will change to allow keeping track of
   RED actions.
 
index 4a9318927122450391c65f2ab6721f5e819eb5ce..08717a26be33f2488f6c4527fc37cb222dedd450 100644 (file)
@@ -799,7 +799,10 @@ struct rte_mbuf {
                        /**< First 4 flexible bytes or FD ID, dependent on
                             PKT_RX_FDIR_* flag in ol_flags. */
                } fdir;           /**< Filter identifier if FDIR enabled */
-               uint32_t sched;   /**< Hierarchical scheduler */
+               struct {
+                       uint32_t lo;
+                       uint32_t hi;
+               } sched;          /**< Hierarchical scheduler */
                uint32_t usr;     /**< User defined tags. See rte_distributor_process() */
        } hash;                   /**< hash information */
 
index ff471982143eec33c42567ad6b758bc018ead95a..15cd297bbdb7beb019a73ee5062e0566a08699be 100644 (file)
@@ -152,11 +152,12 @@ enum grinder_state {
  * by scheduler enqueue.
  */
 struct rte_sched_port_hierarchy {
-       uint32_t queue:2;                /**< Queue ID (0 .. 3) */
-       uint32_t traffic_class:2;        /**< Traffic class ID (0 .. 3)*/
-       uint32_t pipe:20;                /**< Pipe ID */
-       uint32_t subport:6;              /**< Subport ID */
+       uint16_t queue:2;                /**< Queue ID (0 .. 3) */
+       uint16_t traffic_class:2;        /**< Traffic class ID (0 .. 3)*/
        uint32_t color:2;                /**< Color */
+       uint16_t unused:10;
+       uint16_t subport;                /**< Subport ID */
+       uint32_t pipe;                   /**< Pipe ID */
 };
 
 struct rte_sched_grinder {
@@ -292,8 +293,9 @@ rte_sched_port_check_params(struct rte_sched_port_params *params)
        if (params->mtu == 0)
                return -5;
 
-       /* n_subports_per_port: non-zero, power of 2 */
+       /* n_subports_per_port: non-zero, limited to 16 bits, power of 2 */
        if (params->n_subports_per_port == 0 ||
+           params->n_subports_per_port > 1u << 16 ||
            !rte_is_power_of_2(params->n_subports_per_port))
                return -6;
 
@@ -916,6 +918,8 @@ rte_sched_port_pkt_write(struct rte_mbuf *pkt,
        struct rte_sched_port_hierarchy *sched
                = (struct rte_sched_port_hierarchy *) &pkt->hash.sched;
 
+       RTE_BUILD_BUG_ON(sizeof(*sched) > sizeof(pkt->hash.sched));
+
        sched->color = (uint32_t) color;
        sched->subport = subport;
        sched->pipe = pipe;