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 8D147A04B0; Tue, 22 Sep 2020 14:05:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6892D1DB99; Tue, 22 Sep 2020 14:04:00 +0200 (CEST) Received: from incedge.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 2DCA51DADF for ; Tue, 22 Sep 2020 14:03:45 +0200 (CEST) X-ASG-Debug-ID: 1600776221-149d111baf1ab900001-TfluYd Received: from mail.chinasoftinc.com (inccas002.ito.icss [10.168.0.52]) by incedge.chinasoftinc.com with ESMTP id DiIH7rNa6UKemMWg (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Sep 2020 20:03:41 +0800 (CST) X-Barracuda-Envelope-From: huwei013@chinasoftinc.com X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.52 X-ASG-Whitelist: Client Received: from localhost.localdomain (120.133.139.157) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020 20:03:41 +0800 From: "Wei Hu (Xavier)" X-Barracuda-RBL-Trusted-Forwarder: 10.168.0.60 To: CC: Date: Tue, 22 Sep 2020 20:03:19 +0800 X-ASG-Orig-Subj: [PATCH v2 07/17] net/hns3: add default branch to switch when parsing fd tuple Message-ID: <20200922120329.21185-8-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20200922120329.21185-1-huwei013@chinasoftinc.com> References: <20200922085401.12272-1-huwei013@chinasoftinc.com> <20200922120329.21185-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [120.133.139.157] X-Barracuda-Connect: inccas002.ito.icss[10.168.0.52] X-Barracuda-Start-Time: 1600776221 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: 1701 Subject: [dpdk-dev] [PATCH v2 07/17] net/hns3: add default branch to switch when parsing fd tuple 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: "Wei Hu (Xavier)" This patch solves the static check warning in the internal function named hns3_fd_convert_tuple as follow: "The switch statement must have a 'default' branch". Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_fdir.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 5c3dd05..5729923 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -526,7 +526,8 @@ static inline void hns3_fd_convert_int32(uint32_t key, uint32_t mask, memcpy(val_y, &tmp_y_l, sizeof(tmp_y_l)); } -static bool hns3_fd_convert_tuple(uint32_t tuple, uint8_t *key_x, +static bool hns3_fd_convert_tuple(struct hns3_hw *hw, + uint32_t tuple, uint8_t *key_x, uint8_t *key_y, struct hns3_fdir_rule *rule) { struct hns3_fdir_key_conf *key_conf; @@ -603,6 +604,9 @@ static bool hns3_fd_convert_tuple(uint32_t tuple, uint8_t *key_x, calc_y(*key_y, key_conf->spec.ip_proto, key_conf->mask.ip_proto); break; + default: + hns3_warn(hw, "not support tuple of (%d)", tuple); + break; } return true; } @@ -710,7 +714,7 @@ static int hns3_config_key(struct hns3_adapter *hns, tuple_size = tuple_key_info[i].key_length / HNS3_BITS_PER_BYTE; if (key_cfg->tuple_active & BIT(i)) { - tuple_valid = hns3_fd_convert_tuple(i, cur_key_x, + tuple_valid = hns3_fd_convert_tuple(hw, i, cur_key_x, cur_key_y, rule); if (tuple_valid) { cur_key_x += tuple_size; -- 2.9.5