From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by dpdk.org (Postfix) with ESMTP id 5F4FEB41E for ; Thu, 5 Feb 2015 07:14:20 +0100 (CET) Received: by pdjz10 with SMTP id z10so5719136pdj.13 for ; Wed, 04 Feb 2015 22:14:19 -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=fhW2Qwa/4JqlrduYa/r2+yBXJ5tSgUsEmQCQnXnUk6GJuU9wLA9+n13e15LyGXLzqW k8iGHccCt9ldcS+zxnU77Xl1XymsxCxBKLWQEx9aWx2MpCLKcDSxwdfTNPbsbT0+f2bz rt5BaLWJIh3dbtCyFX/VqX/ZHp+DPapF28iqkZb+ObkdP1n3oVv7XwONlKdrk7gKAN6Y /0DH8D3F8y/D5Sner4RwUIdUjWZwzaiHNkIUgcnZDd9KmwWFkCYFVNFj7LPxuKgwJ7Xq 8lyI/QQ1oPIz67mg8AmzGibJuFPE316oiZKZKrBDgfmvOQ8stiUblRmJmvyF6myxAalO VdTA== X-Gm-Message-State: ALoCoQlErXCsIOKAVEHl5GlvQ1MKrGEhefKPrO45fS7TingNOgx41bpw6E/mYO8bwmlXqkFbK6ms X-Received: by 10.68.246.133 with SMTP id xw5mr3416639pbc.34.1423116859792; Wed, 04 Feb 2015 22:14:19 -0800 (PST) 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 ib3sm3848178pbc.41.2015.02.04.22.14.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 22:14:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Date: Wed, 4 Feb 2015 22:14:01 -0800 Message-Id: <1423116841-19799-7-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423116841-19799-4-git-send-email-stephen@networkplumber.org> References: <1423116841-19799-4-git-send-email-stephen@networkplumber.org> Cc: Stephen Hemminger Subject: [dpdk-dev] [PATCH v2 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: , X-List-Received-Date: Thu, 05 Feb 2015 06:14:20 -0000 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; -- 2.1.4