From patchwork Tue Oct 9 22:51:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 46451 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A0A81B504; Wed, 10 Oct 2018 00:51:32 +0200 (CEST) Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by dpdk.org (Postfix) with ESMTP id 3AA0D1B502 for ; Wed, 10 Oct 2018 00:51:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1391; q=dns/txt; s=iport; t=1539125490; x=1540335090; h=from:to:cc:subject:date:message-id; bh=P7xPfJ1cvYHRk8x+vkvk+QKkmELBdRUUIwEYIazCq2Y=; b=BBWlbhmOQXunqp7UPh0GWYk+M+vUCzEh5W/DDBLkqEucOVS4CMwBX18H uWrOSxHX/aJoQQGsw5sLo/5OWr5MWqNuj2tWFxwCjpqOZL+hNgXl4DTUN SdxVKHaeGwW/McDpKDSgX15bkJdTDEFwxiwhWmyIut9+KOosm+zNx8nid U=; X-IronPort-AV: E=Sophos;i="5.54,361,1534809600"; d="scan'208";a="453728368" Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2018 22:51:29 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-10.cisco.com (8.15.2/8.15.2) with ESMTP id w99MpTh5016962; Tue, 9 Oct 2018 22:51:29 GMT Received: by cisco.com (Postfix, from userid 392789) id 3107120F2001; Tue, 9 Oct 2018 15:51:29 -0700 (PDT) From: John Daley To: adrien.mazarguil@6wind.com Cc: dev@dpdk.org, John Daley Date: Tue, 9 Oct 2018 15:51:24 -0700 Message-Id: <20181009225124.25513-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-10.cisco.com Subject: [dpdk-dev] [PATCH] app/testpmd: fix flow list command 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes the 'flow list ' command which caused a segfault when passing the action or item 'type' field instead of the action or item struct pointer in the call to rte_flow_conv. Fixes: 7d94dcedf7ce ("app/testpmd: rely on flow API conversion function") Signed-off-by: John Daley --- app/test-pmd/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 86c205806..2ce40f3e1 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1354,7 +1354,7 @@ port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n]) while (item->type != RTE_FLOW_ITEM_TYPE_END) { if (rte_flow_conv(RTE_FLOW_CONV_OP_ITEM_NAME_PTR, &name, sizeof(name), - (void *)(uintptr_t)item->type, + (void *)(uintptr_t)item, NULL) <= 0) name = "[UNKNOWN]"; if (item->type != RTE_FLOW_ITEM_TYPE_VOID) @@ -1365,7 +1365,7 @@ port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n]) while (action->type != RTE_FLOW_ACTION_TYPE_END) { if (rte_flow_conv(RTE_FLOW_CONV_OP_ACTION_NAME_PTR, &name, sizeof(name), - (void *)(uintptr_t)action->type, + (void *)(uintptr_t)action, NULL) <= 0) name = "[UNKNOWN]"; if (action->type != RTE_FLOW_ACTION_TYPE_VOID)