From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id 98E44C326 for ; Fri, 13 Nov 2015 18:58:34 +0100 (CET) Received: by pasz6 with SMTP id z6so110196254pas.2 for ; Fri, 13 Nov 2015 09:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6eCR3yeNV9+meYuRa/5wKqxM6eJFVqrTVLvNiLraYqQ=; b=xgy7WWTQLJ+bLU7f4M9cx3NNcBG6jEghPYS4FKe0KkTJFLfhiUUmED8sOLU2CPhdeJ aZFuRfWbUPpdmH/9u+DMCZtqjCuwU6IYoIERts/FFsxZeI8somszIMehu32i9KSXiSDv KNZFF7yVw9cUcefuO6iB6jPobBmwd72QBCh91qiZTefXr84OXfOt1lHxIjv5taVh4pSO ktQzMS60XydAMg2TMJWP9GmiajHjGS8kscBYTSMsNUz2sPTX1p2LfD1JtVTKg9dAsvG1 a5pP25Q4qnM+MfGQ86/OkApSXb1ax41n5pfhf9QFSup81+vlYFk2XtEnPyapn4u2KcWJ M+fQ== 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=6eCR3yeNV9+meYuRa/5wKqxM6eJFVqrTVLvNiLraYqQ=; b=CSt+QtRxRSeFzsDXbk3FhBBglOz8e65A9NspN8ehRMAVZ4v04ixFOTN3yuyWAGVEso Ee5fstJ5UlUutjU2lRi/e3M3suJFxXplYYEhFyV87E/ZaS7s9vATOYnOPv9bHvweRH69 PcX/wysNC8CkuSiqcgbnWy4CZGZ52aUApgk2NDpcfVIrjyZG6echWsguCcmgnPQXQGmq /BE86kgGEc2eAbTgFSdmwwnP4W14CMuv8QYkXtptlRhXNrCgP74UI9Af9p9NWgL3JeuC jmnaoPpG/lMYR2TixtyJul8IaqE9ZU/qqMQ4JCEmZ9aZEUWsRRL6netwgdwgIBwYvabZ rv4w== X-Gm-Message-State: ALoCoQkHdFPkLB+oiaL6zPCqXlPc3mdx4eDAV1mdzrupZfz/0RdKexnl+OZvjOQbDamSjC6eVeqh X-Received: by 10.66.100.166 with SMTP id ez6mr34146072pab.49.1447437514057; Fri, 13 Nov 2015 09:58:34 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id bd10sm21603143pbd.29.2015.11.13.09.58.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 09:58:33 -0800 (PST) From: Stephen Hemminger To: cristian.dumitrescu@intel.com Date: Fri, 13 Nov 2015 09:58:36 -0800 Message-Id: <1447437516-19152-11-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447437516-19152-1-git-send-email-stephen@networkplumber.org> References: <1447437516-19152-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org, Stephen Hemminger Subject: [dpdk-dev] [PATCH v2 10/10] sched: allow more subports 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: Fri, 13 Nov 2015 17:58:35 -0000 From: Stephen Hemminger 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 --- 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