From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by dpdk.org (Postfix) with ESMTP id 23B3B2F4F for ; Tue, 4 Sep 2018 15:49:31 +0200 (CEST) Received: by mail-lj1-f174.google.com with SMTP id j19-v6so3206035ljc.7 for ; Tue, 04 Sep 2018 06:49:31 -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=wOWtIt8B3+69tGWGzL5gnyddKFlJ16dKw+5GCWTsrVfMnX87VLwE+IZzxkDPDAWHWJ dzKyQ8loO+eilXbbbQXqot+fZqxoVTnoZtio5t8I/o7TftWvKaGqJJ7eZigxpqIwLGkC wKVy4DL2GRa2jL0OzUbJiVwpvVqk3i4YhbZKQaSX9wgxr7GqNIdBrN7IeIQuwgF+MKxB V4XEUfLe+6zsCnj+RUjwCbpi8rHrEAA7LwR2zPzYhl2FSjq7PEd3Zjwv2kbSWyZktYMv WdKt3chHJs8fvqoe4rPwL46O+0hH8mNY5Cm31IpG3EF5OvtXgspcFb24/wLRImac4ZSC +NQg== 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=bYRVTuyKJA2PWB8meexr0a8zW8YQ2378cKGUfrmQ8MTJIYgWKpeq5gzKZbyWuqUQYA UQjfl08sljShpu98wkwE/qBJUic1ABCkXqlTFd9moQMpakxJMEz0OPRATfuYAf/XFfy5 GYTRCWWF/jg3dru/KwL5arOoVuzr9aavPK7+ccJugRAfe2dozt5GqTkhA+qOz9yxXYwh iXCcCGe0IdgtffDwLVsg0RhibWDzCjFZXSscgaXOtkwOMZDz5Nc+b3D7IhQeDx0vIsQd 147c4PVaA3fWUQK2sosDY26e2MkmJ6jWOv5iv/6KJaRbkR9qbkTdLdVXvxhVeOvP7S7L 3Hdg== X-Gm-Message-State: APzg51BvxgnrdRRwLyCDJzT5AtjXOsPAPGPUHt7XHaB58y8Jl7bgPoNr xs4Wk4aRAlPu7yMTkNMAlNa5a6wUN/gdGA== X-Google-Smtp-Source: ANB0VdZlEZ6lZabel4fj2daqIYQg1Us7gUf5yDQ3LTXll0EB9O/nAepS+erGlRD3suj2dH4SnYQpkA== X-Received: by 2002:a2e:8e81:: with SMTP id z1-v6mr3156797ljk.156.1536068970611; Tue, 04 Sep 2018 06:49:30 -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 q22-v6sm4057225lff.10.2018.09.04.06.49.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 06:49:29 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Yuval Caduri Date: Tue, 4 Sep 2018 15:49:08 +0200 Message-Id: <1536068953-9352-8-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536068953-9352-1-git-send-email-tdu@semihalf.com> References: <1536045016-32008-1-git-send-email-tdu@semihalf.com> <1536068953-9352-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 07/12] 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 13:49:31 -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