DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: cristian.dumitrescu@intel.com
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: [dpdk-dev] [PATCH v2 10/10] sched: allow more subports
Date: Fri, 13 Nov 2015 09:58:36 -0800	[thread overview]
Message-ID: <1447437516-19152-11-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1447437516-19152-1-git-send-email-stephen@networkplumber.org>

From: Stephen Hemminger <shemming@brocade.com>

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>
---
 lib/librte_mbuf/rte_mbuf.h   |  5 ++++-
 lib/librte_sched/rte_sched.c | 14 +++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 4a93189..2dfcfef 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -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 */
 
diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c
index ff47198..dd3b8ba 100644
--- a/lib/librte_sched/rte_sched.c
+++ b/lib/librte_sched/rte_sched.c
@@ -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;
-- 
2.1.4

  parent reply	other threads:[~2015-11-13 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 17:58 [dpdk-dev] [PATCH v2 00/10] rte_sched: enhancements and cleanups Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 01/10] sched: drop deprecated port hierarchy structure Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 02/10] sched: cleanup comments Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 03/10] sched: make debugging configurable Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 04/10] sched: drop debug #ifdef's for credit check Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 05/10] sched: remove debug conditional code around ENQUEUE Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 06/10] sched: drop RTE_SCHED_WRR #define Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 07/10] sched: cleanup defined constants Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 08/10] sched: allow enabling SSE optimizations in config Stephen Hemminger
2015-11-13 17:58 ` [dpdk-dev] [PATCH v2 09/10] sched: fix coding style Stephen Hemminger
2015-11-13 17:58 ` Stephen Hemminger [this message]
2015-11-24 23:34 ` [dpdk-dev] [PATCH v2 00/10] rte_sched: enhancements and cleanups Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447437516-19152-11-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).