From patchwork Sun Feb 1 10:03:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 2891 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 586CF3772; Sun, 1 Feb 2015 11:04:17 +0100 (CET) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by dpdk.org (Postfix) with ESMTP id 796C23772 for ; Sun, 1 Feb 2015 11:04:16 +0100 (CET) Received: by mail-la0-f47.google.com with SMTP id hz20so32727065lab.6 for ; Sun, 01 Feb 2015 02:04:16 -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=DJfpXQjUTDg1AjhEybK6R73E37S8poGqyBieVL1ZePY=; b=mgcYAZEXL0SeYkw3wcXwzGk+2nwszVwW90ytEi6ZImfFPy1Pz9rtdsxp0hZFWlDkTx OZ/1X2Y/tC6ni53Dl8puBHuwZ0EnUi/XNRTc7d+/lE8vslS/kaM6LCO3CmKZ2VemISzK RpwKkPoQIMyS0VxEB1IzGdSAkKm/N40X6xdEXhZPprqjO0O3h0zQxFxSbp635NF6jS01 S+J+EubeHd+QZTUs+IvEdtWp3QdzOebJq2dCB5/U6t9lzhmaS9jf7pN2p09ZZv95wie4 l9L+kmm11sbfbMmRkI4X2kF13t6QoOHXH7OWMp8rJcPTl5oRKi1l/qGJ9xC3xwX46SRi 5O6g== X-Gm-Message-State: ALoCoQmYLvTRe9z638t6IxAFsM6x+zmgJ15+PEhIOMb4mGK/uCTlxrIgwSztuugv8t1fRwxg2+Er X-Received: by 10.152.2.226 with SMTP id 2mr13959848lax.67.1422785056340; Sun, 01 Feb 2015 02:04:16 -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.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Feb 2015 02:04:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Date: Sun, 1 Feb 2015 10:03:51 +0000 Message-Id: <1422785031-11494-7-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 7/7] rte_sched: rearrange data structures 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger Rearrange internal data structures to eliminate holes. Signed-off-by: Stephen Hemminger --- lib/librte_sched/rte_sched.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 3023457..7de1395 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -198,6 +198,8 @@ struct rte_sched_grinder { enum grinder_state state; uint32_t productive; uint32_t pindex; + uint32_t qpos; + struct rte_sched_subport *subport; struct rte_sched_pipe *pipe; struct rte_sched_pipe_profile *pipe_params; @@ -212,11 +214,10 @@ struct rte_sched_grinder { uint32_t tc_index; struct rte_sched_queue *queue[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; struct rte_mbuf **qbase[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; + struct rte_mbuf *pkt; uint32_t qindex[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; - uint16_t qsize; uint32_t qmask; - uint32_t qpos; - struct rte_mbuf *pkt; + uint16_t qsize; /* WRR */ uint16_t wrr_tokens[RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS]; @@ -234,9 +235,7 @@ struct rte_sched_port { uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; uint32_t n_pipe_profiles; uint32_t pipe_tc3_rate_max; -#ifdef RTE_SCHED_RED - struct rte_red_config red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][e_RTE_METER_COLORS]; -#endif + uint32_t busy_grinders; /* Timing */ uint64_t time_cpu_cycles; /* Current CPU time measured in CPU cyles */ @@ -247,16 +246,15 @@ struct rte_sched_port { /* Scheduling loop detection */ uint32_t pipe_loop; uint32_t pipe_exhaustion; + uint32_t n_pkts_out; /* Bitmap */ struct rte_bitmap *bmp; + struct rte_mbuf **pkts_out; uint32_t grinder_base_bmp_pos[RTE_SCHED_PORT_N_GRINDERS] __rte_aligned_16; /* Grinders */ struct rte_sched_grinder grinder[RTE_SCHED_PORT_N_GRINDERS]; - uint32_t busy_grinders; - struct rte_mbuf **pkts_out; - uint32_t n_pkts_out; /* Queue base calculation */ uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE]; @@ -270,6 +268,9 @@ struct rte_sched_port { struct rte_sched_pipe_profile *pipe_profiles; uint8_t *bmp_array; struct rte_mbuf **queue_array; +#ifdef RTE_SCHED_RED + struct rte_red_config red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][e_RTE_METER_COLORS]; +#endif uint8_t memory[0] __rte_cache_aligned; } __rte_cache_aligned;