Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2005 12:27:49 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Pyun YongHyeon <yongari@rndsoft.co.kr>
Cc:        freebsd-sparc64@freebsd.org
Subject:   Re: em(4) patch
Message-ID:  <20050414192749.GO56487@funkthat.com>
In-Reply-To: <20050414092608.GB2855@michelle.rndsoft.co.kr>
References:  <20050414092608.GB2855@michelle.rndsoft.co.kr>

next in thread | previous in thread | raw e-mail | index | archive | help
Pyun YongHyeon wrote this message on Thu, Apr 14, 2005 at 18:26 +0900:
> I have a initial patch that make em(4) work on sparc64.
> The patch seems to work but it may have uncovered bugs in it.
> The chagnges are

wierd, I recently had one probe, but never tried to use it...

> . outl/inl -> bus_space_read/bus_space_write
> . 64bit IO BAR check(Obtained from OpenBSD)
> . add suspend/resume code(not tested)
> . printf -> device_printf
> . fix memory/resource leakages
> . always honor IFF_OACTIVE flag

I made this mistake before myself.. Make sure you read the comment
describing OACTIVE..  you only set OACTIVE when the TX queue is full,
and clear it when it is not full.. not always set it when the board
is transmitting:
define    IFF_OACTIVE     0x400           /* tx hardware queue is full */

> . don't blidnly call RX/TX handlers
> . remove EM_MAX_INTR loops
> . create TX dmamap at device initialization
> . enable PCI memory write and invalidate
> . EM_MMBA -> PCIR_BAR(0)
> . TX/RX descriptor alignment is 16 not PAGE_SIZE
> . TX/RX descriptor length should be multiple of 128 not 4096.

You should probably use a define for this...

> . don't create MCLBYTES*8 size TX buffers if we are not use JUMBO frame
> . use bus_dmamap_load_mbuf_sg() for loading RX buffers.
> . always print watchdog timeout message(Obtained from OpenBSD)
> . don't count twice in some statistics(Obtained from OpenBSD)
> 
> I have tested 82545GM chipset based card on Ultra60(SMP). VLAN and
> POLLING were not tested at all so it may have bugs. JUMBO frame support
> needs more coding and cleanups since sparc64 does not allow non-aligned
> memory access. So don't try to use JUMBO frame at this time.
> If you want to test em(4) on SMP with ofw_console you need additional
> patch. Alternatively you can use sc(4) or serial console.
> I'd like to hear success/failure.

I think you should put back the while(!IFQ_DRV_IS_EMPTY, loop..  It
prevents an unnessary lock/unlock if both queues are empty...

Also, I have work in progress to make non-aligned packets better...
I committed part of it as the m_copyup change...  On a -current, you
should just be able to apply the following change:
http://perforce.freebsd.org/fileDiffView.cgi?FSPC=//depot/user/jmg/arm/src/sys/netinet/ip%5finput.c&REV=3&ACT=edit

I'll try the patch when I get home...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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