From: Andrzej Ostruszka <amo@semihalf.com>
To: dev@dpdk.org
Cc: mw@semihalf.com, nadavh@marvell.com, Yuval Caduri <cyuval@marvell.com>
Subject: [dpdk-dev] [PATCH v3 07/13] net/mvpp2: detach Tx QoS from Rx cls/QoS config
Date: Tue, 25 Sep 2018 09:05:03 +0200 [thread overview]
Message-ID: <1537859109-25659-8-git-send-email-amo@semihalf.com> (raw)
In-Reply-To: <1537859109-25659-1-git-send-email-amo@semihalf.com>
From: Yuval Caduri <cyuval@marvell.com>
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 <cyuval@marvell.com>
Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
Tested-by: Natalie Samsonov <nsamsono@marvell.com>
---
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 4d1e84a..64c6f0f 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -593,7 +593,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
next prev parent reply other threads:[~2018-09-25 7:05 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 7:10 [dpdk-dev] [PATCH 0/8] net/mvpp2: add new features Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 1/8] net/mvpp2: initialize ppio only once Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 2/8] net/mvpp2: move common code Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 3/8] net/mvpp2: add metering support Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 4/8] net/mvpp2: change default policer configuration Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 5/8] net/mvpp2: add init and deinit to flow Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 6/8] net/mvpp2: add traffic manager support Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 7/8] net/mvpp2: detach tx_qos from rx cls/qos config Tomasz Duszynski
2018-09-04 7:10 ` [dpdk-dev] [PATCH 8/8] net/mvpp2: update MTU and MRU related calculations Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 00/12] net/mvpp2: add new features Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 01/12] net/mvpp2: initialize ppio only once Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 02/12] net/mvpp2: move common code Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 03/12] net/mvpp2: add metering support Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 04/12] net/mvpp2: change default policer configuration Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 05/12] net/mvpp2: add init and deinit to flow Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 06/12] net/mvpp2: add traffic manager support Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 07/12] net/mvpp2: detach tx_qos from rx cls/qos config Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 08/12] net/mvpp2: update MTU and MRU related calculations Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 09/12] net/mvpp2: align with MUSDK 18.09 Tomasz Duszynski
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 10/12] net/mvpp2: align documentation " Tomasz Duszynski
2018-09-19 17:15 ` Ferruh Yigit
2018-09-23 22:40 ` Thomas Monjalon
2018-09-24 11:36 ` Ferruh Yigit
2018-09-24 11:51 ` Marcin Wojtas
2018-09-24 12:38 ` Ferruh Yigit
2018-09-24 12:44 ` Thomas Monjalon
2018-09-24 12:48 ` Marcin Wojtas
2018-09-24 12:50 ` Ferruh Yigit
2018-09-24 13:11 ` Andrzej Ostruszka
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 11/12] net/mvpp2: document MTR and TM usage Tomasz Duszynski
2018-09-23 22:45 ` Thomas Monjalon
2018-09-04 13:49 ` [dpdk-dev] [PATCH v2 12/12] net/mvpp2: add Tx S/G support Tomasz Duszynski
2018-09-19 17:24 ` [dpdk-dev] [PATCH v2 00/12] net/mvpp2: add new features Ferruh Yigit
2018-09-25 7:04 ` [dpdk-dev] [PATCH v3 00/13] " Andrzej Ostruszka
2018-09-25 7:04 ` [dpdk-dev] [PATCH v3 01/13] net/mvpp2: initialize ppio only once Andrzej Ostruszka
2018-09-25 7:04 ` [dpdk-dev] [PATCH v3 02/13] net/mvpp2: move common code Andrzej Ostruszka
2018-09-25 7:04 ` [dpdk-dev] [PATCH v3 03/13] net/mvpp2: add metering support Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 04/13] net/mvpp2: change default policer configuration Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 05/13] net/mvpp2: add init and deinit to flow Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 06/13] net/mvpp2: add traffic manager support Andrzej Ostruszka
2018-09-25 7:05 ` Andrzej Ostruszka [this message]
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 08/13] net/mvpp2: update MTU and MRU related calculations Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 09/13] net/mvpp2: align with MUSDK 18.09 Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 10/13] crypto/mvsam: get number of CIOs dynamically Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 11/13] net/mvpp2: align documentation with MUSDK 18.09 Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 12/13] net/mvpp2: document MTR and TM usage Andrzej Ostruszka
2018-09-25 7:05 ` [dpdk-dev] [PATCH v3 13/13] net/mvpp2: add Tx scatter/gather support Andrzej Ostruszka
2018-09-25 16:12 ` [dpdk-dev] [PATCH v3 00/13] net/mvpp2: add new features Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1537859109-25659-8-git-send-email-amo@semihalf.com \
--to=amo@semihalf.com \
--cc=cyuval@marvell.com \
--cc=dev@dpdk.org \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).