From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
<edumazet@google.com>, <netdev@vger.kernel.org>,
Ahmed Zaki <ahmed.zaki@intel.com>,
Rafal Romanowski <rafal.romanowski@intel.com>
Subject: Re: [PATCH net-next 3/3] iavf: remove mask from iavf_irq_enable_queues()
Date: Mon, 5 Jun 2023 21:25:26 +0200 [thread overview]
Message-ID: <ZH42phazuTdyiNTm@boxer> (raw)
In-Reply-To: <20230602171302.745492-4-anthony.l.nguyen@intel.com>
On Fri, Jun 02, 2023 at 10:13:02AM -0700, Tony Nguyen wrote:
> From: Ahmed Zaki <ahmed.zaki@intel.com>
>
> Enable more than 32 IRQs by removing the u32 bit mask in
> iavf_irq_enable_queues(). There is no need for the mask as there are no
> callers that select individual IRQs through the bitmask. Also, if the PF
> allocates more than 32 IRQs, this mask will prevent us from using all of
> them.
>
> The comment in iavf_register.h is modified to show that the maximum
> number allowed for the IRQ index is 63 as per the iAVF standard 1.0 [1].
please use imperative mood:
"modify the comment in..."
besides, it sounds to me like a bug, we were not following the spec, no?
>
> link: [1] https://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/ethernet-adaptive-virtual-function-hardware-spec.pdf
> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf.h | 2 +-
> drivers/net/ethernet/intel/iavf/iavf_main.c | 15 ++++++---------
> drivers/net/ethernet/intel/iavf/iavf_register.h | 2 +-
> 3 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
> index 9abaff1f2aff..39d0fe76a38f 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h
> @@ -525,7 +525,7 @@ void iavf_set_ethtool_ops(struct net_device *netdev);
> void iavf_update_stats(struct iavf_adapter *adapter);
> void iavf_reset_interrupt_capability(struct iavf_adapter *adapter);
> int iavf_init_interrupt_scheme(struct iavf_adapter *adapter);
> -void iavf_irq_enable_queues(struct iavf_adapter *adapter, u32 mask);
> +void iavf_irq_enable_queues(struct iavf_adapter *adapter);
> void iavf_free_all_tx_resources(struct iavf_adapter *adapter);
> void iavf_free_all_rx_resources(struct iavf_adapter *adapter);
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3a78f86ba4f9..1332633f0ca5 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -359,21 +359,18 @@ static void iavf_irq_disable(struct iavf_adapter *adapter)
> }
>
> /**
> - * iavf_irq_enable_queues - Enable interrupt for specified queues
> + * iavf_irq_enable_queues - Enable interrupt for all queues
> * @adapter: board private structure
> - * @mask: bitmap of queues to enable
> **/
> -void iavf_irq_enable_queues(struct iavf_adapter *adapter, u32 mask)
> +void iavf_irq_enable_queues(struct iavf_adapter *adapter)
> {
> struct iavf_hw *hw = &adapter->hw;
> int i;
>
> for (i = 1; i < adapter->num_msix_vectors; i++) {
> - if (mask & BIT(i - 1)) {
> - wr32(hw, IAVF_VFINT_DYN_CTLN1(i - 1),
> - IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
> - IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK);
> - }
> + wr32(hw, IAVF_VFINT_DYN_CTLN1(i - 1),
> + IAVF_VFINT_DYN_CTLN1_INTENA_MASK |
> + IAVF_VFINT_DYN_CTLN1_ITR_INDX_MASK);
> }
> }
>
> @@ -387,7 +384,7 @@ void iavf_irq_enable(struct iavf_adapter *adapter, bool flush)
> struct iavf_hw *hw = &adapter->hw;
>
> iavf_misc_irq_enable(adapter);
> - iavf_irq_enable_queues(adapter, ~0);
> + iavf_irq_enable_queues(adapter);
>
> if (flush)
> iavf_flush(hw);
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_register.h b/drivers/net/ethernet/intel/iavf/iavf_register.h
> index bf793332fc9d..a19e88898a0b 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_register.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf_register.h
> @@ -40,7 +40,7 @@
> #define IAVF_VFINT_DYN_CTL01_INTENA_MASK IAVF_MASK(0x1, IAVF_VFINT_DYN_CTL01_INTENA_SHIFT)
> #define IAVF_VFINT_DYN_CTL01_ITR_INDX_SHIFT 3
> #define IAVF_VFINT_DYN_CTL01_ITR_INDX_MASK IAVF_MASK(0x3, IAVF_VFINT_DYN_CTL01_ITR_INDX_SHIFT)
> -#define IAVF_VFINT_DYN_CTLN1(_INTVF) (0x00003800 + ((_INTVF) * 4)) /* _i=0...15 */ /* Reset: VFR */
so this was wrong even before as not indicating 31 as max?
> +#define IAVF_VFINT_DYN_CTLN1(_INTVF) (0x00003800 + ((_INTVF) * 4)) /* _i=0...63 */ /* Reset: VFR */
> #define IAVF_VFINT_DYN_CTLN1_INTENA_SHIFT 0
> #define IAVF_VFINT_DYN_CTLN1_INTENA_MASK IAVF_MASK(0x1, IAVF_VFINT_DYN_CTLN1_INTENA_SHIFT)
> #define IAVF_VFINT_DYN_CTLN1_SWINT_TRIG_SHIFT 2
> --
> 2.38.1
>
>
next prev parent reply other threads:[~2023-06-05 19:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 17:12 [PATCH net-next 0/3][pull request] Intel Wired LAN Driver Updates 2023-06-02 (iavf) Tony Nguyen
2023-06-02 17:13 ` [PATCH net-next 1/3] iavf: add check for current MAC address in set_mac callback Tony Nguyen
2023-06-03 14:06 ` Simon Horman
2023-06-05 19:02 ` Maciej Fijalkowski
2023-06-06 9:22 ` Piotr Gardocki
2023-06-06 10:21 ` Maciej Fijalkowski
2023-06-06 12:54 ` Alexander Lobakin
2023-06-06 17:24 ` Jakub Kicinski
2023-06-07 10:29 ` Piotr Gardocki
2023-06-07 16:38 ` Jakub Kicinski
2023-06-07 20:22 ` Maciej Fijalkowski
2023-06-02 17:13 ` [PATCH net-next 2/3] iavf: fix err handling for MAC replace Tony Nguyen
2023-06-03 14:07 ` Simon Horman
2023-06-05 19:17 ` Maciej Fijalkowski
2023-06-06 10:14 ` Przemek Kitszel
2023-06-06 10:23 ` Maciej Fijalkowski
2023-06-06 11:59 ` Przemek Kitszel
2023-06-07 13:57 ` Przemek Kitszel
2023-06-07 19:08 ` Fijalkowski, Maciej
2023-06-16 7:09 ` Przemek Kitszel
2023-06-16 17:13 ` Tony Nguyen
2023-06-02 17:13 ` [PATCH net-next 3/3] iavf: remove mask from iavf_irq_enable_queues() Tony Nguyen
2023-06-03 14:07 ` Simon Horman
2023-06-05 19:25 ` Maciej Fijalkowski [this message]
2023-06-05 19:56 ` Ahmed Zaki
2023-06-06 10:26 ` Maciej Fijalkowski
2023-06-06 15:23 ` Ahmed Zaki
2023-06-06 16:01 ` Romanowski, Rafal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZH42phazuTdyiNTm@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=ahmed.zaki@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafal.romanowski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.