From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78E62A0093 for ; Tue, 19 May 2020 15:07:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F2F31D678; Tue, 19 May 2020 15:07:55 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 64FE11D67E for ; Tue, 19 May 2020 15:07:54 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id u188so3508395wmu.1 for ; Tue, 19 May 2020 06:07:54 -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 :mime-version:content-transfer-encoding; bh=ZP56R3hXTAmtAxKWkwUDYy3i3VidCN9oUtJjN0ontSI=; b=Etp395ioVxhIE8F4BUwkRCMx3SejXecUgr6Ync7mebMQ0BfO8rpFN4VMbCSjF5eLEK okPXGgrBzpn5y55znVhlGK71CNOCcLWR+PbKkzXL52LZLqEuN1qKvfhZGVDuELdnGY9i Bpj1fPJyZz6e2PL34qMpPj+kLHg+BG9vgrRrIDd3PCr3/pE1FsyXPIv1h9C+Vsh/MFyl Ath9e4IWZlSaMpkrrhZc9UyvmoePzJc9/bi7fZabBAwMr2OKQkHU1evXBfVaV//sDuwt SosShrtpInvoUiuW6LRst5sqVfovPi+/IfkHPmdCTA7jP+7mXnDd7TBTSU0buqKTg66i f5hw== 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:mime-version:content-transfer-encoding; bh=ZP56R3hXTAmtAxKWkwUDYy3i3VidCN9oUtJjN0ontSI=; b=mwZL7KQYHMgy/3lGhRWyqb+seVCSo8jbx6ke4QTJbb1xKYRmE8TqmC/rv6ci51Q9si D67R5EUI5GyvCiQPYEwl+1H2afdgs0r28wl1uxnI8cGY/IUaLd8GrkbQvfgJEEXt1d9u YlcxdvHkliZTJYJi/G8Z/U1ZZjgBjyvtO4b0xAbqO4lS71ojQ66u03K7uxTmfoSqHOTw yD91a3I3+o7iM7Geebbq4AhaJfUCgWyDuP0a4JTjFy3xg3GtOH1sW2Oy+KpUhgSCToxz siSEjCyv7hqWSc3Kh+C5A1V61nXQKmVR+FGY4i7gYMgrnjfTSIDVKc7u8nqftTtfgAfV w23w== X-Gm-Message-State: AOAM531k6vymxgYyVuj3wCwrg4vRHLAb6wLRPyxbcIhEotjiU8JlcDTH bkWt1LQmwHpAsOpfm6ZeTRA= X-Google-Smtp-Source: ABdhPJwbFS5KG5XJdnS7q7UNX/riVXEia+D0mmtVTkQmB849Ajudsxc661P8g3aDOCViLgocc0iulQ== X-Received: by 2002:a1c:2bc2:: with SMTP id r185mr5704941wmr.49.1589893673547; Tue, 19 May 2020 06:07:53 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 1sm4104104wmz.13.2020.05.19.06.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:07:53 -0700 (PDT) From: luca.boccassi@gmail.com To: Wei Zhao Cc: Qi Zhang , dpdk stable Date: Tue, 19 May 2020 14:02:55 +0100 Message-Id: <20200519130549.112823-40-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: add action number check for switch' has been queued to stable release 19.11.3 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 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/21/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 175dc210ad7793de6ce5d1d1522642bb58f61e9a Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 3 Apr 2020 12:46:02 +0800 Subject: [PATCH] net/ice: add action number check for switch [ upstream commit 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b ] The action number can only be one for DCF or PF switch filter, not support multiple actions. Fixes: 47d460d63233 ("net/ice: rework switch filter") Signed-off-by: Wei Zhao Acked-by: Qi Zhang --- drivers/net/ice/ice_switch_filter.c | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 1db3db43c2..0d88e0bd7e 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -997,6 +997,46 @@ error: return -rte_errno; } +static int +ice_switch_check_action(const struct rte_flow_action *actions, + struct rte_flow_error *error) +{ + const struct rte_flow_action *action; + enum rte_flow_action_type action_type; + uint16_t actions_num = 0; + + for (action = actions; action->type != + RTE_FLOW_ACTION_TYPE_END; action++) { + action_type = action->type; + switch (action_type) { + case RTE_FLOW_ACTION_TYPE_VF: + case RTE_FLOW_ACTION_TYPE_RSS: + case RTE_FLOW_ACTION_TYPE_QUEUE: + case RTE_FLOW_ACTION_TYPE_DROP: + actions_num++; + break; + case RTE_FLOW_ACTION_TYPE_VOID: + continue; + default: + rte_flow_error_set(error, + EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "Invalid action type"); + return -rte_errno; + } + } + + if (actions_num > 1) { + rte_flow_error_set(error, + EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "Invalid action number"); + return -rte_errno; + } + + return 0; +} + static int ice_switch_parse_pattern_action(struct ice_adapter *ad, struct ice_pattern_match_item *array, @@ -1082,6 +1122,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, goto error; } + ret = ice_switch_check_action(actions, error); + if (ret) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Invalid input action number"); + goto error; + } + ret = ice_switch_parse_action(pf, actions, error, &rule_info); if (ret) { rte_flow_error_set(error, EINVAL, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:46.196659181 +0100 +++ 0040-net-ice-add-action-number-check-for-switch.patch 2020-05-19 14:04:44.176647647 +0100 @@ -1,13 +1,14 @@ -From 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b Mon Sep 17 00:00:00 2001 +From 175dc210ad7793de6ce5d1d1522642bb58f61e9a Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Fri, 3 Apr 2020 12:46:02 +0800 Subject: [PATCH] net/ice: add action number check for switch +[ upstream commit 3428c6b6ec1f0882e7b167c44c1fb11d0ef1d83b ] + The action number can only be one for DCF or PF switch filter, not support multiple actions. Fixes: 47d460d63233 ("net/ice: rework switch filter") -Cc: stable@dpdk.org Signed-off-by: Wei Zhao Acked-by: Qi Zhang @@ -16,10 +17,10 @@ 1 file changed, 48 insertions(+) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c -index d9bdf9637e..cc48f22dde 100644 +index 1db3db43c2..0d88e0bd7e 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c -@@ -1073,6 +1073,46 @@ error: +@@ -997,6 +997,46 @@ error: return -rte_errno; } @@ -66,7 +67,7 @@ static int ice_switch_parse_pattern_action(struct ice_adapter *ad, struct ice_pattern_match_item *array, -@@ -1158,6 +1198,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, +@@ -1082,6 +1122,14 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, goto error; } @@ -78,9 +79,9 @@ + goto error; + } + - if (ad->hw.dcf_enabled) - ret = ice_switch_parse_dcf_action(actions, error, &rule_info); - else + ret = ice_switch_parse_action(pf, actions, error, &rule_info); + if (ret) { + rte_flow_error_set(error, EINVAL, -- 2.20.1