Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Feb 2000 03:18:12 -0700
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        freebsd-net@FreeBSD.ORG
Subject:   Re: anyone know about 802.3x flow control? (SOLVED!)
Message-ID:  <20000205031812.A755@panzer.kdm.org>
In-Reply-To: <20000201224859.A38780@panzer.kdm.org>; from ken@kdm.org on Tue, Feb 01, 2000 at 10:48:59PM -0700
References:  <20000201224859.A38780@panzer.kdm.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii

[ I've solved the problem, parts of my original message are included for
context ]

On Tue, Feb 01, 2000 at 22:48:59 -0700, Kenneth D. Merry wrote:
> 
> I've got an Intel 410T standalone switch for my home network:
> 
> http://www.intel.com/network/products/exp410t.htm
> 
> I've got four machines hooked to it, which have:
> 
> Card			Speed			Driver
> no-name DEC 21140A	100Mbps, full duplex	de
> SMC 8216		10Mbps, half duplex	ed
> Intel 82559		100Mbps, full duplex	fxp
> HP JetDirect		100Mbps, full duplex	(it's a printer)
> 
> Everything works fine, but I noticed something odd on the machine with 
> the Intel ethernet board tonight.  It was getting tons of packets every
> second (several screens full) from the switch.
> 
> The packets looked like this in tcpdump:
> 
> 22:15:53.313742 0:0:0:0:0:10 1:80:c2:0:0:1 8808 60:
>                          0001 0000 0000 8808 0001 0000 0000 8808
>                          0001 0000 0000 8808 0001 0000 0000 8808
>                          0001 0000 0000 8808 0001 0000 0000
> 22:15:53.355673 0:0:0:0:0:10 1:80:c2:0:0:1 8808 60:
>                          0001 0000 0000 8808 0001 0000 0000 8808
>                          0001 0000 0000 8808 0001 0000 0000 8808
>                          0001 0000 0000 8808 0001 0000 0000

[ ... ]

> So I went into the switch configuration menu (via the serial port) and
> disabled flow control on port 10.  The packets above stopped.  Now,
> occasionally (once every minute or two, maybe?) I get packets like this:

[ ... ]

> I assume the above storm of packets was due to the "IEEE 802.3x
> standards-based flow control." that the switch supports, but what I don't
> understand is why the packets kept coming.
> 
> Is this something that the card is supposed to intercept somehow and deal
> with, or is it something that the OS is supposed to intercept and deal
> with?  I'd guess the latter, but I'd like to know more about it, and
> perhaps why my switch kept spewing.  (Naturally, Intel's web site didn't
> have much helpful information that I could find.)

Just for the record, I've managed to solve (I think!) the problem.  I no
longer get the spurious packets, and my throughput seems fine.

I spent some time looking through the Linux driver for the EtherExpress
Pro boards, and found that there *is* a flow control setting on the card,
and that it wasn't being set in the fxp driver.

The attached patch seems to work fine for me, but there are a few caveats
with it:

1.	I don't know what the bits do, or whether all of them are necessary
	for flow control.
  
2.	I have only tested this on my 82559 "InBusiness" board, so I don't
	know what it will do to say a vanilla 82557.
  
3.	The Linux driver has some sort of timeout routine that checks to
	see if the link is down, and then queries the PHY about the flow
	control settings, and optionally changes the flow control setting
	on the chip.  I don't know whether that timeout routine is called
	regularly, in a polling type manner, or whether it is more like the
	watchdog routines in BSD network drivers.  It doesn't quite look to
	be the equivalent of the BSD watchdog routines, so I didn't see an
	analogous routine in the fxp driver to put in the flow control
	check.
	
Anyway, here's the patch, it works for me, and maybe it'll help someone
else out.

Ken
-- 
Kenneth Merry
ken@kdm.org

--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="if_fxp.flow_control.20000205"

==== //depot/FreeBSD-ken/src/sys/pci/if_fxp.c#2 - /a/ken/perforce/FreeBSD-ken/src/sys/pci/if_fxp.c ====
*** /tmp/tmp.568.0	Sat Feb  5 02:53:13 2000
--- /a/ken/perforce/FreeBSD-ken/src/sys/pci/if_fxp.c	Sat Feb  5 02:33:33 2000
***************
*** 1427,1432 ****
--- 1427,1433 ----
  	cbp->stripping =	!prm;	/* truncate rx packet to byte count */
  	cbp->padding =		1;	/* (do) pad short tx packets */
  	cbp->rcv_crc_xfer =	0;	/* (don't) xfer CRC to host */
+ 	cbp->flow_control =	0x3d;	/* turn on 802.3x flow control */
  	cbp->force_fdx =	0;	/* (don't) force full duplex */
  	cbp->fdx_pin_en =	1;	/* (enable) FDX# pin */
  	cbp->multi_ia =		0;	/* (don't) accept multiple IAs */
==== //depot/FreeBSD-ken/src/sys/pci/if_fxpreg.h#2 - /a/ken/perforce/FreeBSD-ken/src/sys/pci/if_fxpreg.h ====
*** /tmp/tmp.568.1	Sat Feb  5 02:53:13 2000
--- /a/ken/perforce/FreeBSD-ken/src/sys/pci/if_fxpreg.h	Sat Feb  5 02:52:29 2000
***************
*** 161,167 ****
  				padding:1,
  				rcv_crc_xfer:1,
  				:5;
! 	volatile u_int		:6,
  				force_fdx:1,
  				fdx_pin_en:1;
  	volatile u_int		:6,
--- 161,172 ----
  				padding:1,
  				rcv_crc_xfer:1,
  				:5;
! 	/*
! 	 * IEEE 802.3x flow control:
! 	 * 0     == off
! 	 * 0x3d  == on
! 	 */
! 	volatile u_int		flow_control:6,
  				force_fdx:1,
  				fdx_pin_en:1;
  	volatile u_int		:6,

--oyUTqETQ0mS9luUI--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000205031812.A755>