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 4B18FA04AB; Fri, 8 Nov 2019 07:49:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7009A1BF65; Fri, 8 Nov 2019 07:48:59 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E937E1BF08 for ; Fri, 8 Nov 2019 07:48:57 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2019 22:48:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,280,1569308400"; d="scan'208";a="231837117" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by FMSMGA003.fm.intel.com with ESMTP; 07 Nov 2019 22:48:55 -0800 Date: Fri, 8 Nov 2019 14:44:49 +0800 From: Ye Xiaolong To: Simei Su Cc: qi.z.zhang@intel.com, qiming.yang@intel.com, dev@dpdk.org Message-ID: <20191108064449.GB34994@intel.com> References: <1573112083-36798-1-git-send-email-simei.su@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1573112083-36798-1-git-send-email-simei.su@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/ice: add error cases with a wrong package 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" On 11/07, Simei Su wrote: >If the switch/fdir/hash module can't resolve a correct parser, >it should return error. > >Fixes: 47d460d63233 ("net/ice: rework switch filter") >Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel") >Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS") > >Signed-off-by: Simei Su >--- > drivers/net/ice/ice_fdir_filter.c | 4 +++- > drivers/net/ice/ice_hash.c | 2 ++ > drivers/net/ice/ice_switch_filter.c | 4 +++- > 3 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c >index fbbc41f..baaa7fa 100644 >--- a/drivers/net/ice/ice_fdir_filter.c >+++ b/drivers/net/ice/ice_fdir_filter.c >@@ -863,8 +863,10 @@ > > if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS) > parser = &ice_fdir_parser_comms; >- else >+ else if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT) > parser = &ice_fdir_parser_os; >+ else >+ return -EINVAL; > > return ice_register_parser(parser, ad); > } >diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c >index 3381b45..8dc3146 100644 >--- a/drivers/net/ice/ice_hash.c >+++ b/drivers/net/ice/ice_hash.c >@@ -242,6 +242,8 @@ struct ice_hash_match_type ice_hash_type_list[] = { > parser = &ice_hash_parser_os; > else if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS) > parser = &ice_hash_parser_comms; >+ else >+ return -EINVAL; > > return ice_register_parser(parser, ad); > } >diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c >index 4be87c2..2406102 100644 >--- a/drivers/net/ice/ice_switch_filter.c >+++ b/drivers/net/ice/ice_switch_filter.c >@@ -1122,8 +1122,10 @@ struct sw_meta { > > if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS) > dist_parser = &ice_switch_dist_parser_comms; >- else >+ else if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT) > dist_parser = &ice_switch_dist_parser_os; >+ else >+ return -EINVAL; > > if (ad->devargs.pipe_mode_support) > ret = ice_register_parser(perm_parser, ad); >-- >1.8.3.1 > Acked-by: Xiaolong Ye Applied to dpdk-next-net-intel. Thanks.