Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
> -Original Message- > From: Tony Nguyen > Sent: Thursday, December 18, 2025 11:44 PM > To: Behera, Vivek (DI FA DSP ICC PRC1) ; > Kwapulinski, Piotr ; Loktionov, Aleksandr > ; Keller, Jacob E ; > Kitszel, Przemyslaw ; > [email protected] > Cc: [email protected]; [email protected] > Subject: Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > incorrect irq in > igc_xsk_wakeup function > > > > On 12/17/2025 11:21 PM, Behera, VIVEK wrote: > > Hello colleagues, > > > > > >> -Original Message- > >> From: Kwapulinski, Piotr > >> Sent: Tuesday, December 16, 2025 6:55 PM > >> To: Behera, Vivek (DI FA DSP ICC PRC1) ; > >> Loktionov, Aleksandr ; Keller, Jacob E > >> ; Nguyen, Anthony L > >> ; Kitszel, Przemyslaw > >> > >> Cc: [email protected]; [email protected]; Behera, Vivek > >> (DI FA DSP ICC PRC1) > >> Subject: RE: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > >> incorrect irq in igc_xsk_wakeup function > >> > >>> -Original Message- > >>> From: Intel-wired-lan On Behalf > >>> Of Vivek Behera > >>> Sent: Monday, December 15, 2025 1:21 PM > >>> To: Loktionov, Aleksandr ; Keller, > >>> Jacob E ; Nguyen, Anthony L > >>> ; Kitszel, Przemyslaw > >>> > >>> Cc: [email protected]; [email protected]; Behera, > >>> Vivek > >>> Subject: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > >>> incorrect irq in igc_xsk_wakeup function > >>> > >>> This patch addresses the issue where the igc_xsk_wakeup function was > >> triggering an incorrect IRQ for tx-0 when the i226 is configured with > >> only 2 combined queues or in an environment with 2 active CPU cores. > >>> This prevented XDP Zero-copy send functionality in such split IRQ > >> configurations. > >>> > >>> The fix implements the correct logic for extracting q_vectors saved > >>> during rx > >> and tx ring allocation and utilizes flags provided by the > >> ndo_xsk_wakeup API to trigger the appropriate IRQ. > >>> > >>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") > >>> Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for > >>> AF_XDP zero-copy packet") > >>> Signed-off-by: Vivek Behera > >>> Reviewed-by: Jacob Keller > >>> Reviewed-by: Aleksandr loktinov > >>> Reviewed-by: Przemyslaw Kitszel > >>> Reviewed-by: Tony Nguyen > > Unless you have received a Reviewed-by tag explicitly from the person, you > shouldn't add it. > > ... > > >>> drivers/net/ethernet/intel/igc/igc_main.c | 90 > >>> ++- drivers/net/ethernet/intel/igc/igc_ptp.c | > >>> 2 +- > >>> 2 files changed, 73 insertions(+), 19 deletions(-) > >>> > >>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c > >>> b/drivers/net/ethernet/intel/igc/igc_main.c > >>> index 7aafa60ba0c8..76e4790bd3c0 100644 > >>> --- a/drivers/net/ethernet/intel/igc/igc_main.c > >>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c > >>> @@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device > >>> *dev, int > >> num_frames, > >>> return nxmit; > >>> } > >>> > >>> -static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter, > >>> - struct igc_q_vector *q_vector) > >>> -{ > >>> - struct igc_hw *hw = &adapter->hw; > >>> - u32 eics = 0; > >>> - > >>> - eics |= q_vector->eims_value; > >>> - wr32(IGC_EICS, eics); > >>> -} > >>> - > >>> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) { > >>> struct igc_adapter *adapter = netdev_priv(dev); > >>> + struct igc_hw *hw = &adapter->hw; > >>> struct igc_q_vector *q_vector; > >>> struct igc_ring *ring; > >>> + u32 eics = 0; > >>> > >>> if (test_bit(__IGC_DOWN, &adapter->state)) > >>> return -ENETDOWN; > >>> @@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, > >>> u32 > >> queue_id, u32 flags) > >>> if (!igc_xdp_is_enabled(adapter)) > >>>
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
Hi Siang > -Original Message- > From: Song, Yoong Siang > Sent: Friday, December 19, 2025 3:28 AM > To: Nguyen, Anthony L ; Behera, Vivek (DI FA > DSP ICC PRC1) ; Kwapulinski, Piotr > ; Loktionov, Aleksandr > ; Keller, Jacob E ; > Kitszel, Przemyslaw > Cc: [email protected]; [email protected] > Subject: RE: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > incorrect irq in > igc_xsk_wakeup function > > On Friday, December 19, 2025 6:44 AM, Nguyen, Anthony L > wrote: > >On 12/17/2025 11:21 PM, Behera, VIVEK wrote: > >> Hello colleagues, > >> > > [...] > > >>>> > >>>> This patch addresses the issue where the igc_xsk_wakeup function > >>>> was > >>> triggering an incorrect IRQ for tx-0 when the i226 is configured > >>> with only 2 combined queues or in an environment with 2 active CPU cores. > >>>> This prevented XDP Zero-copy send functionality in such split IRQ > >>> configurations. > >>>> > >>>> The fix implements the correct logic for extracting q_vectors saved > >>>> during rx > >>> and tx ring allocation and utilizes flags provided by the > >>> ndo_xsk_wakeup API to trigger the appropriate IRQ. > >>>> > > Thank you, Vivek, for the fix. > Overall, your patch looks good to me, just some minor changes are needed. > > >>>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") > >>>> Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for > >>>> AF_XDP zero-copy packet") > >>>> Signed-off-by: Vivek Behera > >>>> Reviewed-by: Jacob Keller > >>>> Reviewed-by: Aleksandr loktinov > >>>> Reviewed-by: Przemyslaw Kitszel > >>>> Reviewed-by: Tony Nguyen > > > >Unless you have received a Reviewed-by tag explicitly from the person, > >you shouldn't add it. Okay. Noted > > > >... > > > >>>> drivers/net/ethernet/intel/igc/igc_main.c | 90 > >>>> ++- drivers/net/ethernet/intel/igc/igc_ptp.c | > >>>> 2 +- > >>>> 2 files changed, 73 insertions(+), 19 deletions(-) > >>>> > >>>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c > >>>> b/drivers/net/ethernet/intel/igc/igc_main.c > >>>> index 7aafa60ba0c8..76e4790bd3c0 100644 > >>>> --- a/drivers/net/ethernet/intel/igc/igc_main.c > >>>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c > >>>> @@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device > >>>> *dev, int > >>> num_frames, > >>>> return nxmit; > >>>> } > >>>> > >>>> -static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter, > >>>> -struct igc_q_vector *q_vector) > >>>> -{ > >>>> -struct igc_hw *hw = &adapter->hw; > >>>> -u32 eics = 0; > >>>> - > >>>> -eics |= q_vector->eims_value; > >>>> -wr32(IGC_EICS, eics); > >>>> -} > >>>> - > >>>> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) { > >>>> struct igc_adapter *adapter = netdev_priv(dev); > >>>> +struct igc_hw *hw = &adapter->hw; > >>>> struct igc_q_vector *q_vector; > >>>> struct igc_ring *ring; > >>>> +u32 eics = 0; > >>>> > >>>> if (test_bit(__IGC_DOWN, &adapter->state)) > >>>> return -ENETDOWN; > >>>> @@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, > >>>> u32 > >>> queue_id, u32 flags) > >>>> if (!igc_xdp_is_enabled(adapter)) > >>>> return -ENXIO; > >>>> > >>>> -if (queue_id >= adapter->num_rx_queues) > > num_rx_queues and num_tx_queues always having the same value. Thus, it is > safe for you to keep the original queue_id checking at the beginning of the > function, as below, and remove all the other queue_id check in your code. Yes. I see your point. It should be sufficient to have this check right at the beginning of the function since Irrespective of split or combined irqs the number of tx and rx queues is always the same > > if (queue_id >= adapter->num_rx_queues) >
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
> -Original Message- > From: Tony Nguyen > Sent: Friday, December 19, 2025 10:04 PM > To: Behera, Vivek (DI FA DSP ICC PRC1) ; > Kwapulinski, Piotr ; Loktionov, Aleksandr > ; Keller, Jacob E ; > Kitszel, Przemyslaw ; > [email protected] > Cc: [email protected]; [email protected] > Subject: Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > incorrect irq in > igc_xsk_wakeup function > > > > On 12/18/2025 11:02 PM, Behera, VIVEK wrote: > > ... > > > Hi tony. > > > > Okay , understood. > > > > Please let me know about the status of this patch > > Hi Vivek, > > Could you address the feedback from me and Siang? > > Thanks, > Tony Hi Tony, Yes I will submit a version addressing the feedback received from you and siang Thanks Vivek > > > Regards > > > > Vivek
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
On 12/18/2025 11:02 PM, Behera, VIVEK wrote: ... Hi tony. Okay , understood. Please let me know about the status of this patch Hi Vivek, Could you address the feedback from me and Siang? Thanks, Tony Regards Vivek
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
> -Original Message- > From: Tony Nguyen > Sent: Thursday, December 18, 2025 11:44 PM > To: Behera, Vivek (DI FA DSP ICC PRC1) ; > Kwapulinski, Piotr ; Loktionov, Aleksandr > ; Keller, Jacob E ; > Kitszel, Przemyslaw ; > [email protected] > Cc: [email protected]; [email protected] > Subject: Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > incorrect irq in > igc_xsk_wakeup function > > > > On 12/17/2025 11:21 PM, Behera, VIVEK wrote: > > Hello colleagues, > > > > > >> -Original Message- > >> From: Kwapulinski, Piotr > >> Sent: Tuesday, December 16, 2025 6:55 PM > >> To: Behera, Vivek (DI FA DSP ICC PRC1) ; > >> Loktionov, Aleksandr ; Keller, Jacob E > >> ; Nguyen, Anthony L > >> ; Kitszel, Przemyslaw > >> > >> Cc: [email protected]; [email protected]; Behera, Vivek > >> (DI FA DSP ICC PRC1) > >> Subject: RE: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > >> incorrect irq in igc_xsk_wakeup function > >> > >>> -Original Message- > >>> From: Intel-wired-lan On Behalf > >>> Of Vivek Behera > >>> Sent: Monday, December 15, 2025 1:21 PM > >>> To: Loktionov, Aleksandr ; Keller, > >>> Jacob E ; Nguyen, Anthony L > >>> ; Kitszel, Przemyslaw > >>> > >>> Cc: [email protected]; [email protected]; Behera, > >>> Vivek > >>> Subject: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > >>> incorrect irq in igc_xsk_wakeup function > >>> > >>> This patch addresses the issue where the igc_xsk_wakeup function was > >> triggering an incorrect IRQ for tx-0 when the i226 is configured with > >> only 2 combined queues or in an environment with 2 active CPU cores. > >>> This prevented XDP Zero-copy send functionality in such split IRQ > >> configurations. > >>> > >>> The fix implements the correct logic for extracting q_vectors saved > >>> during rx > >> and tx ring allocation and utilizes flags provided by the > >> ndo_xsk_wakeup API to trigger the appropriate IRQ. > >>> > >>> Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") > >>> Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for > >>> AF_XDP zero-copy packet") > >>> Signed-off-by: Vivek Behera > >>> Reviewed-by: Jacob Keller > >>> Reviewed-by: Aleksandr loktinov > >>> Reviewed-by: Przemyslaw Kitszel > >>> Reviewed-by: Tony Nguyen > > Unless you have received a Reviewed-by tag explicitly from the person, you > shouldn't add it. > > ... > > >>> drivers/net/ethernet/intel/igc/igc_main.c | 90 > >>> ++- drivers/net/ethernet/intel/igc/igc_ptp.c | > >>> 2 +- > >>> 2 files changed, 73 insertions(+), 19 deletions(-) > >>> > >>> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c > >>> b/drivers/net/ethernet/intel/igc/igc_main.c > >>> index 7aafa60ba0c8..76e4790bd3c0 100644 > >>> --- a/drivers/net/ethernet/intel/igc/igc_main.c > >>> +++ b/drivers/net/ethernet/intel/igc/igc_main.c > >>> @@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device > >>> *dev, int > >> num_frames, > >>> return nxmit; > >>> } > >>> > >>> -static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter, > >>> - struct igc_q_vector *q_vector) > >>> -{ > >>> - struct igc_hw *hw = &adapter->hw; > >>> - u32 eics = 0; > >>> - > >>> - eics |= q_vector->eims_value; > >>> - wr32(IGC_EICS, eics); > >>> -} > >>> - > >>> int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) { > >>> struct igc_adapter *adapter = netdev_priv(dev); > >>> + struct igc_hw *hw = &adapter->hw; > >>> struct igc_q_vector *q_vector; > >>> struct igc_ring *ring; > >>> + u32 eics = 0; > >>> > >>> if (test_bit(__IGC_DOWN, &adapter->state)) > >>> return -ENETDOWN; > >>> @@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, > >>> u32 > >> queue_id, u32 flags) > >>> if (!igc_xdp_is_enabled(adapter)) > >>>
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
On Friday, December 19, 2025 6:44 AM, Nguyen, Anthony L
wrote:
>On 12/17/2025 11:21 PM, Behera, VIVEK wrote:
>> Hello colleagues,
>>
[...]
This patch addresses the issue where the igc_xsk_wakeup function was
>>> triggering an incorrect IRQ for tx-0 when the i226 is configured with only 2
>>> combined queues or in an environment with 2 active CPU cores.
This prevented XDP Zero-copy send functionality in such split IRQ
>>> configurations.
The fix implements the correct logic for extracting q_vectors saved during
rx
>>> and tx ring allocation and utilizes flags provided by the ndo_xsk_wakeup
>>> API to
>>> trigger the appropriate IRQ.
Thank you, Vivek, for the fix.
Overall, your patch looks good to me, just some minor changes are needed.
Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP
zero-copy packet")
Signed-off-by: Vivek Behera
Reviewed-by: Jacob Keller
Reviewed-by: Aleksandr loktinov
Reviewed-by: Przemyslaw Kitszel
Reviewed-by: Tony Nguyen
>
>Unless you have received a Reviewed-by tag explicitly from the person,
>you shouldn't add it.
>
>...
>
drivers/net/ethernet/intel/igc/igc_main.c | 90 ++-
drivers/net/ethernet/intel/igc/igc_ptp.c | 2 +-
2 files changed, 73 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
b/drivers/net/ethernet/intel/igc/igc_main.c
index 7aafa60ba0c8..76e4790bd3c0 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device *dev, int
>>> num_frames,
return nxmit;
}
-static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
- struct igc_q_vector *q_vector)
-{
- struct igc_hw *hw = &adapter->hw;
- u32 eics = 0;
-
- eics |= q_vector->eims_value;
- wr32(IGC_EICS, eics);
-}
-
int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) {
struct igc_adapter *adapter = netdev_priv(dev);
+ struct igc_hw *hw = &adapter->hw;
struct igc_q_vector *q_vector;
struct igc_ring *ring;
+ u32 eics = 0;
if (test_bit(__IGC_DOWN, &adapter->state))
return -ENETDOWN;
@@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, u32
>>> queue_id, u32 flags)
if (!igc_xdp_is_enabled(adapter))
return -ENXIO;
- if (queue_id >= adapter->num_rx_queues)
num_rx_queues and num_tx_queues always having the same value. Thus, it is safe
for
you to keep the original queue_id checking at the beginning of the function, as
below,
and remove all the other queue_id check in your code.
if (queue_id >= adapter->num_rx_queues)
return -EINVAL;
+ if ((flags & XDP_WAKEUP_RX) && (flags & XDP_WAKEUP_TX)) {
+ /* If both TX and RX need to be woken up */
+ /* check if queue pairs are active. */
>
>nit: This can just be one comment, no need to break it into two comment
>blocks
>
> /* If both TX and RX need to be woken up
>* check if queue pairs are active.
>*/
>
>
+ if ((adapter->flags & IGC_FLAG_QUEUE_PAIRS)) {
+ /* Just get the ring params from Rx */
+ if (queue_id >= adapter->num_rx_queues)
+ return -EINVAL;
+ ring = adapter->rx_ring[queue_id];
+ } else {
+ /* Two irqs for Rx AND Tx need to be triggered */
+ u32 eics_tx = 0;
+ u32 eics_rx = 0;
+ struct napi_struct *rx_napi;
+ struct napi_struct *tx_napi;
>
>This should be RCT, longest argument to shortest, so the structs should
>be first.
>
+
+ if (queue_id >= adapter->num_rx_queues)
+ return -EINVAL;
+
+ if (queue_id >= adapter->num_tx_queues)
+ return -EINVAL;
+
+ /* IRQ trigger preparation for Rx */
+ ring = adapter->rx_ring[queue_id];
+ if (!ring->xsk_pool)
+ return -ENXIO;
+ q_vector = ring->q_vector;
+ rx_napi = &q_vector->napi;
+ /* Extend the BIT mask for eics */
+ eics_rx |= ring->q_vector->eims_value;
IMHO, " eics_rx = ring->q_vector->eims_value " will be more readable,
cause you just OR with zero.
+
+ /* IRQ trigger preparation for Tx */
+ ring = adapter->tx_ring[queue_id];
>>>
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
On 12/17/2025 11:21 PM, Behera, VIVEK wrote: Hello colleagues, -Original Message- From: Kwapulinski, Piotr Sent: Tuesday, December 16, 2025 6:55 PM To: Behera, Vivek (DI FA DSP ICC PRC1) ; Loktionov, Aleksandr ; Keller, Jacob E ; Nguyen, Anthony L ; Kitszel, Przemyslaw Cc: [email protected]; [email protected]; Behera, Vivek (DI FA DSP ICC PRC1) Subject: RE: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function -Original Message- From: Intel-wired-lan On Behalf Of Vivek Behera Sent: Monday, December 15, 2025 1:21 PM To: Loktionov, Aleksandr ; Keller, Jacob E ; Nguyen, Anthony L ; Kitszel, Przemyslaw Cc: [email protected]; [email protected]; Behera, Vivek Subject: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function This patch addresses the issue where the igc_xsk_wakeup function was triggering an incorrect IRQ for tx-0 when the i226 is configured with only 2 combined queues or in an environment with 2 active CPU cores. This prevented XDP Zero-copy send functionality in such split IRQ configurations. The fix implements the correct logic for extracting q_vectors saved during rx and tx ring allocation and utilizes flags provided by the ndo_xsk_wakeup API to trigger the appropriate IRQ. Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet") Signed-off-by: Vivek Behera Reviewed-by: Jacob Keller Reviewed-by: Aleksandr loktinov Reviewed-by: Przemyslaw Kitszel Reviewed-by: Tony Nguyen Unless you have received a Reviewed-by tag explicitly from the person, you shouldn't add it. ... drivers/net/ethernet/intel/igc/igc_main.c | 90 ++- drivers/net/ethernet/intel/igc/igc_ptp.c | 2 +- 2 files changed, 73 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 7aafa60ba0c8..76e4790bd3c0 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device *dev, int num_frames, return nxmit; } -static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter, - struct igc_q_vector *q_vector) -{ - struct igc_hw *hw = &adapter->hw; - u32 eics = 0; - - eics |= q_vector->eims_value; - wr32(IGC_EICS, eics); -} - int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) { struct igc_adapter *adapter = netdev_priv(dev); + struct igc_hw *hw = &adapter->hw; struct igc_q_vector *q_vector; struct igc_ring *ring; + u32 eics = 0; if (test_bit(__IGC_DOWN, &adapter->state)) return -ENETDOWN; @@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) if (!igc_xdp_is_enabled(adapter)) return -ENXIO; - if (queue_id >= adapter->num_rx_queues) + if ((flags & XDP_WAKEUP_RX) && (flags & XDP_WAKEUP_TX)) { + /* If both TX and RX need to be woken up */ + /* check if queue pairs are active. */ nit: This can just be one comment, no need to break it into two comment blocks /* If both TX and RX need to be woken up * check if queue pairs are active. */ + if ((adapter->flags & IGC_FLAG_QUEUE_PAIRS)) { + /* Just get the ring params from Rx */ + if (queue_id >= adapter->num_rx_queues) + return -EINVAL; + ring = adapter->rx_ring[queue_id]; + } else { + /* Two irqs for Rx AND Tx need to be triggered */ + u32 eics_tx = 0; + u32 eics_rx = 0; + struct napi_struct *rx_napi; + struct napi_struct *tx_napi; This should be RCT, longest argument to shortest, so the structs should be first. + + if (queue_id >= adapter->num_rx_queues) + return -EINVAL; + + if (queue_id >= adapter->num_tx_queues) + return -EINVAL; + + /* IRQ trigger preparation for Rx */ + ring = adapter->rx_ring[queue_id]; + if (!ring->xsk_pool) + return -ENXIO; + q_vector = ring->q_vector; + rx_napi = &q_vector->napi; + /* Extend the BIT mask for eics */ + eics_rx |= ring->q_vector->eims_value
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
Hello colleagues, > -Original Message- > From: Kwapulinski, Piotr > Sent: Tuesday, December 16, 2025 6:55 PM > To: Behera, Vivek (DI FA DSP ICC PRC1) ; > Loktionov, Aleksandr ; Keller, Jacob E > ; Nguyen, Anthony L ; > Kitszel, Przemyslaw > Cc: [email protected]; [email protected]; Behera, Vivek (DI FA > DSP ICC PRC1) > Subject: RE: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > incorrect irq in > igc_xsk_wakeup function > > >-Original Message- > >From: Intel-wired-lan On Behalf Of > >Vivek Behera > >Sent: Monday, December 15, 2025 1:21 PM > >To: Loktionov, Aleksandr ; Keller, Jacob > >E ; Nguyen, Anthony L > >; Kitszel, Przemyslaw > > > >Cc: [email protected]; [email protected]; Behera, Vivek > > > >Subject: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of > >incorrect irq in igc_xsk_wakeup function > > > >This patch addresses the issue where the igc_xsk_wakeup function was > triggering an incorrect IRQ for tx-0 when the i226 is configured with only 2 > combined queues or in an environment with 2 active CPU cores. > >This prevented XDP Zero-copy send functionality in such split IRQ > configurations. > > > >The fix implements the correct logic for extracting q_vectors saved during rx > and tx ring allocation and utilizes flags provided by the ndo_xsk_wakeup API > to > trigger the appropriate IRQ. > > > >Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") > >Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP > >zero-copy packet") > >Signed-off-by: Vivek Behera > >Reviewed-by: Jacob Keller > >Reviewed-by: Aleksandr loktinov > >Reviewed-by: Przemyslaw Kitszel > >Reviewed-by: Tony Nguyen > >--- > >v1: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > >kernel.org%2Fintel-wired- > lan%2FAS1PR10MB5392B7268416DB8A1624FDB88FA7A%4 > >0AS1PR10MB5392.EURPRD10.PROD.OUTLOOK.COM%2F&data=05%7C02%7 > Cvivek.behera > >%40siemens.com%7C8a63023eb06047539d5c08de3ccc4d88%7C38ae3bcd9579 > 4fd4add > >ab42e1495d55a%7C1%7C0%7C639015045337851822%7CUnknown%7CTWFpb > GZsb3d8eyJF > >bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTW > FpbCI > >sIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=rFeGiAGZ%2B04ujqFtkeYgGb > o%2FrDIOds > >qC9W2Ns0zfXmg%3D&reserved=0 > >v2: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > >kernel.org%2Fintel-wired- > lan%2FAS1PR10MB539280B1427DA0ABE9D65E628FA5A%4 > >0AS1PR10MB5392.EURPRD10.PROD.OUTLOOK.COM%2F&data=05%7C02%7 > Cvivek.behera > >%40siemens.com%7C8a63023eb06047539d5c08de3ccc4d88%7C38ae3bcd9579 > 4fd4add > >ab42e1495d55a%7C1%7C0%7C639015045337901136%7CUnknown%7CTWFpb > GZsb3d8eyJF > >bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTW > FpbCI > >sIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=VB1%2FADgBeiczrNyjCi4EUT > wpEPJNCEY5 > >NR2kpIHjp3s%3D&reserved=0 > >v3: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > >kernel.org%2Fintel-wired- > lan%2FIA3PR11MB8986E4ACB7F264CF2DD1D750E5A0A%4 > >0IA3PR11MB8986.namprd11.prod.outlook.com%2F&data=05%7C02%7Cvivek.be > hera > >%40siemens.com%7C8a63023eb06047539d5c08de3ccc4d88%7C38ae3bcd9579 > 4fd4add > >ab42e1495d55a%7C1%7C0%7C639015045337945302%7CUnknown%7CTWFpb > GZsb3d8eyJF > >bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTW > FpbCI > >sIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=HNXDOBjXNji%2FI2Pk2mV%2 > B1XLvpZQt7K > >4dxnQ7DZnGmmk%3D&reserved=0 > >v4: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > >kernel.org%2Fintel-wired- > lan%2FAS1PR10MB53926CB955FBD4F9F4A018818FA0A%4 > >0AS1PR10MB5392.EURPRD10.PROD.OUTLOOK.COM%2F&data=05%7C02%7 > Cvivek.behera > >%40siemens.com%7C8a63023eb06047539d5c08de3ccc4d88%7C38ae3bcd9579 > 4fd4add > >ab42e1495d55a%7C1%7C0%7C639015045337988842%7CUnknown%7CTWFpb > GZsb3d8eyJF > >bXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTW > FpbCI > >sIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=HrTbjiGaps3kGt4Qo9aJhfRoP > OGjcY4JnI > >njRisiYns%3D&reserved=0 > >v5: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore. > >kernel.org%2Fintel-wired- > lan%2FAS1PR10MB5392FCA415A38B9DD7BB5F218FA0A%4 > >0AS1PR10MB5392.EURPRD10.PROD.OUTLOOK.COM%2F&data=05%7C02%7 > Cvivek.behera > >%40siemens.com%7C8a63023eb06047539d5c08de3ccc4d88%7C38ae3bcd9579 > 4fd4add > >ab42e1495d55
Re: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
>-Original Message- >From: Intel-wired-lan On Behalf Of Vivek >Behera >Sent: Monday, December 15, 2025 1:21 PM >To: Loktionov, Aleksandr ; Keller, Jacob E >; Nguyen, Anthony L ; >Kitszel, Przemyslaw >Cc: [email protected]; [email protected]; Behera, Vivek > >Subject: [Intel-wired-lan] [PATCH iwl-net v8] igc: Fix trigger of incorrect >irq in igc_xsk_wakeup function > >This patch addresses the issue where the igc_xsk_wakeup function was >triggering an incorrect IRQ for tx-0 when the i226 is configured with only 2 >combined queues or in an environment with 2 active CPU cores. >This prevented XDP Zero-copy send functionality in such split IRQ >configurations. > >The fix implements the correct logic for extracting q_vectors saved during rx >and tx ring allocation and utilizes flags provided by the ndo_xsk_wakeup API >to trigger the appropriate IRQ. > >Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") >Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP >zero-copy packet") >Signed-off-by: Vivek Behera >Reviewed-by: Jacob Keller >Reviewed-by: Aleksandr loktinov >Reviewed-by: Przemyslaw Kitszel >Reviewed-by: Tony Nguyen >--- >v1: >https://lore.kernel.org/intel-wired-lan/as1pr10mb5392b7268416db8a1624fdb88f...@as1pr10mb5392.eurprd10.prod.outlook.com/ >v2: >https://lore.kernel.org/intel-wired-lan/as1pr10mb539280b1427da0abe9d65e628f...@as1pr10mb5392.eurprd10.prod.outlook.com/ >v3: >https://lore.kernel.org/intel-wired-lan/ia3pr11mb8986e4acb7f264cf2dd1d750e5...@ia3pr11mb8986.namprd11.prod.outlook.com/ >v4: >https://lore.kernel.org/intel-wired-lan/as1pr10mb53926cb955fbd4f9f4a018818f...@as1pr10mb5392.eurprd10.prod.outlook.com/ >v5: >https://lore.kernel.org/intel-wired-lan/as1pr10mb5392fca415a38b9dd7bb5f218f...@as1pr10mb5392.eurprd10.prod.outlook.com/ >v6: >https://lore.kernel.org/intel-wired-lan/[email protected]/ >v7: >https://lore.kernel.org/intel-wired-lan/[email protected]/ > >changelog: >v1 >- Inital description of the Bug and steps to reproduce with RTC Testbench >- Test results after applying the patch >v1 -> v2 >- Handling of RX and TX Wakeup in igc_xsk_wakeup for a split IRQ configuration >- Removal of igc_trigger_rxtxq_interrupt (now redundant) >- Added flag to igc_xsk_wakeup function call in igc_ptp_free_tx_buffer >v2 -> v3 >- Added 'Fixes:' tags for the relevant commits. >- Added reviewer >v3 -> v4 >- Added reviewer >v4 -> v5 >- Updated comment style from multi-star to standard linux convention >v5 -> v6 >- Resolve formatting issues highlighted by reviewers >- Try to include version histroy as defined in netdev guidelines >- Included review suggestions from Przemyslaw >- Added reviewers >v6 -> v7 >- Included review suggestions from Przemyslaw missed in v6 >v7 -> v8 >- Modified sequence to complete all error checks for rx and tx > before updating napi states and triggering irq >--- > drivers/net/ethernet/intel/igc/igc_main.c | 90 ++- > drivers/net/ethernet/intel/igc/igc_ptp.c | 2 +- > 2 files changed, 73 insertions(+), 19 deletions(-) > >diff --git a/drivers/net/ethernet/intel/igc/igc_main.c >b/drivers/net/ethernet/intel/igc/igc_main.c >index 7aafa60ba0c8..76e4790bd3c0 100644 >--- a/drivers/net/ethernet/intel/igc/igc_main.c >+++ b/drivers/net/ethernet/intel/igc/igc_main.c >@@ -6908,21 +6908,13 @@ static int igc_xdp_xmit(struct net_device *dev, int >num_frames, > return nxmit; > } > >-static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter, >- struct igc_q_vector *q_vector) >-{ >- struct igc_hw *hw = &adapter->hw; >- u32 eics = 0; >- >- eics |= q_vector->eims_value; >- wr32(IGC_EICS, eics); >-} >- > int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags) { > struct igc_adapter *adapter = netdev_priv(dev); >+ struct igc_hw *hw = &adapter->hw; > struct igc_q_vector *q_vector; > struct igc_ring *ring; >+ u32 eics = 0; > > if (test_bit(__IGC_DOWN, &adapter->state)) > return -ENETDOWN; >@@ -6930,18 +6922,80 @@ int igc_xsk_wakeup(struct net_device *dev, u32 >queue_id, u32 flags) > if (!igc_xdp_is_enabled(adapter)) > return -ENXIO; > >- if (queue_id >= adapter->num_rx_queues) >+ if ((flags & XDP_WAKEUP_RX) && (flags & XDP_WAKEUP_TX)) { >+ /* If both TX and RX need to be woken up */ >+ /* check if queue pairs are active. */ >+ if ((adapter->flags & IGC_FLAG_QUEUE_PAIRS)) { >+ /* Just get the ring params from Rx */ >+ if (queue_id >= adapter->num_rx_queues) >+ return -EINVAL; >+ ring = adapter->rx_ring[queue_id]; >+ } else { >+ /* Two irqs for Rx AND Tx need to be triggered */ >+ u32 eics_tx = 0; >+
