* [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168
@ 2019-03-31 13:43 Heiner Kallweit
2019-03-31 18:13 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2019-03-31 13:43 UTC (permalink / raw)
To: Realtek linux nic maintainers, David Miller; +Cc: netdev@vger.kernel.org
In contrast to switching rx irq coalescing off what fixed an issue,
switching tx irq coalescing off is merely a latency optimization,
therefore net-next. As part of this change:
- Remove INTT_0 .. INTT_3 constants, they aren't used.
- Remove comment in rtl_hw_start_8169(), we now have a detailed
description by the code in rtl_set_coalesce().
- Due to switching irq coalescing off per default we don't need the
initialization in rtl_hw_start_8168(). If ethtool is used to switch
on coalescing then rtl_set_coalesce() will configure this register.
For the sake of completeness: This patch just changes the default.
Users still have the option to configure irq coalescing via ethtool.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/ethernet/realtek/r8169.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 8a8a4f70d..8f065bf3e 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -490,10 +490,6 @@ enum rtl_register_content {
PCIDAC = (1 << 4),
PCIMulRW = (1 << 3),
#define INTT_MASK GENMASK(1, 0)
- INTT_0 = 0x0000, // 8168
- INTT_1 = 0x0001, // 8168
- INTT_2 = 0x0002, // 8168
- INTT_3 = 0x0003, // 8168
/* rtl8169_PHYstatus */
TBI_Enable = 0x80,
@@ -4702,6 +4698,8 @@ static void rtl_hw_start(struct rtl8169_private *tp)
rtl_set_rx_tx_desc_registers(tp);
rtl_lock_config_regs(tp);
+ /* disable interrupt coalescing */
+ RTL_W16(tp, IntrMitigate, 0x0000);
/* Initially a 10 us delay. Turned it into a PCI commit. - FR */
RTL_R8(tp, IntrMask);
RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
@@ -4734,12 +4732,6 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
rtl8169_set_magic_reg(tp, tp->mac_version);
- /*
- * Undocumented corner. Supposedly:
- * (TxTimer << 12) | (TxPackets << 8) | (RxTimer << 4) | RxPackets
- */
- RTL_W16(tp, IntrMitigate, 0x0000);
-
RTL_W32(tp, RxMissed, 0);
}
@@ -5456,12 +5448,6 @@ static void rtl_hw_start_8168(struct rtl8169_private *tp)
{
RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
- tp->cp_cmd &= ~INTT_MASK;
- tp->cp_cmd |= PktCntrDisable | INTT_1;
- RTL_W16(tp, CPlusCmd, tp->cp_cmd);
-
- RTL_W16(tp, IntrMitigate, 0x5100);
-
/* Work around for RxFIFO overflow. */
if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
tp->irq_mask |= RxFIFOOver;
@@ -5749,8 +5735,6 @@ static void rtl_hw_start_8101(struct rtl8169_private *tp)
rtl_hw_start_8168h_1(tp);
break;
}
-
- RTL_W16(tp, IntrMitigate, 0x0000);
}
static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168
2019-03-31 13:43 [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168 Heiner Kallweit
@ 2019-03-31 18:13 ` David Miller
2019-03-31 18:16 ` Heiner Kallweit
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2019-03-31 18:13 UTC (permalink / raw)
To: hkallweit1; +Cc: nic_swsd, netdev
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 31 Mar 2019 15:43:59 +0200
> @@ -5456,12 +5448,6 @@ static void rtl_hw_start_8168(struct rtl8169_private *tp)
> {
> RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
>
> - tp->cp_cmd &= ~INTT_MASK;
> - tp->cp_cmd |= PktCntrDisable | INTT_1;
> - RTL_W16(tp, CPlusCmd, tp->cp_cmd);
> -
> - RTL_W16(tp, IntrMitigate, 0x5100);
> -
> /* Work around for RxFIFO overflow. */
This patch isn't against net-next.
I'm guessing it's against a tree with the RX coalesce disable changes
applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168
2019-03-31 18:13 ` David Miller
@ 2019-03-31 18:16 ` Heiner Kallweit
2019-03-31 18:23 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2019-03-31 18:16 UTC (permalink / raw)
To: David Miller; +Cc: nic_swsd, netdev
On 31.03.2019 20:13, David Miller wrote:
> From: Heiner Kallweit <hkallweit1@gmail.com>
> Date: Sun, 31 Mar 2019 15:43:59 +0200
>
>> @@ -5456,12 +5448,6 @@ static void rtl_hw_start_8168(struct rtl8169_private *tp)
>> {
>> RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
>>
>> - tp->cp_cmd &= ~INTT_MASK;
>> - tp->cp_cmd |= PktCntrDisable | INTT_1;
>> - RTL_W16(tp, CPlusCmd, tp->cp_cmd);
>> -
>> - RTL_W16(tp, IntrMitigate, 0x5100);
>> -
>> /* Work around for RxFIFO overflow. */
>
> This patch isn't against net-next.
>
> I'm guessing it's against a tree with the RX coalesce disable changes
> applied.
>
You're right, sorry. It will apply cleanly only once net has been merged
into net-next. However, if I rebase this patch to net-next, then merging
net to net-next will complain. Can we defer applying this patch until net
has been merged?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168
2019-03-31 18:16 ` Heiner Kallweit
@ 2019-03-31 18:23 ` David Miller
2019-03-31 18:33 ` Heiner Kallweit
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2019-03-31 18:23 UTC (permalink / raw)
To: hkallweit1; +Cc: nic_swsd, netdev
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 31 Mar 2019 20:16:51 +0200
> Can we defer applying this patch until net has been merged?
Yes, but please mention such dependencies next time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168
2019-03-31 18:23 ` David Miller
@ 2019-03-31 18:33 ` Heiner Kallweit
0 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2019-03-31 18:33 UTC (permalink / raw)
To: David Miller; +Cc: nic_swsd, netdev
On 31.03.2019 20:23, David Miller wrote:
> From: Heiner Kallweit <hkallweit1@gmail.com>
> Date: Sun, 31 Mar 2019 20:16:51 +0200
>
>> Can we defer applying this patch until net has been merged?
>
Thanks
> Yes, but please mention such dependencies next time.
>
OK
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-31 18:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-31 13:43 [PATCH net-next] r8169: disable tx interrupt coalescing on RTL8168 Heiner Kallweit
2019-03-31 18:13 ` David Miller
2019-03-31 18:16 ` Heiner Kallweit
2019-03-31 18:23 ` David Miller
2019-03-31 18:33 ` Heiner Kallweit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox