From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 4CDDB187 for ; Mon, 30 Apr 2018 16:43:36 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id m70so13231118wma.2 for ; Mon, 30 Apr 2018 07:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N1g/EV3bwcKIhSsw7kBN7kA1hKlpdMbSu0NGeWhbLK0=; b=Zb/DN20koRP5D8Da20oqUbxehwXPS6RoLnUwrmQHsKKiOaSEPLtfIkozuW94Qiikkj QSLPIMCb4JervvywhNXxZL3wZbVjk4m9+7Jn1r+NSHPSp6AMhXXUVZHThfszBwTPOU56 bTFL2qm1VW6j2lJ66Zg/PNxrVV/WikIb0nfN0s01QLFtYVG9CMNQ47XQbCsBy0Gb3SYX MtOaFRZUq63VLctj1ldYG6MyRQ85+RL7KyqQsHOKHHWrT20g+y2hQjHHtYPvZolPQlZz aY8ZAPb8/DxhtqDsU92IMAL1l2J9yEZQdb3ETMQ28IfVoUFtKjINIEmBOFtCnM1a+Gop 5mgw== 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=N1g/EV3bwcKIhSsw7kBN7kA1hKlpdMbSu0NGeWhbLK0=; b=EnkUgZdsmoqzoOJsb+jc81UDjoaMmwMDaYl8YsvhG88nFrR7QATjOmrfPK2AXHgl5q aeal4KcVT0ohSZyrRA/KRCmtMMQvi3pX9oYjbmpTbrXpJNwXHS787hb7LvXXL5EeyG2M zR4DeVBtf6GD1mCXb5Kj5oJm29Zn3b4j69FuvQzsU8P06M8Zd3ggrNJ7hZAplJL+rYCS 8drjsVVAvZVIBNsCZdzx8N11HPaEKTSa+pi9yFKmJYC/Gd4ZgOe3i0cDjU8xi0qq236n pGCS7T//gSXFgwA5P3W4dZmK3PhqTjdsHgTRCxyuc+VEoaHr9hesKx6qe6YCIRbe3dw/ podA== X-Gm-Message-State: ALQs6tBcSTP6ULxvJE0i4gI6nZAOvkIxekNhW5Ot+UmQDqvhl+YKAPN5 Zd0NHyZ5SHWQdkRcwPVupYY= X-Google-Smtp-Source: AB8JxZqDJa+KD2jvOp7KMZZ6buI4k+covgSKBD2SqY2gofazTW+5W31B4UepMY9l6kxr6yRCmEOVzQ== X-Received: by 10.28.160.26 with SMTP id j26mr7028223wme.74.1525099415857; Mon, 30 Apr 2018 07:43:35 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id z63-v6sm9562187wrb.34.2018.04.30.07.43.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:43:34 -0700 (PDT) From: luca.boccassi@gmail.com To: Wei Zhao Cc: Yuan Peng , Qi Zhang , dpdk stable Date: Mon, 30 Apr 2018 15:40:59 +0100 Message-Id: <20180430144223.18657-44-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/i40e: add comment and clean code for flow RSS' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:43:36 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 603920cdfa22c80afe3622d44b43c2a5daddeadb Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Wed, 11 Apr 2018 11:24:32 +0800 Subject: [PATCH] net/i40e: add comment and clean code for flow RSS [ upstream commit 17d5c9234b85b8fc8ca19f91f3f326d398421d39 ] This patch add comment for flow rss parse function in order to explain some important info. This patch also delete some useless code for queue index check for RSS queue region configuration. Fixes: ecad87d22383 ("net/i40e: move RSS to flow API") Signed-off-by: Wei Zhao Tested-by: Yuan Peng Acked-by: Qi Zhang --- drivers/net/i40e/i40e_flow.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 31d7b8857..c1b3ef4bb 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4170,6 +4170,19 @@ i40e_flow_parse_rss_pattern(__rte_unused struct rte_eth_dev *dev, return 0; } +/** + * This function is used to parse rss queue index, total queue number and + * hash functions, If the purpose of this configuration is for queue region + * configuration, it will set queue_region_conf flag to TRUE, else to FALSE. + * In queue region configuration, it also need to parse hardware flowtype + * and user_priority from configuration, it will also cheeck the validity + * of these parameters. For example, The queue region sizes should + * be any of the following values: 1, 2, 4, 8, 16, 32, 64, the + * hw_flowtype or PCTYPE max index should be 63, the user priority + * max index should be 7, and so on. And also, queue index should be + * continuous sequence and queue region index should be part of rss + * queue index for this port. + */ static int i40e_flow_parse_rss_action(struct rte_eth_dev *dev, const struct rte_flow_action *actions, @@ -4215,6 +4228,12 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, } } + /** + * Do some queue region related parameters check + * in order to keep queue index for queue region to be + * continuous sequence and also to be part of RSS + * queue index for this port. + */ if (conf_info->queue_region_number) { for (i = 0; i < rss->num; i++) { for (j = 0; j < rss_info->num; j++) { @@ -4241,6 +4260,7 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, } } + /* Parse queue region related parameters from configuration */ for (n = 0; n < conf_info->queue_region_number; n++) { if (conf_info->region[n].user_priority_num || conf_info->region[n].flowtype_num) { @@ -4263,17 +4283,6 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, return -rte_errno; } - if (rss_info->num < rss->num || - rss->queue[0] < rss_info->queue[0] || - (rss->queue[0] + rss->num > - rss_info->num + rss_info->queue[0])) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "no valid queues"); - return -rte_errno; - } - for (i = 0; i < info->queue_region_number; i++) { if (info->region[i].queue_num == rss->num && info->region[i].queue_start_index == @@ -4328,6 +4337,9 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, rss_config->queue_region_conf = TRUE; } + /** + * Return function if this flow is used for queue region configuration + */ if (rss_config->queue_region_conf) return 0; @@ -4348,6 +4360,8 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, return -rte_errno; } } + + /* Parse RSS related parameters from configuration */ if (rss->rss_conf) rss_config->rss_conf = *rss->rss_conf; else -- 2.14.2