RE: [PATCH net-next v11 4/7] r8169: enable new interrupt mapping

From: Javen

Date: Mon Aug 17 2026 - 03:25:19 EST


>
>
>On 8/13/26 6:52 PM, javen wrote:
>> From: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
>>
>> This patch enables new interrupt mapping for RTL8127 and add error
>> pkts counter per ring.
>>
>> Signed-off-by: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
>> ---
>> Changes in v2:
>> - no changes
>>
>> Changes in v3:
>> - no changes
>>
>> Changes in v4:
>> - no changes
>>
>> Changes in v5:
>> - no changes
>>
>> Changes in v6:
>> - no changes
>>
>> Changes in v7:
>> - no changes
>>
>> Changes in v8:
>> - no changes
>>
>> Changes in v9:
>> - no changes
>>
>> Changes in v10:
>> - no changes
>>
>> Changes in v11:
>> - add error pkts counter per ring
>> ---
>> drivers/net/ethernet/realtek/r8169_main.c | 80 +++++++++++++++++++----
>> 1 file changed, 68 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c
>> b/drivers/net/ethernet/realtek/r8169_main.c
>> index b30f0a31d7c7..aa72c42c374d 100644
>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -29,6 +29,7 @@
>> #include <linux/prefetch.h>
>> #include <linux/ipv6.h>
>> #include <linux/unaligned.h>
>> +#include <linux/u64_stats_sync.h>
>> #include <net/ip6_checksum.h>
>> #include <net/netdev_queues.h>
>> #include <net/phy/realtek_phy.h>
>> @@ -754,6 +755,15 @@ struct rtl8169_rx_ring {
>> dma_addr_t rx_desc_phy_addr[NUM_RX_DESC];
>> dma_addr_t rx_phy_addr;
>> struct page *rx_databuff[NUM_RX_DESC];
>> +
>> + struct {
>> + u64 rx_errors;
>> + u64 rx_dropped;
>> + u64 rx_length_errors;
>> + u64 rx_crc_errors;
>> + u64 multicast;
>> + struct u64_stats_sync syncp;
>> + } stats;
>> };
>>
>> struct rtl8169_private {
>> @@ -3939,6 +3949,15 @@ DECLARE_RTL_COND(rtl_mac_ocp_e00e_cond)
>> return r8168_mac_ocp_read(tp, 0xe00e) & BIT(13);
>> }
>>
>> +static void rtl8169_hw_enable_vec_mapping(struct rtl8169_private *tp)
>> +{
>> + u8 tmp;
>> +
>> + tmp = RTL_R8(tp, INT_CFG0_8125);
>> + tmp |= INT_CFG0_ENABLE_8125;
>> + RTL_W8(tp, INT_CFG0_8125, tmp);
>> +}
>> +
>> static void rtl_hw_start_8125_common(struct rtl8169_private *tp)
>> {
>> rtl_pcie_state_l2l3_disable(tp); @@ -3947,6 +3966,9 @@ static
>> void rtl_hw_start_8125_common(struct rtl8169_private *tp)
>> RTL_W32(tp, RSS_CTRL_8125, 0);
>> RTL_W16(tp, Q_NUM_CTRL_8125, 0);
>>
>> + if (tp->irq_nvecs > 1)
>> + rtl8169_hw_enable_vec_mapping(tp);
>> +
>> /* disable UPS */
>> r8168_mac_ocp_modify(tp, 0xd40a, 0x0010, 0x0000);
>>
>> @@ -4347,7 +4369,7 @@ static int rtl8169_init_ring(struct
>> rtl8169_private *tp)
>>
>> memset(tp->tx_skb, 0, sizeof(tp->tx_skb));
>>
>> - for (i = 0; i < tp->num_rx_rings; i++) {
>> + for (int i = 0; i < tp->num_rx_rings; i++) {
>
>This looks like an unrelated change. Looking the function body, this is
>introducing a new bug on the cleanup path by changing the scope of i.

Yes, this change have been dropped in the next version.

Thanks,
Javen