Message ID | 20231025103315.1149589-2-ivecera@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2502211vqx; Wed, 25 Oct 2023 03:34:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVIzojN3m7xGYLHaSP4ecd2J18boyecZm0qa5cenaHZufOSh5r+K5joG64n2MRpD+sS47S X-Received: by 2002:a25:90f:0:b0:d9c:7d7d:1ac9 with SMTP id 15-20020a25090f000000b00d9c7d7d1ac9mr14230537ybj.14.1698230067832; Wed, 25 Oct 2023 03:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698230067; cv=none; d=google.com; s=arc-20160816; b=ZwcuPDFmMqiTF0cbcg+ZZfwnmxZPVfPd+Wx27WKKCLaSTs7Ghaz0s4t/dDW1Xo7cVw wf0DZjKbeMiZbLKLmGyhESkJpydc7Efju7+DC8HE/XTuAv6uX3g8fiEm1M95NFCLwX9j aKEVolM33y3C9tFcHYHPnO/sxSPC6FPS5/1pSoHum0lZVI9acwGKTuVVQvN5idMrdQy9 0S/q3kC6hdpQvrWSDGMa3FdQ3A38f5H2czqeZq9NlCj4dsvktqNRsP5zftpNZbMoQOV9 MCi7Y88Z9dwR3KOM+km3uXFf68Pd/wCkV4lAJ4RLRkl8hftJ0RfWJlenNZ2I94Vx4mtX aAKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2obM353U2q7nBxBXksZTD973gP47Z5kgDxArhlBI2WA=; fh=M+PX9+iJWgAcFwsqeQjxdhjfP9EjwnPuV3/CSKHEUU4=; b=PFwctuBLLa2wSOthMz5LbfGRMQMcSZMqnl9L8QDym4tWODYK6afHpfb8RYoQep0chJ 0f2kbeBmiTi0+AGROVTT+wyENFeuCcfzXFpPcNFrOL+pGGAWXT9EiXC3asHJL2Eo4ymS o202uURRtDT+2xZGtrj1Q66ra8+eqLLI6fxG2zHjFsYFvSRbL4VsW8DAIhIcKEXV6cvZ XRi8POtSzUGeLULgvjKZ254Uxrw3Q0Pve+r4uMXTIyHNc62PZdDK/1mj2PIM948eCHC7 dSVBfy9qMt66R2VRIvI4uRYNDTbrmxq8yZUTP2WVyGmyVPW5d2SsMNs+6vwcan3W9KTN OYcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BJ5PR5Or; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id d193-20020a25cdca000000b00da052e38ac7si2751059ybf.425.2023.10.25.03.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 03:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BJ5PR5Or; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D110F80FCCB3; Wed, 25 Oct 2023 03:34:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234785AbjJYKeI (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Wed, 25 Oct 2023 06:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233435AbjJYKeH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 06:34:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A7F93 for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 03:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698230002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2obM353U2q7nBxBXksZTD973gP47Z5kgDxArhlBI2WA=; b=BJ5PR5Or566xDcyuBVme/JWWW5KUCoT4QbZifoaBli5ph6hL4NzQEqIUEABIbpH6Lpe0Vg FE5YEg/gawIZU4ZyuqSCJiEUGnm8Hz72ECbtgcYH+A3ygevicmEd40UPBncjGsm4j++2LI EuYjHtL0X0KQgawXcCyFPManVxTueiM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-400-orxzERDcMC2y-zJWoJvrbA-1; Wed, 25 Oct 2023 06:33:19 -0400 X-MC-Unique: orxzERDcMC2y-zJWoJvrbA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 03BE9857CE9; Wed, 25 Oct 2023 10:33:19 +0000 (UTC) Received: from p1.luc.cera.cz (unknown [10.45.225.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 825B11121319; Wed, 25 Oct 2023 10:33:17 +0000 (UTC) From: Ivan Vecera <ivecera@redhat.com> To: netdev@vger.kernel.org Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Jacob Keller <jacob.e.keller@intel.com> Subject: [PATCH iwl-next 1/2] i40e: Remove VF MAC types Date: Wed, 25 Oct 2023 12:33:14 +0200 Message-ID: <20231025103315.1149589-2-ivecera@redhat.com> In-Reply-To: <20231025103315.1149589-1-ivecera@redhat.com> References: <20231025103315.1149589-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 03:34:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780723291721765035 X-GMAIL-MSGID: 1780723291721765035 |
Series |
Remove VF MAC types and move helpers from i40e_type.h
|
|
Commit Message
Ivan Vecera
Oct. 25, 2023, 10:33 a.m. UTC
The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or
I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify
i40e_adminq_init_regs() and remove enums for these VF MAC types.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++-------------
drivers/net/ethernet/intel/i40e/i40e_type.h | 8 -----
2 files changed, 10 insertions(+), 31 deletions(-)
Comments
On 25.10.2023 12:33, Ivan Vecera wrote: > The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or > I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify > i40e_adminq_init_regs() and remove enums for these VF MAC types. > > Signed-off-by: Ivan Vecera <ivecera@redhat.com> > --- > drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- > drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- > 2 files changed, 10 insertions(+), 31 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c > index 29fc46abf690..896c43905309 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c > @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); > static void i40e_adminq_init_regs(struct i40e_hw *hw) > { > /* set head and tail registers in our local struct */ > - if (i40e_is_vf(hw)) { > - hw->aq.asq.tail = I40E_VF_ATQT1; > - hw->aq.asq.head = I40E_VF_ATQH1; > - hw->aq.asq.len = I40E_VF_ATQLEN1; > - hw->aq.asq.bal = I40E_VF_ATQBAL1; > - hw->aq.asq.bah = I40E_VF_ATQBAH1; > - hw->aq.arq.tail = I40E_VF_ARQT1; > - hw->aq.arq.head = I40E_VF_ARQH1; > - hw->aq.arq.len = I40E_VF_ARQLEN1; > - hw->aq.arq.bal = I40E_VF_ARQBAL1; > - hw->aq.arq.bah = I40E_VF_ARQBAH1; What about removing those I40E_VF_* defines? This is their only usage here, right? > - } else { > - hw->aq.asq.tail = I40E_PF_ATQT; > - hw->aq.asq.head = I40E_PF_ATQH; > - hw->aq.asq.len = I40E_PF_ATQLEN; > - hw->aq.asq.bal = I40E_PF_ATQBAL; > - hw->aq.asq.bah = I40E_PF_ATQBAH; > - hw->aq.arq.tail = I40E_PF_ARQT; > - hw->aq.arq.head = I40E_PF_ARQH; > - hw->aq.arq.len = I40E_PF_ARQLEN; > - hw->aq.arq.bal = I40E_PF_ARQBAL; > - hw->aq.arq.bah = I40E_PF_ARQBAH; > - } > + hw->aq.asq.tail = I40E_PF_ATQT; > + hw->aq.asq.head = I40E_PF_ATQH; > + hw->aq.asq.len = I40E_PF_ATQLEN; > + hw->aq.asq.bal = I40E_PF_ATQBAL; > + hw->aq.asq.bah = I40E_PF_ATQBAH; > + hw->aq.arq.tail = I40E_PF_ARQT; > + hw->aq.arq.head = I40E_PF_ARQH; > + hw->aq.arq.len = I40E_PF_ARQLEN; > + hw->aq.arq.bal = I40E_PF_ARQBAL; > + hw->aq.arq.bah = I40E_PF_ARQBAH; > } > > /** > diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h > index 9fda0cb6bdbe..7eaf8b013125 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_type.h > +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h > @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); > enum i40e_mac_type { > I40E_MAC_UNKNOWN = 0, > I40E_MAC_XL710, > - I40E_MAC_VF, > I40E_MAC_X722, > - I40E_MAC_X722_VF, > I40E_MAC_GENERIC, > }; > > @@ -588,12 +586,6 @@ struct i40e_hw { > char err_str[16]; > }; > > -static inline bool i40e_is_vf(struct i40e_hw *hw) > -{ > - return (hw->mac.type == I40E_MAC_VF || > - hw->mac.type == I40E_MAC_X722_VF); > -} > - > /** > * i40e_is_aq_api_ver_ge > * @hw: pointer to i40e_hw structure
Wed, Oct 25, 2023 at 12:48:37PM CEST, wojciech.drewek@intel.com wrote: > > >On 25.10.2023 12:33, Ivan Vecera wrote: >> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >> i40e_adminq_init_regs() and remove enums for these VF MAC types. >> >> Signed-off-by: Ivan Vecera <ivecera@redhat.com> >> --- >> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >> 2 files changed, 10 insertions(+), 31 deletions(-) >> >> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> index 29fc46abf690..896c43905309 100644 >> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >> static void i40e_adminq_init_regs(struct i40e_hw *hw) >> { >> /* set head and tail registers in our local struct */ >> - if (i40e_is_vf(hw)) { >> - hw->aq.asq.tail = I40E_VF_ATQT1; >> - hw->aq.asq.head = I40E_VF_ATQH1; >> - hw->aq.asq.len = I40E_VF_ATQLEN1; >> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >> - hw->aq.arq.tail = I40E_VF_ARQT1; >> - hw->aq.arq.head = I40E_VF_ARQH1; >> - hw->aq.arq.len = I40E_VF_ARQLEN1; >> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >> - hw->aq.arq.bah = I40E_VF_ARQBAH1; > >What about removing those I40E_VF_* defines? >This is their only usage here, right? Wait, do you suggest to use the values directly? That would be wild even for i40e :) > >> - } else { >> - hw->aq.asq.tail = I40E_PF_ATQT; >> - hw->aq.asq.head = I40E_PF_ATQH; >> - hw->aq.asq.len = I40E_PF_ATQLEN; >> - hw->aq.asq.bal = I40E_PF_ATQBAL; >> - hw->aq.asq.bah = I40E_PF_ATQBAH; >> - hw->aq.arq.tail = I40E_PF_ARQT; >> - hw->aq.arq.head = I40E_PF_ARQH; >> - hw->aq.arq.len = I40E_PF_ARQLEN; >> - hw->aq.arq.bal = I40E_PF_ARQBAL; >> - hw->aq.arq.bah = I40E_PF_ARQBAH; >> - } >> + hw->aq.asq.tail = I40E_PF_ATQT; >> + hw->aq.asq.head = I40E_PF_ATQH; >> + hw->aq.asq.len = I40E_PF_ATQLEN; >> + hw->aq.asq.bal = I40E_PF_ATQBAL; >> + hw->aq.asq.bah = I40E_PF_ATQBAH; >> + hw->aq.arq.tail = I40E_PF_ARQT; >> + hw->aq.arq.head = I40E_PF_ARQH; >> + hw->aq.arq.len = I40E_PF_ARQLEN; >> + hw->aq.arq.bal = I40E_PF_ARQBAL; >> + hw->aq.arq.bah = I40E_PF_ARQBAH; >> } >> >> /** >> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h >> index 9fda0cb6bdbe..7eaf8b013125 100644 >> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h >> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h >> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); >> enum i40e_mac_type { >> I40E_MAC_UNKNOWN = 0, >> I40E_MAC_XL710, >> - I40E_MAC_VF, >> I40E_MAC_X722, >> - I40E_MAC_X722_VF, >> I40E_MAC_GENERIC, >> }; >> >> @@ -588,12 +586,6 @@ struct i40e_hw { >> char err_str[16]; >> }; >> >> -static inline bool i40e_is_vf(struct i40e_hw *hw) >> -{ >> - return (hw->mac.type == I40E_MAC_VF || >> - hw->mac.type == I40E_MAC_X722_VF); >> -} >> - >> /** >> * i40e_is_aq_api_ver_ge >> * @hw: pointer to i40e_hw structure >
Wed, Oct 25, 2023 at 02:16:39PM CEST, jiri@resnulli.us wrote: >Wed, Oct 25, 2023 at 12:48:37PM CEST, wojciech.drewek@intel.com wrote: >> >> >>On 25.10.2023 12:33, Ivan Vecera wrote: >>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>> >>> Signed-off-by: Ivan Vecera <ivecera@redhat.com> >>> --- >>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>> 2 files changed, 10 insertions(+), 31 deletions(-) >>> >>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> index 29fc46abf690..896c43905309 100644 >>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>> { >>> /* set head and tail registers in our local struct */ >>> - if (i40e_is_vf(hw)) { >>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>> - hw->aq.asq.head = I40E_VF_ATQH1; >>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>> - hw->aq.arq.head = I40E_VF_ARQH1; >>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >> >>What about removing those I40E_VF_* defines? >>This is their only usage here, right? > >Wait, do you suggest to use the values directly? That would be >wild even for i40e :) Ah, sec. This is duplicated in drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me. > > >> >>> - } else { >>> - hw->aq.asq.tail = I40E_PF_ATQT; >>> - hw->aq.asq.head = I40E_PF_ATQH; >>> - hw->aq.asq.len = I40E_PF_ATQLEN; >>> - hw->aq.asq.bal = I40E_PF_ATQBAL; >>> - hw->aq.asq.bah = I40E_PF_ATQBAH; >>> - hw->aq.arq.tail = I40E_PF_ARQT; >>> - hw->aq.arq.head = I40E_PF_ARQH; >>> - hw->aq.arq.len = I40E_PF_ARQLEN; >>> - hw->aq.arq.bal = I40E_PF_ARQBAL; >>> - hw->aq.arq.bah = I40E_PF_ARQBAH; >>> - } >>> + hw->aq.asq.tail = I40E_PF_ATQT; >>> + hw->aq.asq.head = I40E_PF_ATQH; >>> + hw->aq.asq.len = I40E_PF_ATQLEN; >>> + hw->aq.asq.bal = I40E_PF_ATQBAL; >>> + hw->aq.asq.bah = I40E_PF_ATQBAH; >>> + hw->aq.arq.tail = I40E_PF_ARQT; >>> + hw->aq.arq.head = I40E_PF_ARQH; >>> + hw->aq.arq.len = I40E_PF_ARQLEN; >>> + hw->aq.arq.bal = I40E_PF_ARQBAL; >>> + hw->aq.arq.bah = I40E_PF_ARQBAH; >>> } >>> >>> /** >>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h >>> index 9fda0cb6bdbe..7eaf8b013125 100644 >>> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h >>> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h >>> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); >>> enum i40e_mac_type { >>> I40E_MAC_UNKNOWN = 0, >>> I40E_MAC_XL710, >>> - I40E_MAC_VF, >>> I40E_MAC_X722, >>> - I40E_MAC_X722_VF, >>> I40E_MAC_GENERIC, >>> }; >>> >>> @@ -588,12 +586,6 @@ struct i40e_hw { >>> char err_str[16]; >>> }; >>> >>> -static inline bool i40e_is_vf(struct i40e_hw *hw) >>> -{ >>> - return (hw->mac.type == I40E_MAC_VF || >>> - hw->mac.type == I40E_MAC_X722_VF); >>> -} >>> - >>> /** >>> * i40e_is_aq_api_ver_ge >>> * @hw: pointer to i40e_hw structure >>
On 25.10.2023 14:20, Jiri Pirko wrote: > Wed, Oct 25, 2023 at 02:16:39PM CEST, jiri@resnulli.us wrote: >> Wed, Oct 25, 2023 at 12:48:37PM CEST, wojciech.drewek@intel.com wrote: >>> >>> >>> On 25.10.2023 12:33, Ivan Vecera wrote: >>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>>> >>>> Signed-off-by: Ivan Vecera <ivecera@redhat.com> >>>> --- >>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>>> 2 files changed, 10 insertions(+), 31 deletions(-) >>>> >>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> index 29fc46abf690..896c43905309 100644 >>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>>> { >>>> /* set head and tail registers in our local struct */ >>>> - if (i40e_is_vf(hw)) { >>>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>>> - hw->aq.asq.head = I40E_VF_ATQH1; >>>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>>> - hw->aq.arq.head = I40E_VF_ARQH1; >>>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >>> >>> What about removing those I40E_VF_* defines? >>> This is their only usage here, right? >> >> Wait, do you suggest to use the values directly? That would be >> wild even for i40e :) > > Ah, sec. This is duplicated in > drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me. Indeed, in case of i40e they're going be unused after this patch so there is no point in keeping them, I think. > > > >> >> >>> >>>> - } else { >>>> - hw->aq.asq.tail = I40E_PF_ATQT; >>>> - hw->aq.asq.head = I40E_PF_ATQH; >>>> - hw->aq.asq.len = I40E_PF_ATQLEN; >>>> - hw->aq.asq.bal = I40E_PF_ATQBAL; >>>> - hw->aq.asq.bah = I40E_PF_ATQBAH; >>>> - hw->aq.arq.tail = I40E_PF_ARQT; >>>> - hw->aq.arq.head = I40E_PF_ARQH; >>>> - hw->aq.arq.len = I40E_PF_ARQLEN; >>>> - hw->aq.arq.bal = I40E_PF_ARQBAL; >>>> - hw->aq.arq.bah = I40E_PF_ARQBAH; >>>> - } >>>> + hw->aq.asq.tail = I40E_PF_ATQT; >>>> + hw->aq.asq.head = I40E_PF_ATQH; >>>> + hw->aq.asq.len = I40E_PF_ATQLEN; >>>> + hw->aq.asq.bal = I40E_PF_ATQBAL; >>>> + hw->aq.asq.bah = I40E_PF_ATQBAH; >>>> + hw->aq.arq.tail = I40E_PF_ARQT; >>>> + hw->aq.arq.head = I40E_PF_ARQH; >>>> + hw->aq.arq.len = I40E_PF_ARQLEN; >>>> + hw->aq.arq.bal = I40E_PF_ARQBAL; >>>> + hw->aq.arq.bah = I40E_PF_ARQBAH; >>>> } >>>> >>>> /** >>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h >>>> index 9fda0cb6bdbe..7eaf8b013125 100644 >>>> --- a/drivers/net/ethernet/intel/i40e/i40e_type.h >>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h >>>> @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); >>>> enum i40e_mac_type { >>>> I40E_MAC_UNKNOWN = 0, >>>> I40E_MAC_XL710, >>>> - I40E_MAC_VF, >>>> I40E_MAC_X722, >>>> - I40E_MAC_X722_VF, >>>> I40E_MAC_GENERIC, >>>> }; >>>> >>>> @@ -588,12 +586,6 @@ struct i40e_hw { >>>> char err_str[16]; >>>> }; >>>> >>>> -static inline bool i40e_is_vf(struct i40e_hw *hw) >>>> -{ >>>> - return (hw->mac.type == I40E_MAC_VF || >>>> - hw->mac.type == I40E_MAC_X722_VF); >>>> -} >>>> - >>>> /** >>>> * i40e_is_aq_api_ver_ge >>>> * @hw: pointer to i40e_hw structure >>>
On 25. 10. 23 12:48, Wojciech Drewek wrote: > > On 25.10.2023 12:33, Ivan Vecera wrote: >> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >> i40e_adminq_init_regs() and remove enums for these VF MAC types. >> >> Signed-off-by: Ivan Vecera<ivecera@redhat.com> >> --- >> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >> 2 files changed, 10 insertions(+), 31 deletions(-) >> >> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> index 29fc46abf690..896c43905309 100644 >> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >> static void i40e_adminq_init_regs(struct i40e_hw *hw) >> { >> /* set head and tail registers in our local struct */ >> - if (i40e_is_vf(hw)) { >> - hw->aq.asq.tail = I40E_VF_ATQT1; >> - hw->aq.asq.head = I40E_VF_ATQH1; >> - hw->aq.asq.len = I40E_VF_ATQLEN1; >> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >> - hw->aq.arq.tail = I40E_VF_ARQT1; >> - hw->aq.arq.head = I40E_VF_ARQH1; >> - hw->aq.arq.len = I40E_VF_ARQLEN1; >> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >> - hw->aq.arq.bah = I40E_VF_ARQBAH1; > What about removing those I40E_VF_* defines? > This is their only usage here, right? Yes, do you want to remove them in this patch? Or follow-up is sufficient? Ivan
On 10/25/2023 5:27 AM, Wojciech Drewek wrote: > > > On 25.10.2023 14:20, Jiri Pirko wrote: >> Wed, Oct 25, 2023 at 02:16:39PM CEST, jiri@resnulli.us wrote: >>> Wed, Oct 25, 2023 at 12:48:37PM CEST, wojciech.drewek@intel.com wrote: >>>> >>>> >>>> On 25.10.2023 12:33, Ivan Vecera wrote: >>>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>>>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>>>> >>>>> Signed-off-by: Ivan Vecera <ivecera@redhat.com> >>>>> --- >>>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>>>> 2 files changed, 10 insertions(+), 31 deletions(-) >>>>> >>>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>>> index 29fc46abf690..896c43905309 100644 >>>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>>>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>>>> { >>>>> /* set head and tail registers in our local struct */ >>>>> - if (i40e_is_vf(hw)) { >>>>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>>>> - hw->aq.asq.head = I40E_VF_ATQH1; >>>>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>>>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>>>> - hw->aq.arq.head = I40E_VF_ARQH1; >>>>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >>>> >>>> What about removing those I40E_VF_* defines? >>>> This is their only usage here, right? >>> >>> Wait, do you suggest to use the values directly? That would be >>> wild even for i40e :) >> >> Ah, sec. This is duplicated in >> drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me. > > Indeed, in case of i40e they're going be unused after this patch so > there is no point in keeping them, I think. > Ya, this is all a relic from early days when i40e planned to share code with i40evf.
On 10/25/2023 7:39 AM, Ivan Vecera wrote: > > > On 25. 10. 23 12:48, Wojciech Drewek wrote: >> >> On 25.10.2023 12:33, Ivan Vecera wrote: >>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>> >>> Signed-off-by: Ivan Vecera<ivecera@redhat.com> >>> --- >>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>> 2 files changed, 10 insertions(+), 31 deletions(-) >>> >>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> index 29fc46abf690..896c43905309 100644 >>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>> { >>> /* set head and tail registers in our local struct */ >>> - if (i40e_is_vf(hw)) { >>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>> - hw->aq.asq.head = I40E_VF_ATQH1; >>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>> - hw->aq.arq.head = I40E_VF_ARQH1; >>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >> What about removing those I40E_VF_* defines? >> This is their only usage here, right? > > Yes, do you want to remove them in this patch? Or follow-up is sufficient? > > Ivan > > I'm fine with a follow up. Thanks, Jake
On 10/25/2023 5:20 AM, Jiri Pirko wrote: > Wed, Oct 25, 2023 at 02:16:39PM CEST, jiri@resnulli.us wrote: >> Wed, Oct 25, 2023 at 12:48:37PM CEST, wojciech.drewek@intel.com wrote: >>> >>> >>> On 25.10.2023 12:33, Ivan Vecera wrote: >>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>>> >>>> Signed-off-by: Ivan Vecera <ivecera@redhat.com> >>>> --- >>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>>> 2 files changed, 10 insertions(+), 31 deletions(-) >>>> >>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> index 29fc46abf690..896c43905309 100644 >>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>>> { >>>> /* set head and tail registers in our local struct */ >>>> - if (i40e_is_vf(hw)) { >>>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>>> - hw->aq.asq.head = I40E_VF_ATQH1; >>>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>>> - hw->aq.arq.head = I40E_VF_ARQH1; >>>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >>> >>> What about removing those I40E_VF_* defines? >>> This is their only usage here, right? >> >> Wait, do you suggest to use the values directly? That would be >> wild even for i40e :) > > Ah, sec. This is duplicated in > drivers/net/ethernet/intel/iavf/iavf_register.h. That confused me. > Its possible the iAVF code could be cleaned up too... Historically the i40e and i40evf duplicated quite some code.
On 25.10.2023 19:44, Jacob Keller wrote: > > > On 10/25/2023 7:39 AM, Ivan Vecera wrote: >> >> >> On 25. 10. 23 12:48, Wojciech Drewek wrote: >>> >>> On 25.10.2023 12:33, Ivan Vecera wrote: >>>> The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or >>>> I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify >>>> i40e_adminq_init_regs() and remove enums for these VF MAC types. >>>> >>>> Signed-off-by: Ivan Vecera<ivecera@redhat.com> >>>> --- >>>> drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- >>>> drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- >>>> 2 files changed, 10 insertions(+), 31 deletions(-) >>>> >>>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> index 29fc46abf690..896c43905309 100644 >>>> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c >>>> @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); >>>> static void i40e_adminq_init_regs(struct i40e_hw *hw) >>>> { >>>> /* set head and tail registers in our local struct */ >>>> - if (i40e_is_vf(hw)) { >>>> - hw->aq.asq.tail = I40E_VF_ATQT1; >>>> - hw->aq.asq.head = I40E_VF_ATQH1; >>>> - hw->aq.asq.len = I40E_VF_ATQLEN1; >>>> - hw->aq.asq.bal = I40E_VF_ATQBAL1; >>>> - hw->aq.asq.bah = I40E_VF_ATQBAH1; >>>> - hw->aq.arq.tail = I40E_VF_ARQT1; >>>> - hw->aq.arq.head = I40E_VF_ARQH1; >>>> - hw->aq.arq.len = I40E_VF_ARQLEN1; >>>> - hw->aq.arq.bal = I40E_VF_ARQBAL1; >>>> - hw->aq.arq.bah = I40E_VF_ARQBAH1; >>> What about removing those I40E_VF_* defines? >>> This is their only usage here, right? >> >> Yes, do you want to remove them in this patch? Or follow-up is sufficient? >> >> Ivan >> >> > > I'm fine with a follow up. Me too > > Thanks, > Jake
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Ivan Vecera > Sent: Wednesday, October 25, 2023 4:03 PM > To: netdev@vger.kernel.org > Cc: intel-wired-lan@lists.osuosl.org; Brandeburg, Jesse <jesse.brandeburg@intel.com>; linux-kernel@vger.kernel.org; Eric Dumazet <edumazet@google.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Keller, Jacob E <jacob.e.keller@intel.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller <davem@davemloft.net> > Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: Remove VF MAC types > > The i40e_hw.mac.type cannot to be equal to I40E_MAC_VF or > I40E_MAC_X722_VF so remove helper i40e_is_vf(), simplify > i40e_adminq_init_regs() and remove enums for these VF MAC types. > > Signed-off-by: Ivan Vecera <ivecera@redhat.com> > --- > drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 ++++++------------- > drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ----- > 2 files changed, 10 insertions(+), 31 deletions(-) > Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index 29fc46abf690..896c43905309 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c @@ -17,29 +17,16 @@ static void i40e_resume_aq(struct i40e_hw *hw); static void i40e_adminq_init_regs(struct i40e_hw *hw) { /* set head and tail registers in our local struct */ - if (i40e_is_vf(hw)) { - hw->aq.asq.tail = I40E_VF_ATQT1; - hw->aq.asq.head = I40E_VF_ATQH1; - hw->aq.asq.len = I40E_VF_ATQLEN1; - hw->aq.asq.bal = I40E_VF_ATQBAL1; - hw->aq.asq.bah = I40E_VF_ATQBAH1; - hw->aq.arq.tail = I40E_VF_ARQT1; - hw->aq.arq.head = I40E_VF_ARQH1; - hw->aq.arq.len = I40E_VF_ARQLEN1; - hw->aq.arq.bal = I40E_VF_ARQBAL1; - hw->aq.arq.bah = I40E_VF_ARQBAH1; - } else { - hw->aq.asq.tail = I40E_PF_ATQT; - hw->aq.asq.head = I40E_PF_ATQH; - hw->aq.asq.len = I40E_PF_ATQLEN; - hw->aq.asq.bal = I40E_PF_ATQBAL; - hw->aq.asq.bah = I40E_PF_ATQBAH; - hw->aq.arq.tail = I40E_PF_ARQT; - hw->aq.arq.head = I40E_PF_ARQH; - hw->aq.arq.len = I40E_PF_ARQLEN; - hw->aq.arq.bal = I40E_PF_ARQBAL; - hw->aq.arq.bah = I40E_PF_ARQBAH; - } + hw->aq.asq.tail = I40E_PF_ATQT; + hw->aq.asq.head = I40E_PF_ATQH; + hw->aq.asq.len = I40E_PF_ATQLEN; + hw->aq.asq.bal = I40E_PF_ATQBAL; + hw->aq.asq.bah = I40E_PF_ATQBAH; + hw->aq.arq.tail = I40E_PF_ARQT; + hw->aq.arq.head = I40E_PF_ARQH; + hw->aq.arq.len = I40E_PF_ARQLEN; + hw->aq.arq.bal = I40E_PF_ARQBAL; + hw->aq.arq.bah = I40E_PF_ARQBAH; } /** diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h index 9fda0cb6bdbe..7eaf8b013125 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h @@ -64,9 +64,7 @@ typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *); enum i40e_mac_type { I40E_MAC_UNKNOWN = 0, I40E_MAC_XL710, - I40E_MAC_VF, I40E_MAC_X722, - I40E_MAC_X722_VF, I40E_MAC_GENERIC, }; @@ -588,12 +586,6 @@ struct i40e_hw { char err_str[16]; }; -static inline bool i40e_is_vf(struct i40e_hw *hw) -{ - return (hw->mac.type == I40E_MAC_VF || - hw->mac.type == I40E_MAC_X722_VF); -} - /** * i40e_is_aq_api_ver_ge * @hw: pointer to i40e_hw structure