From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 90EC09AA5 for ; Tue, 10 Mar 2015 17:13:48 +0100 (CET) Received: by pabrd3 with SMTP id rd3so3440232pab.5 for ; Tue, 10 Mar 2015 09:13:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WSYNRps4YWfIZoB3k+nawejXBlrPqOYl1xJb76kb49c=; b=i73687gn0HPH2ScC+XUnzEHvI+QQUaZ6OuqXkfcJcfrQJnck6/4PIYBUaSVCMdrHw6 BfIf+0P9xf8XLoRA3PwVbUwiS+3NQ3LdKGBo889kWy8J4GUzibGUVQF85x/4enj2cJQ+ X4PJpKVJlQJcdICPnZ3wzmd+qzSff6P+zmq+C5I5oNGKWP7oMbsPUdZDxLTgLWdMcDPA 9GPjng0i1YywFD/Phu5vkPed5PeyEMavfDk6ppaNJJoMe5/qAJpnP9yclQ6iUeDTzF7m ryf+DFlbuwvNokVfCdblO4eCrHBkSpZsfp2G1psS+yLyqZORPh3NyQn1O8Uo4JBjKulY iEbg== X-Gm-Message-State: ALoCoQmQwh4XJTE9/8TPo9SLJLKayAav8q9Rm6MPChKVr3gwI50TixfQ9UsYXhJ6KKiAKp4iOFS8 X-Received: by 10.66.178.139 with SMTP id cy11mr66948673pac.146.1426004027804; Tue, 10 Mar 2015 09:13:47 -0700 (PDT) Received: from urahara.brocade.com (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id c8sm1836209pds.5.2015.03.10.09.13.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 09:13:46 -0700 (PDT) From: Stephen Hemminger To: cristian.dumitrescu@intel.com Date: Tue, 10 Mar 2015 09:13:35 -0700 Message-Id: <1426004018-25948-4-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426004018-25948-1-git-send-email-stephen@networkplumber.org> References: <1426004018-25948-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org, Stephen Hemminger Subject: [dpdk-dev] [PATCH v2 3/6] rte_sched: expand scheduler hierarchy for more VLAN's X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 16:13:49 -0000 From: Stephen Hemminger The QoS subport is limited to 8 bits in original code. But customers demanded ability to support full number of VLAN's (4096) therefore use the full part of the tag field of mbuf. Resize the pipe as well to allow for more pipes in future and avoid expensive bitfield access. Signed-off-by: Stephen Hemminger --- v2 -- no changes lib/librte_mbuf/rte_mbuf.h | 7 +++++-- lib/librte_sched/rte_sched.h | 38 ++++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 17ba791..ef420ec 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -284,8 +284,11 @@ 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 */ - uint32_t usr; /**< User defined tags. See rte_distributor_process() */ + struct { + uint32_t lo; + uint32_t hi; + } sched; /**< Hierarchical scheduler */ + uint32_t usr; /**< User defined tags. See rte_distributor_process */ } hash; /**< hash information */ uint32_t seqn; /**< Sequence number. See also rte_reorder_insert() */ diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index e6bba22..dda287f 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -195,16 +195,20 @@ struct rte_sched_port_params { #endif }; -/** Path through the scheduler hierarchy used by the scheduler enqueue operation to -identify the destination queue for the current packet. Stored in the field hash.sched -of struct rte_mbuf of each packet, typically written by the classification stage and read by -scheduler enqueue.*/ +/* + * Path through the scheduler hierarchy used by the scheduler enqueue + * operation to identify the destination queue for the current + * packet. Stored in the field pkt.hash.sched of struct rte_mbuf of + * each packet, typically written by the classification stage and read + * 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 */ - uint32_t color:2; /**< Color */ + uint16_t queue:2; /**< Queue ID (0 .. 3) */ + uint16_t traffic_class:2; /**< Traffic class ID (0 .. 3)*/ + uint16_t color:2; /**< Color */ + uint16_t unused:10; + uint16_t subport; /**< Subport ID */ + uint32_t pipe; /**< Pipe ID */ }; /* @@ -350,12 +354,15 @@ rte_sched_queue_read_stats(struct rte_sched_port *port, */ static inline void rte_sched_port_pkt_write(struct rte_mbuf *pkt, - uint32_t subport, uint32_t pipe, uint32_t traffic_class, uint32_t queue, enum rte_meter_color color) + uint32_t subport, uint32_t pipe, + uint32_t traffic_class, + uint32_t queue, enum rte_meter_color color) { - struct rte_sched_port_hierarchy *sched = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; + struct rte_sched_port_hierarchy *sched + = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; - sched->color = (uint32_t) color; sched->subport = subport; + sched->color = (uint32_t) color; sched->pipe = pipe; sched->traffic_class = traffic_class; sched->queue = queue; @@ -379,9 +386,12 @@ rte_sched_port_pkt_write(struct rte_mbuf *pkt, * */ static inline void -rte_sched_port_pkt_read_tree_path(struct rte_mbuf *pkt, uint32_t *subport, uint32_t *pipe, uint32_t *traffic_class, uint32_t *queue) +rte_sched_port_pkt_read_tree_path(struct rte_mbuf *pkt, uint32_t *subport, + uint32_t *pipe, uint32_t *traffic_class, + uint32_t *queue) { - struct rte_sched_port_hierarchy *sched = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; + struct rte_sched_port_hierarchy *sched + = (struct rte_sched_port_hierarchy *) &pkt->hash.sched; *subport = sched->subport; *pipe = sched->pipe; -- 2.1.4