From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04D8CC3DA5D for ; Mon, 22 Jul 2024 15:02:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B5D2680B05; Mon, 22 Jul 2024 15:02:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id q6EhS7-SPbTQ; Mon, 22 Jul 2024 15:02:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0160B810F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1721660561; bh=EGDJe4WMUXJhUhyzMrVXmI61qj4Ijz1koVsFxzyHinI=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=slkZ/zRaGEa4VUuMTTuwehqlyq+sgyF55PI1nbd3OY9SDiOlr2LUZ0Tk9cRBudeF0 s/Gb5kZGjN451aZen14BeJkUkcx5NKFFUOB1KuXU2c9XNnPzsBXtYNwf1PzQsktc9y 2Xz8bJ3d46n1dEAvSavLTF8lIfluonBlI2ojmGsjZ+Oo1ue8zH4K8FaE7CKH5ktcts 56T6kGyMik6HBsURoztFVQSi1wo491TYoe4BkhXpayOADAGRTLEYzGvgAs2y5dH6UZ +T70YL4v9dvDkQ8ChpjGfJbV9rAOCSaOXhuLHpEtNbVcY9jW7djQQRActg2Tws3t+H A8z/I1TnduOmQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 0160B810F9; Mon, 22 Jul 2024 15:02:41 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C329F1BF8A8 for ; Mon, 22 Jul 2024 15:02:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id AF57240448 for ; Mon, 22 Jul 2024 15:02:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TKvS_KKnY-nL for ; Mon, 22 Jul 2024 15:02:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org A81DB40109 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A81DB40109 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp2.osuosl.org (Postfix) with ESMTPS id A81DB40109 for ; Mon, 22 Jul 2024 15:02:38 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E633960B56; Mon, 22 Jul 2024 15:02:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54D26C4AF11; Mon, 22 Jul 2024 15:02:36 +0000 (UTC) Date: Mon, 22 Jul 2024 16:02:34 +0100 From: Simon Horman To: Ahmed Zaki Message-ID: <20240722150234.GI715661@kernel.org> References: <20240710204015.124233-1-ahmed.zaki@intel.com> <20240710204015.124233-7-ahmed.zaki@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240710204015.124233-7-ahmed.zaki@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721660557; bh=pAk0rVV50P2Q+ArDebksQq7XsI+EGNKBGEJfMCA5Sqk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yq9kbjRLugWzyckQ9EdM8GYrf3Wl/LbMZXQ69ozdR8Bv9+VZz9C0CJGBYvxSXtIrd Qzcp+P4Zm8I8QbOYYyjvObn7wVP1XLzL4f0r81R3jP7atc2qjVk/NizMGO3WvHqvL7 LofbBg1ReVb8eBgV9jvr0Tyteu2Y0+KSeqbxSz9KLL2ArgpqcL4AdTIazWK+drY7Zj LuvPCnRqKvaw/FrKECOxn5yZHYhWJR2+0iA9b8vKby04fLV30dqVKuf8/ABIEewOvS D7/L7M+DpEMQ1AtbtPqBOwYjN+moN3cwjAYGZ9qi2yxWC8VoUIl6Am3T1MWIPu+Uqc JtWT+RAp+PfDw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Yq9kbjRL Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 06/13] ice: support turning on/off the parser's double vlan mode X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, Marcin Szycik , intel-wired-lan@lists.osuosl.org, Junfeng Guo Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Wed, Jul 10, 2024 at 02:40:08PM -0600, Ahmed Zaki wrote: > From: Junfeng Guo > > Add API ice_parser_dvm_set() to support turning on/off the parser's double > vlan mode. > > Reviewed-by: Marcin Szycik > Signed-off-by: Qi Zhang > Signed-off-by: Junfeng Guo > Co-developed-by: Ahmed Zaki > Signed-off-by: Ahmed Zaki > --- > drivers/net/ethernet/intel/ice/ice_parser.c | 78 ++++++++++++++++++++- > drivers/net/ethernet/intel/ice/ice_parser.h | 18 +++++ > 2 files changed, 93 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c ... > static void ice_parse_lbl_item(struct ice_hw *hw, u16 idx, void *item, > - void *data, int size) > + void *data, int __maybe_unused size) > { > - memcpy(item, data, size); > + struct ice_lbl_item *lbl_item = (struct ice_lbl_item *)item; > + struct ice_lbl_item *lbl_data = (struct ice_lbl_item *)data; nit: Explicitly casting void * is unnecessary. > + > + lbl_item->idx = lbl_data->idx; > + memcpy(lbl_item->label, lbl_data->label, sizeof(lbl_item->label)); > + > + if (strstarts(lbl_item->label, ICE_LBL_BST_DVM)) > + lbl_item->type = ICE_LBL_BST_TYPE_DVM; > + else if (strstarts(lbl_item->label, ICE_LBL_BST_SVM)) > + lbl_item->type = ICE_LBL_BST_TYPE_SVM; > > if (hw->debug_mask & ICE_DBG_PARSER) > - ice_lbl_dump(hw, (struct ice_lbl_item *)item); > + ice_lbl_dump(hw, lbl_item); > } ... > +static void ice_bst_dvm_set(struct ice_parser *psr, enum ice_lbl_type type, > + bool on) > +{ > + u16 i = 0; > + > + while (true) { > + struct ice_bst_tcam_item *item; > + u8 key; > + > + item = ice_bst_tcam_search(psr->bst_tcam_table, > + psr->bst_lbl_table, > + type, &i); > + if (!item) > + break; > + > + key = (on ? ICE_BT_VLD_KEY : ICE_BT_INV_KEY); nit: these parentheses seem unnecessary > + item->key[ICE_BT_VM_OFF] = key; > + item->key_inv[ICE_BT_VM_OFF] = key; > + i++; > + } > +} ... From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14E9816DC3A for ; Mon, 22 Jul 2024 15:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721660558; cv=none; b=eq6VtbokGKWhsqU2nc03wg1+4W/m7ujym5tULQgChQG5E2BneSB12DqZT3KAMgQdk64m7EjmmZCEkPwa9bDixUxgjElr6KUQfP29ndXIkcRPtjo3C1CqGnD1kkauo605DR7upTe1yqnUXQqRi1rntkWdP0lS5LhQNTh8WagjlvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721660558; c=relaxed/simple; bh=pAk0rVV50P2Q+ArDebksQq7XsI+EGNKBGEJfMCA5Sqk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WI5l68TmF6GuQmoR5+WUaR/AzcDyyTGDFigPTSuBblAq63caAeCCI2RJBATKzpcbP+yP91p/RIjy5+Zg44s/xCWvDI8QUnhMLf+R2HFWYg/8iJkg8xyoBVZRJTt8v240t0VcBKLC5cdfdNhMSbG9wsrul1oJEqS2UT+QBJwg1FQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yq9kbjRL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yq9kbjRL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54D26C4AF11; Mon, 22 Jul 2024 15:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721660557; bh=pAk0rVV50P2Q+ArDebksQq7XsI+EGNKBGEJfMCA5Sqk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yq9kbjRLugWzyckQ9EdM8GYrf3Wl/LbMZXQ69ozdR8Bv9+VZz9C0CJGBYvxSXtIrd Qzcp+P4Zm8I8QbOYYyjvObn7wVP1XLzL4f0r81R3jP7atc2qjVk/NizMGO3WvHqvL7 LofbBg1ReVb8eBgV9jvr0Tyteu2Y0+KSeqbxSz9KLL2ArgpqcL4AdTIazWK+drY7Zj LuvPCnRqKvaw/FrKECOxn5yZHYhWJR2+0iA9b8vKby04fLV30dqVKuf8/ABIEewOvS D7/L7M+DpEMQ1AtbtPqBOwYjN+moN3cwjAYGZ9qi2yxWC8VoUIl6Am3T1MWIPu+Uqc JtWT+RAp+PfDw== Date: Mon, 22 Jul 2024 16:02:34 +0100 From: Simon Horman To: Ahmed Zaki Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, anthony.l.nguyen@intel.com, Junfeng Guo , Marcin Szycik Subject: Re: [PATCH iwl-next v3 06/13] ice: support turning on/off the parser's double vlan mode Message-ID: <20240722150234.GI715661@kernel.org> References: <20240710204015.124233-1-ahmed.zaki@intel.com> <20240710204015.124233-7-ahmed.zaki@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240710204015.124233-7-ahmed.zaki@intel.com> On Wed, Jul 10, 2024 at 02:40:08PM -0600, Ahmed Zaki wrote: > From: Junfeng Guo > > Add API ice_parser_dvm_set() to support turning on/off the parser's double > vlan mode. > > Reviewed-by: Marcin Szycik > Signed-off-by: Qi Zhang > Signed-off-by: Junfeng Guo > Co-developed-by: Ahmed Zaki > Signed-off-by: Ahmed Zaki > --- > drivers/net/ethernet/intel/ice/ice_parser.c | 78 ++++++++++++++++++++- > drivers/net/ethernet/intel/ice/ice_parser.h | 18 +++++ > 2 files changed, 93 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_parser.c b/drivers/net/ethernet/intel/ice/ice_parser.c ... > static void ice_parse_lbl_item(struct ice_hw *hw, u16 idx, void *item, > - void *data, int size) > + void *data, int __maybe_unused size) > { > - memcpy(item, data, size); > + struct ice_lbl_item *lbl_item = (struct ice_lbl_item *)item; > + struct ice_lbl_item *lbl_data = (struct ice_lbl_item *)data; nit: Explicitly casting void * is unnecessary. > + > + lbl_item->idx = lbl_data->idx; > + memcpy(lbl_item->label, lbl_data->label, sizeof(lbl_item->label)); > + > + if (strstarts(lbl_item->label, ICE_LBL_BST_DVM)) > + lbl_item->type = ICE_LBL_BST_TYPE_DVM; > + else if (strstarts(lbl_item->label, ICE_LBL_BST_SVM)) > + lbl_item->type = ICE_LBL_BST_TYPE_SVM; > > if (hw->debug_mask & ICE_DBG_PARSER) > - ice_lbl_dump(hw, (struct ice_lbl_item *)item); > + ice_lbl_dump(hw, lbl_item); > } ... > +static void ice_bst_dvm_set(struct ice_parser *psr, enum ice_lbl_type type, > + bool on) > +{ > + u16 i = 0; > + > + while (true) { > + struct ice_bst_tcam_item *item; > + u8 key; > + > + item = ice_bst_tcam_search(psr->bst_tcam_table, > + psr->bst_lbl_table, > + type, &i); > + if (!item) > + break; > + > + key = (on ? ICE_BT_VLD_KEY : ICE_BT_INV_KEY); nit: these parentheses seem unnecessary > + item->key[ICE_BT_VM_OFF] = key; > + item->key_inv[ICE_BT_VM_OFF] = key; > + i++; > + } > +} ...