From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by dpdk.org (Postfix) with ESMTP id C70D22A66 for ; Sun, 1 Feb 2015 11:04:04 +0100 (CET) Received: by mail-la0-f47.google.com with SMTP id hz20so32726498lab.6 for ; Sun, 01 Feb 2015 02:04:04 -0800 (PST) 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=Aisnv1Z2YjwwASR5xihCkrsOx7rN+GbAuPvhP3ORrt8=; b=WYxYMI9ILVJI+CkYoSipnUmyGoCK0/LKD4rGzSTRF+sGC07p/3QQxuv+q5mv3R0lWw wuMrKH8b0bF1Ij/q1I+eV12kiJN2SY4mpqOresGkf6PA5BI5CcBnwrINoHSImqbo4UYJ 1chkb17YLbqAPwnO6ZGAzHjOstu+2Q7jIr7NGyUrv7A5w5ZSmBmWgRX+7JQgFecw7hsn u84SnPEFJ/5RJB5NzKQa6tXLOiWNjz0PpEu5anGY2cHNSkyseQXF8zo7pRU2oGul2iYh W50LP/5pMa5mKm93y9eHZIpDuFtESZRKKNYB5XfNrkzSTqN4X2nkfhrfwFqGCouyZZKY CEkg== X-Gm-Message-State: ALoCoQk70v9OeTjLKb/DpvYcKchszcJYyssC+wEoC1c8zShCAWYtTc+j4sgXzlGTJRc5y7YJY0BJ X-Received: by 10.112.25.104 with SMTP id b8mr14291856lbg.69.1422785044639; Sun, 01 Feb 2015 02:04:04 -0800 (PST) Received: from uryu.fosdem.net. ([2001:67c:1810:f0ff:c685:8ff:feca:841f]) by mx.google.com with ESMTPSA id c4sm1608100lbp.32.2015.02.01.02.04.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Feb 2015 02:04:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Date: Sun, 1 Feb 2015 10:03:46 +0000 Message-Id: <1422785031-11494-2-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1422785031-11494-1-git-send-email-stephen@networkplumber.org> References: <1422785031-11494-1-git-send-email-stephen@networkplumber.org> Cc: Stephen Hemminger Subject: [dpdk-dev] [PATCH 2/7] rte_sched: use reserved field to allow 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: Sun, 01 Feb 2015 10:04:05 -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 reserved field of mbuf for this field instead of packing inside other classify portions. Signed-off-by: Stephen Hemminger --- lib/librte_mbuf/rte_mbuf.h | 2 +- lib/librte_sched/rte_sched.h | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 16059c6..b6b08f4 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -242,7 +242,7 @@ struct rte_mbuf { uint16_t data_len; /**< Amount of data in segment buffer. */ uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ uint16_t vlan_tci; /**< VLAN Tag Control Identifier (CPU order) */ - uint16_t reserved; + uint16_t subport; /**< SCHED Subport ID */ union { uint32_t rss; /**< RSS hash result if RSS enabled */ struct { diff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h index e6bba22..0688422 100644 --- a/lib/librte_sched/rte_sched.h +++ b/lib/librte_sched/rte_sched.h @@ -195,15 +195,18 @@ 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 extra:6; /**< currently unused */ uint32_t color:2; /**< Color */ }; @@ -350,12 +353,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; + pkt->subport = subport; sched->color = (uint32_t) color; - sched->subport = subport; sched->pipe = pipe; sched->traffic_class = traffic_class; sched->queue = queue; @@ -379,11 +385,14 @@ 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; + *subport = pkt->subport; *pipe = sched->pipe; *traffic_class = sched->traffic_class; *queue = sched->queue; -- 2.1.4