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 AB028A0559; Tue, 17 Mar 2020 10:24:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EDD81C0B3; Tue, 17 Mar 2020 10:24:26 +0100 (CET) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 9F4F51C0B0 for ; Tue, 17 Mar 2020 10:24:22 +0100 (CET) X-ASG-Debug-ID: 1584436940-0a3dd134b2001b0009-TfluYd Received: from mail.chinasoftinc.com (inccas001.ito.icss [10.168.0.51]) by incedge.chinasoftinc.com with ESMTP id F2m2jzWS9v6YRhX9 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Mar 2020 17:23:04 +0800 (CST) X-Barracuda-Envelope-From: huwei013@chinasoftinc.com X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.51 X-ASG-Whitelist: Client Received: from localhost.localdomain (114.119.4.74) by INCCAS001.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 17 Mar 2020 17:13:14 +0800 From: "Wei Hu (Xavier)" X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60 To: Date: Tue, 17 Mar 2020 17:12:04 +0800 X-ASG-Orig-Subj: [PATCH 5/7] net/hns3: fix crash when flushing RSS flow rules with FLR Message-ID: <20200317091206.34928-6-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200317091206.34928-1-huwei013@chinasoftinc.com> References: <20200317091206.34928-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [114.119.4.74] X-Barracuda-Connect: inccas001.ito.icss[10.168.0.51] X-Barracuda-Start-Time: 1584436982 X-Barracuda-Encrypted: ECDHE-RSA-AES256-SHA X-Barracuda-URL: https://incspam.chinasofti.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at chinasoftinc.com X-Barracuda-Scan-Msg-Size: 2667 Subject: [dpdk-dev] [PATCH 5/7] net/hns3: fix crash when flushing RSS flow rules with FLR 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" From: Chengwen Feng Currently, we encoutner 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 setted, 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") Cc: stable@dpdk.org 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 98affa567..559b9d02b 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) } 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.23.0