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 D93C7A0093 for ; Tue, 19 May 2020 15:06:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCF951D603; Tue, 19 May 2020 15:06:14 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 436F71D603 for ; Tue, 19 May 2020 15:06:14 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id l18so15836760wrn.6 for ; Tue, 19 May 2020 06:06:14 -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=Wmt3PStxlENAIB7S7FWkzH5OYpTV9gcxVjfoJl8T/KA=; b=Ng6S3j9ThlapQT+m2ztT4ki+qx29np4YGGDmm4EvhJrt5HOpuLy0xZDNk9uyG/MJO7 Gc0DMVrdogPky2uZfZ85lalS3fV3Y5mlBVoTQLFpnfU1G3RvhU0RPH2UmlwCKZU687xv rHMtRwxplQHWLX83M+AVzCpUAOluU64nIzFzgr0OTd7SLePyTgqX+sCxL38P3DkrXDFU L+TbkuI7izkEbvZp59nlWTTp0iRcZFnKi2Zk/mybmJ1HaP4+SIC7rhTvtqXcJFg9ysMZ 2hhMKsVCGgY2g9o1CYWGPuECkurBdKqIM873Q4Zv0n+wPf3Gxgdrs8riAU/HE/fhqowX sjkw== 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=Wmt3PStxlENAIB7S7FWkzH5OYpTV9gcxVjfoJl8T/KA=; b=hhtSsdAospZEHogwc/zSR0Z0PZnlfYE7CgNQEAi3Eh/xZ4gQuqo8g7EmZYdUbOQBcs B03WK82YrwY67HvftR7Qd7MqRIMjtqtmZSXczfcKbfJ330Sm5CyBvFX3FLmDFGIOKdJT NYr4K2cgH7zUX7ePe1PQHCij88T+On+UuhL20/BU+wPf7ARSHJZbOtFrjcGZR8k+P5zS as31LqBzGkwXkGUTBTi1pOBMoLd+33qjBAP6Xisl37G7tDlqZknrLgzjZXEPCVJrRV1X CW7YJnxrNNxRyMHM3jbZKHy/0EgOWQMwB/TSBKY0NHyelVBpCK2+OS56d6ol5Xilz2D6 FD8Q== X-Gm-Message-State: AOAM530gAv4PAGkERkR2KF2GzIuh3/cOpORepydHR5TJsPVTdbH1+xAl ZAnPzFu/dK3dkJirI18J9v8= X-Google-Smtp-Source: ABdhPJzlbc81orut1oq7GngVJygMO1FaDs/m8+NXsswBt2OKBMxV0FzOI0Ib0zPGSB7tv8g3dZdfDQ== X-Received: by 2002:a5d:68cb:: with SMTP id p11mr25365616wrw.349.1589893573990; Tue, 19 May 2020 06:06:13 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id s8sm22575848wrg.34.2020.05.19.06.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:13 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Wei Hu , dpdk stable Date: Tue, 19 May 2020 14:02:21 +0100 Message-Id: <20200519130549.112823-6-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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix crash when flushing RSS flow rules with FLR' 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 b6c05b0781b81f5a905f3b1c6e9b0e73d1a32983 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:04 +0800 Subject: [PATCH] net/hns3: fix crash when flushing RSS flow rules with FLR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit c064f6918c7a7efac119ea0556e6c71d8d27a3fa ] Currently, we encounter segmentation fault when performing the following test case: 1. Run testpmd application, config the flow filter rules then flush them repeatedly. 2. Inject FLR concurrently every 5 second. The calltrace info: This GDB was configured as "aarch64-linux-gnu". Reading symbols from ./testpmd...(no debugging symbols found)...done. [New LWP 322] [New LWP 325] [New LWP 324] [New LWP 326] [New LWP 323] [New LWP 327] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/ libthread_db.so.1". Core was generated by `/home/root/app/testpmd -w 0000:00:01.0 -w 0000:00:02.0 -w 0000:00:03.0 -l 0-3 -'. Program terminated with signal SIGSEGV, Segmentation fault. libc.so.6 [Current thread is 1 (Thread 0xffff8bb35110 (LWP 322))] (gdb) bt #0 0x0000ffff8b936a90 in strlen () from /lib/aarch64-linux-gnu/ libc.so.6 #1 0x0000ffff8b905ccc in vfprintf () from /lib/aarch64-linux-gnu/ libc.so.6 #2 0x0000ffff8b993d04 in __printf_chk () from /lib/aarch64-linux-gnu/ libc.so.6 #3 0x0000000000754828 in port_flow_flush () #4 0x0000000000870f3c in cmdline_parse () The root cause as follows: In the '.flush' ops implementation function named hns3_flow_flush, By the way the '.flush' ops is defined in the struct rte_flow_ops, if failed to call hns3_clear_rss_filter, the out parameter error is not set, and then the member variable name message in the struct error is invalid(filled with 0x44444444 in port_flow_flush function of the testpmd application), it leads to segmentation fault when format the message. We fixes it by filling error parameter when failure in calling static function named hns3_clear_rss_filter in the the '.flush' ops implementation function named hns3_flow_flush. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_flow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index bcd121f48b..207dd578a0 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1822,8 +1822,11 @@ hns3_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) } ret = hns3_clear_rss_filter(dev); - if (ret) + if (ret) { + rte_flow_error_set(error, ret, RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, "Failed to flush rss filter"); return ret; + } hns3_filterlist_flush(dev); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:44.840777144 +0100 +++ 0006-net-hns3-fix-crash-when-flushing-RSS-flow-rules-with.patch 2020-05-19 14:04:44.052645400 +0100 @@ -1,4 +1,4 @@ -From c064f6918c7a7efac119ea0556e6c71d8d27a3fa Mon Sep 17 00:00:00 2001 +From b6c05b0781b81f5a905f3b1c6e9b0e73d1a32983 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:04 +0800 Subject: [PATCH] net/hns3: fix crash when flushing RSS flow rules with FLR @@ -6,6 +6,8 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +[ upstream commit c064f6918c7a7efac119ea0556e6c71d8d27a3fa ] + Currently, we encounter segmentation fault when performing the following test case: 1. Run testpmd application, config the flow filter rules then flush them @@ -53,7 +55,6 @@ implementation function named hns3_flow_flush. Fixes: c37ca66f2b27 ("net/hns3: support RSS") -Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) @@ -62,10 +63,10 @@ 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c -index 98affa5679..559b9d02b1 100644 +index bcd121f48b..207dd578a0 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c -@@ -1827,8 +1827,11 @@ hns3_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) +@@ -1822,8 +1822,11 @@ hns3_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) } ret = hns3_clear_rss_filter(dev);