FAILED: patch "[PATCH] net: wangxun: revert the adjustment of the IRQ vector" failed to apply to 6.12-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x e37546ad1f9b2c777d3a21d7e50ce265ee3dece8
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025070626-come-nappy-3fec@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e37546ad1f9b2c777d3a21d7e50ce265ee3dece8 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <[email protected]>
Date: Tue, 1 Jul 2025 14:30:29 +0800
Subject: [PATCH] net: wangxun: revert the adjustment of the IRQ vector
sequence
Due to hardware limitations of NGBE, queue IRQs can only be requested on vector 0 to 7. When the number of queues is set to the maximum 8, the PCI IRQ vectors are allocated from 0 to 8. The vector 0 is used by MISC interrupt, and althrough the vector 8 is used by queue interrupt, it is unable to receive packets. This will cause some packets to be dropped when RSS is enabled and they are assigned to queue 8.
So revert the adjustment of the MISC IRQ location, to make it be the last one in IRQ vectors.
drivers/net/ethernet/wangxun/libwx/wx_lib.c +8 -9
@@ -1747,7 +1747,7 @@ static void wx_set_num_queues(struct wx *wx)*/ static int wx_acquire_msix_vectors (struct wx *wx) { -struct irq_affinity affd = { .pre_vectors =1 }; +struct irq_affinity affd = { .post_vectors =1 };int nvecs, i;/* We start by asking for one vector per queue pair */
@@ -1784,16 +1784,17 @@ static int wx_acquire_msix_vectors(struct wx *wx)return nvecs; } - wx->msix_entry->entry =0 ; - wx->msix_entry->vector =pci_irq_vector (wx->pdev,0 ); nvecs -=1 ;for (i =0 ; i < nvecs; i++) { wx->msix_q_entries[i].entry = i; - wx->msix_q_entries[i].vector =pci_irq_vector (wx->pdev, i +1 ); + wx->msix_q_entries[i].vector =pci_irq_vector (wx->pdev, i); } wx->num_q_vectors = nvecs; + wx->msix_entry->entry = nvecs; + wx->msix_entry->vector =pci_irq_vector (wx->pdev, nvecs); +return 0 ; }
@@ -2300,8 +2301,6 @@ static void wx_set_ivar(struct wx *wx, s8 direction,wr32 (wx,WX_PX_MISC_IVAR , ivar); }else {/* tx or rx causes */ -if (!(wx->mac.type == wx_mac_em && wx->num_vfs ==7 )) - msix_vector +=1 ;/* offset for queue vectors */ msix_vector |=WX_PX_IVAR_ALLOC_VAL ; index = ((16 * (queue &1 )) + (8 * direction)); ivar =rd32 (wx,WX_PX_IVAR (queue >>1 ));
@@ -2340,7 +2339,7 @@ void wx_write_eitr(struct wx_q_vector *q_vector) itr_reg |=WX_PX_ITR_CNT_WDIS ; -wr32 (wx,WX_PX_ITR (v_idx +1 ), itr_reg); +wr32 (wx,WX_PX_ITR (v_idx), itr_reg); }/**
@@ -2393,9 +2392,9 @@ void wx_configure_vectors(struct wx *wx)wx_write_eitr (q_vector); } -wx_set_ivar (wx,-1 ,0 ,0 ); +wx_set_ivar (wx,-1 ,0 , v_idx);if (pdev->msix_enabled) -wr32 (wx,WX_PX_ITR (0 ),1950 ); +wr32 (wx,WX_PX_ITR (v_idx),1950 ); }EXPORT_SYMBOL (wx_configure_vectors);
drivers/net/ethernet/wangxun/libwx/wx_type.h +1 -1
@@ -1343,7 +1343,7 @@ struct wx { };#define WX_INTR_ALL (~0ULL) -#define WX_INTR_Q (i) BIT((i) + 1) +#define WX_INTR_Q (i) BIT((i))/* register operations */ #define wr32 (a, reg, value) writel((value), ((a)->hw_addr + (reg)))
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +1 -1
@@ -161,7 +161,7 @@ static void ngbe_irq_enable(struct wx *wx, bool queues)if (queues)wx_intr_enable (wx,NGBE_INTR_ALL );else -wx_intr_enable (wx,NGBE_INTR_MISC ); +wx_intr_enable (wx,NGBE_INTR_MISC (wx)); }/**
drivers/net/ethernet/wangxun/ngbe/ngbe_type.h +1 -1
@@ -87,7 +87,7 @@#define NGBE_PX_MISC_IC_TIMESYNC BIT(11)/* time sync */ #define NGBE_INTR_ALL 0x1FF -#define NGBE_INTR_MISC BIT(0) +#define NGBE_INTR_MISC (A ) BIT((A)->num_q_vectors)#define NGBE_PHY_CONFIG (reg_offset) (0x14000 + ((reg_offset) * 4))#define NGBE_CFG_LAN_SPEED 0x14440
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c +3 -3
@@ -31,7 +31,7 @@ void txgbe_irq_enable(struct wx *wx, bool queues)wr32 (wx,WX_PX_MISC_IEN , misc_ien);/* unmask interrupt */ -wx_intr_enable (wx,TXGBE_INTR_MISC ); +wx_intr_enable (wx,TXGBE_INTR_MISC (wx));if (queues)wx_intr_enable (wx,TXGBE_INTR_QALL (wx)); }
@@ -131,7 +131,7 @@ static irqreturn_t txgbe_misc_irq_handle(int irq, void *data) txgbe->eicr = eicr;if (eicr &TXGBE_PX_MISC_IC_VF_MBOX ) {wx_msg_task (txgbe->wx); -wx_intr_enable (wx,TXGBE_INTR_MISC ); +wx_intr_enable (wx,TXGBE_INTR_MISC (wx)); }return IRQ_WAKE_THREAD ; }
@@ -183,7 +183,7 @@ static irqreturn_t txgbe_misc_irq_thread_fn(int irq, void *data) nhandled++; } -wx_intr_enable (wx,TXGBE_INTR_MISC ); +wx_intr_enable (wx,TXGBE_INTR_MISC (wx));return (nhandled >0 ?IRQ_HANDLED :IRQ_NONE ); }
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +2 -2
@@ -302,8 +302,8 @@ struct txgbe_fdir_filter {#define TXGBE_DEFAULT_RX_WORK 128#endif -#define TXGBE_INTR_MISC BIT(0) -#define TXGBE_INTR_QALL (A ) GENMASK((A)->num_q_vectors, 1) +#define TXGBE_INTR_MISC (A ) BIT((A)->num_q_vectors) +#define TXGBE_INTR_QALL (A ) (TXGBE_INTR_MISC(A) - 1)#define TXGBE_MAX_EITR GENMASK(11, 3)
Jiawen Wu
maintainerPATCH 1/1 net: wangxun: revert the adjustment of the IRQ vector sequence
Due to hardware limitations of NGBE, queue IRQs can only be requested on vector 0 to 7. When the number of queues is set to the maximum 8, the PCI IRQ vectors are allocated from 0 to 8. The vector 0 is used by MISC interrupt, and althrough the vector 8 is used by queue interrupt, it is unable to receive packets. This will cause some packets to be dropped when RSS is enabled and they are assigned to queue 8.
So revert the adjustment of the MISC IRQ location, to make it be the last one in IRQ vectors.
(cherry picked from commit e37546ad1f9b2c777d3a21d7e50ce265ee3dece8)
--- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 16 ++++++++-------- drivers/net/ethernet/wangxun/libwx/wx_type.h | 2 +- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +- drivers/net/ethernet/wangxun/ngbe/ngbe_type.h | 2 +- drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c | 4 ++-- drivers/net/ethernet/wangxun/txgbe/txgbe_type.h | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-)
drivers/net/ethernet/wangxun/libwx/wx_lib.c +8 -8
@@ -1624,7 +1624,7 @@ static void wx_set_num_queues(struct wx *wx)*/ static int wx_acquire_msix_vectors (struct wx *wx) { -struct irq_affinity affd = { .pre_vectors =1 }; +struct irq_affinity affd = { .post_vectors =1 };int nvecs, i;/* We start by asking for one vector per queue pair */
@@ -1661,16 +1661,17 @@ static int wx_acquire_msix_vectors(struct wx *wx)return nvecs; } - wx->msix_entry->entry =0 ; - wx->msix_entry->vector =pci_irq_vector (wx->pdev,0 ); nvecs -=1 ;for (i =0 ; i < nvecs; i++) { wx->msix_q_entries[i].entry = i; - wx->msix_q_entries[i].vector =pci_irq_vector (wx->pdev, i +1 ); + wx->msix_q_entries[i].vector =pci_irq_vector (wx->pdev, i); } wx->num_q_vectors = nvecs; + wx->msix_entry->entry = nvecs; + wx->msix_entry->vector =pci_irq_vector (wx->pdev, nvecs); +return 0 ; }
@@ -2120,7 +2121,6 @@ static void wx_set_ivar(struct wx *wx, s8 direction,wr32 (wx,WX_PX_MISC_IVAR , ivar); }else {/* tx or rx causes */ - msix_vector +=1 ;/* offset for queue vectors */ msix_vector |=WX_PX_IVAR_ALLOC_VAL ; index = ((16 * (queue &1 )) + (8 * direction)); ivar =rd32 (wx,WX_PX_IVAR (queue >>1 ));
@@ -2151,7 +2151,7 @@ void wx_write_eitr(struct wx_q_vector *q_vector) itr_reg |=WX_PX_ITR_CNT_WDIS ; -wr32 (wx,WX_PX_ITR (v_idx +1 ), itr_reg); +wr32 (wx,WX_PX_ITR (v_idx), itr_reg); }/**
@@ -2197,9 +2197,9 @@ void wx_configure_vectors(struct wx *wx)wx_write_eitr (q_vector); } -wx_set_ivar (wx,-1 ,0 ,0 ); +wx_set_ivar (wx,-1 ,0 , v_idx);if (pdev->msix_enabled) -wr32 (wx,WX_PX_ITR (0 ),1950 ); +wr32 (wx,WX_PX_ITR (v_idx),1950 ); }EXPORT_SYMBOL (wx_configure_vectors);
drivers/net/ethernet/wangxun/libwx/wx_type.h +1 -1
@@ -1136,7 +1136,7 @@ struct wx { };#define WX_INTR_ALL (~0ULL) -#define WX_INTR_Q (i) BIT((i) + 1) +#define WX_INTR_Q (i) BIT((i))/* register operations */ #define wr32 (a, reg, value) writel((value), ((a)->hw_addr + (reg)))
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +1 -1
@@ -154,7 +154,7 @@ static void ngbe_irq_enable(struct wx *wx, bool queues)if (queues)wx_intr_enable (wx,NGBE_INTR_ALL );else -wx_intr_enable (wx,NGBE_INTR_MISC ); +wx_intr_enable (wx,NGBE_INTR_MISC (wx)); }/**
drivers/net/ethernet/wangxun/ngbe/ngbe_type.h +1 -1
@@ -80,7 +80,7 @@ NGBE_PX_MISC_IEN_GPIO)#define NGBE_INTR_ALL 0x1FF -#define NGBE_INTR_MISC BIT(0) +#define NGBE_INTR_MISC (A ) BIT((A)->num_q_vectors)#define NGBE_PHY_CONFIG (reg_offset) (0x14000 + ((reg_offset) * 4))#define NGBE_CFG_LAN_SPEED 0x14440
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c +2 -2
@@ -21,7 +21,7 @@ void txgbe_irq_enable(struct wx *wx, bool queues)wr32 (wx,WX_PX_MISC_IEN ,TXGBE_PX_MISC_IEN_MASK );/* unmask interrupt */ -wx_intr_enable (wx,TXGBE_INTR_MISC ); +wx_intr_enable (wx,TXGBE_INTR_MISC (wx));if (queues)wx_intr_enable (wx,TXGBE_INTR_QALL (wx)); }
@@ -147,7 +147,7 @@ static irqreturn_t txgbe_misc_irq_thread_fn(int irq, void *data) nhandled++; } -wx_intr_enable (wx,TXGBE_INTR_MISC ); +wx_intr_enable (wx,TXGBE_INTR_MISC (wx));return (nhandled >0 ?IRQ_HANDLED :IRQ_NONE ); }
drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +2 -2
@@ -264,8 +264,8 @@ struct txgbe_fdir_filter {#define TXGBE_DEFAULT_RX_WORK 128#endif -#define TXGBE_INTR_MISC BIT(0) -#define TXGBE_INTR_QALL (A ) GENMASK((A)->num_q_vectors, 1) +#define TXGBE_INTR_MISC (A ) BIT((A)->num_q_vectors) +#define TXGBE_INTR_QALL (A ) (TXGBE_INTR_MISC(A) - 1)#define TXGBE_MAX_EITR GENMASK(11, 3)
Signature · 1 line
2.48.1