Re: [PATCH -rt DO NOT APPLY] Fix for tg3 networking lockup

2006-08-25 Thread Marc Bevand

On 8/25/06, Michael Chan <[EMAIL PROTECTED]> wrote:


The reason is that TSO on 5704 and older chips is done by firmware.  ASF
is also implemented by firmware.  If ASF is enabled, there is no room to
do TSO and ASF at the same time.


Just for test purpose, I have applied the following patch to my tg3.c. I now
seem to be able to enable/disable TSO, but I admit don't know whether ASF
is still functional or not.

   else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
   GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
-   tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
-   (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
+   tp->pci_chip_rev_id == CHIPREV_ID_5705_A0) {
   tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
   } else {

Then tg3 considered my interface as TSO-capable ("TSOcap[1]" in dmesg).
TSO was still disabled by default, which is normal because there is this other
check a couple of lines below:

   /* TSO is on by default on chips that support hardware TSO.
* Firmware TSO on older chips gives lower performance, so it
* is off by default, but can be enabled using ethtool.
*/
   if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
   dev->features |= NETIF_F_TSO;

But I was able to turn TSO on via ethtool -K. This is exactly the behavior I
would like to see in tg3. So are you saying the patch I applied actually
breaks ASF ?


Firmware-based TSO is actually slower than no TSO.  The only benefit is
a little better CPU utilization.


I know, in one of my test-cases, firmware TSO reduces the max achievable
TCP bandwidth from 930 to 840 Mbit/s on a GigE network while reducing
the CPU utilization from 44% to 22%. I think firmware TSO still makes sense
in some cases.

--
Marc Bevand
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH -rt DO NOT APPLY] Fix for tg3 networking lockup

2006-08-25 Thread Marc Bevand
Michael Chan  broadcom.com> writes:
>
> Turning off ASF is just a matter of changing some bits in NVRAM
> and recalculating the checksum.  If you need the tool to do this,
> I'll have someone send it to you.
>
> Note that on some of the blade servers, I believe ASF is vital
> and should not be disabled.

Still, it would be great if ASF could be disabled, because I have
noticed that when ASF is enabled, the tg3 driver automatically disables
TSO (TCP Segmentation Offloading). Here is a dmesg output from a server
where I am seeing that behavior:

  eth0: Tigon3 [partno(BCM95704A6) rev 2100 PHY(5704)] (PCIX:133MHz:64-bit) \
10/100/1000BaseT Ethernet 00:30:48:59:c4:94
  eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] Split[0] WireSpeed[1] TSOcap[0]
  [...]
  eth1: Tigon3 [partno(BCM95704A6) rev 2100 PHY(5704)] (PCIX:133MHz:64-bit) \
10/100/1000BaseT Ethernet 00:30:48:59:c4:95
  eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] Split[0] WireSpeed[1] TSOcap[1]

Both interfaces are fundamentally TSO-capable, but since ASF is enabled
on eth0, tg3 disables TSO on this interface. Of course at this point it
is not even possible to use ethtool to re-enable it because the driver
considers eth0 as not TSO-capable at all.

As far as I know, the tg3 driver has been doing that since one of your
patches shipped with 2.6.11-rc2-bk3, Michael, see [1]. Here is the relevant
code snippet (line numbers are for 2.6.16):

  10835   if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
  10836   tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
  10837   }
  10838   else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
  10839   GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 ||
  10840   tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 ||
  10841   (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) {
  10842   tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
  10843   } else {
  10844   tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
  10845   }

The culprit is line 10841. Why is that done ?

[1] ftp://ftp.us.kernel.org:/pub/linux/kernel/v2.6/snapshots/old/
patch-2.6.11-rc2-bk3.log, patch-2.6.11-rc2-bk3.bz2

--
Marc Bevand


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html