From patchwork Wed Mar 8 06:18:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 21584 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 [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 24473F947; Wed, 8 Mar 2017 06:29:04 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0A9FC379B for ; Wed, 8 Mar 2017 06:28:27 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2017 21:28:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,262,1486454400"; d="scan'208"; a="1139354583" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.129.167]) by fmsmga002.fm.intel.com with ESMTP; 07 Mar 2017 21:28:26 -0800 From: Qi Zhang To: jing.d.chen@intel.com Cc: helin.zhang@intel.com, dev@dpdk.org, Qi Zhang Date: Wed, 8 Mar 2017 01:18:57 -0500 Message-Id: <20170308061906.950-10-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170308061906.950-1-qi.z.zhang@intel.com> References: <20170303031727.461-1-qi.z.zhang@intel.com> <20170308061906.950-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 09/18] net/fm10k/base: update comment regarding reserved bits check 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" The original comment may be read incorrectly as referring to checking the *entire* length is zero. However, it merely checks only the reserved bits of both length and reserved in a small amount of code. Update the comment to indicate this is a clever trick and clearly spell out that it only checks the reserve bits. Signed-off-by: Qi Zhang --- drivers/net/fm10k/base/fm10k_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fm10k/base/fm10k_vf.c b/drivers/net/fm10k/base/fm10k_vf.c index 533dfeb..dd3d318 100644 --- a/drivers/net/fm10k/base/fm10k_vf.c +++ b/drivers/net/fm10k/base/fm10k_vf.c @@ -225,7 +225,7 @@ STATIC s32 fm10k_update_vlan_vf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set) if (vsi) return FM10K_ERR_PARAM; - /* verify upper 4 bits of vid and length are 0 */ + /* clever trick to verify reserved bits in both vid and length */ if ((vid << 16 | vid) >> 28) return FM10K_ERR_PARAM;