From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by dpdk.org (Postfix) with ESMTP id AE05C4F9B for ; Tue, 4 Sep 2018 09:10:48 +0200 (CEST) Received: by mail-pf1-f177.google.com with SMTP id i26-v6so1211665pfo.12 for ; Tue, 04 Sep 2018 00:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=saXJDORWKb77RlWzNFSe18BbyNH46U4cBEul0wRwrRs=; b=xYMjg6Ti+jyzJRAMfFteOumjsB0W7wyl4LVIDKHxURki0PAxLmOFHvtagHFjtzOFpR TgK60TYNwc8aGQhyzGPl0Qo1dFgh1VXGcLRmPj/Fvvce9Qoo54kTFKBXslI4DAeY6Mwm +pAc2utv8Z89xECIvctxGcqgHn/gLepCZkvO4LlHLksgyILilN479bJlbEn+QD6ABya7 xw2OLxB9T9+kx22wmesKltlhFwW+yd2OIpTreKYj4yZQxZvYS8VRLToBqy6T0OPKj/Cw Mm+Akt3mkihyoSR9scSxxWXWcUAHIwc2eCnqv9nTPANSpJ4Au91CDM4ix2ASkEWo064U yf0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=saXJDORWKb77RlWzNFSe18BbyNH46U4cBEul0wRwrRs=; b=pNuSNjdmtViTAlHMMGTdwuV2nGF119xuh6FrzoUCHf36vEh45QUfcsJiXadRmbVSPt IbNREjgpQhSCIHGJ1QqzJIFKs2KzcgYrVEvsWz4MC/BnbjYs9+bllRoVZ2qV5NaqPBWx Jlvhs1ulleTe/NvdPb1VPwt046CEaAqLMajQBiYWmiMg709JfXUvMsrpATPkVPwIAclE BRYiQtP6nj1/FgBS+ekfXLMzYYYu3dbdM1W+H41oMkxih+BDjoSMpScDw4AHI4FstlXu ymSz2Ag/s14qndNY/oa0i8G97qZ0D+fxaE5DVgmbquG5vZs7pdQC5pJEUnXZOKSpj/Ah iycw== X-Gm-Message-State: APzg51CigE+OAsYUiuJnOP2S4AHl4L3O6S/9IWEq8TqeY7DA8m3KCPRI dgQtRRLFy9hhBeoQ3/LDqH/Jocoxpg6tlA== X-Google-Smtp-Source: ANB0Vdbs33DniuhClK/o9EcvrgchlrR45HgZzqNccAC+lruQ3b45x17cFM7P6ko01DSjYhQcHut/BA== X-Received: by 2002:a63:24c4:: with SMTP id k187-v6mr25077289pgk.162.1536045047694; Tue, 04 Sep 2018 00:10:47 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id l79-v6sm31229451pfb.111.2018.09.04.00.10.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 00:10:46 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Yuval Caduri Date: Tue, 4 Sep 2018 09:10:15 +0200 Message-Id: <1536045016-32008-8-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536045016-32008-1-git-send-email-tdu@semihalf.com> References: <1536045016-32008-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH 7/8] net/mvpp2: detach tx_qos from rx cls/qos config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2018 07:10:49 -0000 From: Yuval Caduri Functional change: Open receive cls/qos related features, only if the config file contains an rx_related configuration entry. This allows to configure tx_related entries, w/o unintentionally opening rx cls/qos. Code: 'use_global_defaults' is by default set to '1'. Only if an rx_related entry was configured, it is updated to '0'. rx cls/qos is performed only if 'use_global_defaults' is '0'. Default TC configuration is now only mandatory when 'use_global_defaults' is '0'. Signed-off-by: Yuval Caduri Reviewed-by: Natalie Samsonov Tested-by: Natalie Samsonov --- drivers/net/mvpp2/mrvl_ethdev.c | 3 ++- drivers/net/mvpp2/mrvl_qos.c | 41 +++++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index a1dc6b1..5643e7d 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -602,7 +602,8 @@ mrvl_dev_start(struct rte_eth_dev *dev) } /* For default QoS config, don't start classifier. */ - if (mrvl_qos_cfg) { + if (mrvl_qos_cfg && + mrvl_qos_cfg->port[dev->data->port_id].use_global_defaults == 0) { ret = mrvl_start_qos_mapping(priv); if (ret) { MRVL_LOG(ERR, "Failed to setup QoS mapping"); diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c index e039635..5d80c3e 100644 --- a/drivers/net/mvpp2/mrvl_qos.c +++ b/drivers/net/mvpp2/mrvl_qos.c @@ -324,6 +324,7 @@ parse_tc_cfg(struct rte_cfgfile *file, int port, int tc, if (rte_cfgfile_num_sections(file, sec_name, strlen(sec_name)) <= 0) return 0; + cfg->port[port].use_global_defaults = 0; entry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_RXQ); if (entry) { n = get_entry_values(entry, @@ -421,7 +422,7 @@ parse_policer(struct rte_cfgfile *file, int port, const char *sec_name, cfg->port[port].policer_params.token_unit = PP2_CLS_PLCR_PACKETS_TOKEN_UNIT; } else { - RTE_LOG(ERR, PMD, "Unknown token: %s\n", entry); + MRVL_LOG(ERR, "Unknown token: %s", entry); return -1; } } @@ -438,7 +439,7 @@ parse_policer(struct rte_cfgfile *file, int port, const char *sec_name, cfg->port[port].policer_params.color_mode = PP2_CLS_PLCR_COLOR_AWARE_MODE; } else { - RTE_LOG(ERR, PMD, "Error in parsing: %s\n", entry); + MRVL_LOG(ERR, "Error in parsing: %s", entry); return -1; } } @@ -518,28 +519,15 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path, snprintf(sec_name, sizeof(sec_name), "%s %d %s", MRVL_TOK_PORT, n, MRVL_TOK_DEFAULT); + /* Use global defaults, unless an override occurs */ + (*cfg)->port[n].use_global_defaults = 1; + /* Skip ports non-existing in configuration. */ if (rte_cfgfile_num_sections(file, sec_name, strlen(sec_name)) <= 0) { - (*cfg)->port[n].use_global_defaults = 1; - (*cfg)->port[n].mapping_priority = - PP2_CLS_QOS_TBL_VLAN_IP_PRI; continue; } - entry = rte_cfgfile_get_entry(file, sec_name, - MRVL_TOK_DEFAULT_TC); - if (entry) { - if (get_val_securely(entry, &val) < 0 || - val > USHRT_MAX) - return -1; - (*cfg)->port[n].default_tc = (uint8_t)val; - } else { - MRVL_LOG(ERR, - "Default Traffic Class required in custom configuration!"); - return -1; - } - /* * Read per-port rate limiting. Setting that will * disable per-queue rate limiting. @@ -573,6 +561,7 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path, entry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_MAPPING_PRIORITY); if (entry) { + (*cfg)->port[n].use_global_defaults = 0; if (!strncmp(entry, MRVL_TOK_VLAN_IP, sizeof(MRVL_TOK_VLAN_IP))) (*cfg)->port[n].mapping_priority = @@ -602,6 +591,7 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path, entry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_DEFAULT); if (entry) { + (*cfg)->port[n].use_global_defaults = 0; if (get_val_securely(entry, &val) < 0) return -1; @@ -627,6 +617,21 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path, "Error %d parsing port %d tc %d!\n", ret, n, i); } + + entry = rte_cfgfile_get_entry(file, sec_name, + MRVL_TOK_DEFAULT_TC); + if (entry) { + if (get_val_securely(entry, &val) < 0 || + val > USHRT_MAX) + return -1; + (*cfg)->port[n].default_tc = (uint8_t)val; + } else { + if ((*cfg)->port[n].use_global_defaults == 0) { + MRVL_LOG(ERR, + "Default Traffic Class required in custom configuration!"); + return -1; + } + } } return 0; -- 2.7.4