From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f51.google.com (mail-pg0-f51.google.com [74.125.83.51]) by dpdk.org (Postfix) with ESMTP id AD6677D62 for ; Mon, 21 Aug 2017 11:36:23 +0200 (CEST) Received: by mail-pg0-f51.google.com with SMTP id i12so96972677pgr.3 for ; Mon, 21 Aug 2017 02:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GvPc4+dnHTS7y+A45IpnS7RUix0gPHStnROO9SIBp6w=; b=ltm7y20faN79GOU+MmDfA5JF8tRbXaoQgIz/Cd5RuIB3EhTZ1qVGB8PXBFhZlbHjHx J7kwaZIbC+0OrmXajhVbF+Yyiqv/MLm2W8bOY616mQdsCbtgjp+9jrf0IW2NRKv4t3h8 wXK40DzphBkZcxIb+ub4ASA0SX+Zh963PYpIVhJQffOHPth/rtKQbkCbJEgR+AjCbv53 7AGhe3G401IwCwqTwz9xAlaZ6jPaT5Ri23lNtTv/NQFWQmITAeA2kqxv2ro3udJj06yL O/C1++nl4yV+fsYazKBYPlaeixv2UmtWwC8t/MdBitcYWq1BDYRBeuyHXBlLAky+QYfZ VF4A== 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=GvPc4+dnHTS7y+A45IpnS7RUix0gPHStnROO9SIBp6w=; b=WhfR6U5kodK0HWfX0rFBq6vboCieFTPVDmj1eDOfeUFo8z4jMJVPmdmS06By/A9qNC 1b3Q1YL7QJieEYButfunzyFSnfV59xxiuv4RMlVVbpQSOSgkg1LOlyV09ttQsMwO0fab 6lT0Vs0+UveQ1SrC0RA4PJ7fNbkLPwIATYwQagrYxOWJr9FhNhTqMTXboedOg4z5cP7A WD8ejL+eOSiDTwpRh4eYfLqwQknAwORfxapWXqs+geSKCcIfosl52c6lRrL2NxIL0R/G SC3Kljucs/KMVdm+TtctSmSy7YkSo999uN3U7OMeA808ikc1cNETE/IMsaBHSLWooF4d IZVw== X-Gm-Message-State: AHYfb5g+vOdCDJJIBe4/COJbGoj0LpIUooUjDiiqE5aGorW5dC1Qa5Qq OEPXYMrzBAKdMjHvSw0uKg== X-Received: by 10.99.63.71 with SMTP id m68mr993202pga.15.1503308183029; Mon, 21 Aug 2017 02:36:23 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.36.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:36:22 -0700 (PDT) From: Yuanhan Liu To: Matan Azrad Cc: Adrien Mazarguil , dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:30:52 +0800 Message-Id: <1503307878-16728-38-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix flow rule copy functions' has been queued to stable release 17.05.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, 21 Aug 2017 09:36:24 -0000 Hi, FYI, your patch has been queued to stable release 17.05.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 08/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From f39999c13215f15a6de5156a8365b94e801ec71e Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 24 Jul 2017 16:47:32 +0300 Subject: [PATCH] app/testpmd: fix flow rule copy functions [ upstream commit 79bf388493b5c4be104c6c17fd98aa293dafa42d ] The corrupted code checks only RAW flow item type special case for returning its size but doesn't deal with any other flow item type and returns 0 for all the others. This bug leaves the flow descriptor empty for non RAW types. The fix takes the correct size to any regular types from appropriate array. The same issue, with a similar fix, is in flow action size method which deals only with RSS special type. Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow API") Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- app/test-pmd/config.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 83a8f52..1c20661 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -979,8 +979,10 @@ static void flow_item_spec_size(const struct rte_flow_item *item, size_t *size, size_t *pad) { - if (!item->spec) + if (!item->spec) { + *size = 0; goto empty; + } switch (item->type) { union { const struct rte_flow_item_raw *raw; @@ -992,10 +994,10 @@ flow_item_spec_size(const struct rte_flow_item *item, spec.raw->length * sizeof(*spec.raw->pattern); break; default: -empty: - *size = 0; + *size = flow_item[item->type].size; break; } +empty: *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size; } @@ -1030,8 +1032,10 @@ static void flow_action_conf_size(const struct rte_flow_action *action, size_t *size, size_t *pad) { - if (!action->conf) + if (!action->conf) { + *size = 0; goto empty; + } switch (action->type) { union { const struct rte_flow_action_rss *rss; @@ -1043,10 +1047,10 @@ flow_action_conf_size(const struct rte_flow_action *action, conf.rss->num * sizeof(*conf.rss->queue); break; default: -empty: - *size = 0; + *size = flow_action[action->type].size; break; } +empty: *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size; } -- 2.7.4