dragonfly.git
15 years agoroute: Suppress duplicated rtmsgs on ARP input path.
Sepherosa Ziehau [Mon, 2 Feb 2009 12:08:57 +0000 (20:08 +0800)]
route: Suppress duplicated rtmsgs on ARP input path.

15 years agoroute: Suppress duplicated rtmsgs on route_output(RTM_CHANGE) path
Sepherosa Ziehau [Mon, 2 Feb 2009 10:59:23 +0000 (18:59 +0800)]
route: Suppress duplicated rtmsgs on route_output(RTM_CHANGE) path

15 years agoroute: Suppress duplicated rtmsgs generated by rtlookup() in rt_setgate()
Sepherosa Ziehau [Mon, 2 Feb 2009 09:56:48 +0000 (17:56 +0800)]
route: Suppress duplicated rtmsgs generated by rtlookup() in rt_setgate()

Add 'generate_report' parameter to rt_setgate().  In rt_setgate(), instead
of passing RTL_REPORTMSG to rtlookup(), we pass 'generated_report' to
rtlookup().

For rtrequset1(RTM_ADD) and rtredirect(), which always go through all CPUs,
we only need to generate rtmsg on CPU0.  For {arp,atm,nd6}_rtrequest(),
there is no need to generated rtmsg.

15 years agortsock: Fill in the correct rtm_index for RTM_ADD and RTM_CHANGE messages.
Sepherosa Ziehau [Sun, 1 Feb 2009 04:02:16 +0000 (12:02 +0800)]
rtsock: Fill in the correct rtm_index for RTM_ADD and RTM_CHANGE messages.

Obtained-from: OpenBSD via FreeBSD (part of net/rtsock.c rev1.133)

15 years agortsock: Use M_ASSERTPKTHDR()
Sepherosa Ziehau [Sun, 1 Feb 2009 03:18:29 +0000 (11:18 +0800)]
rtsock: Use M_ASSERTPKTHDR()

15 years agortsock: Break long line
Sepherosa Ziehau [Sun, 1 Feb 2009 03:16:21 +0000 (11:16 +0800)]
rtsock: Break long line

15 years agortsock: Fill in the rtm_index field whenever we have an interface pointer.
Sepherosa Ziehau [Sun, 1 Feb 2009 03:13:45 +0000 (11:13 +0800)]
rtsock: Fill in the rtm_index field whenever we have an interface pointer.

Obtained-from: FreeBSD (net/rtsock.c rev1.123)

15 years agortsock: White space
Sepherosa Ziehau [Sun, 1 Feb 2009 03:07:24 +0000 (11:07 +0800)]
rtsock: White space

15 years agortsock: Use rtsearch_global() for RTM_GET
Sepherosa Ziehau [Sat, 31 Jan 2009 10:33:42 +0000 (18:33 +0800)]
rtsock: Use rtsearch_global() for RTM_GET

15 years agortsock: Unbreak RTM_LOCK support by using rtsearch_global()
Sepherosa Ziehau [Sat, 31 Jan 2009 10:08:25 +0000 (18:08 +0800)]
rtsock: Unbreak RTM_LOCK support by using rtsearch_global()

15 years agoroute: Add rtsearch_global(), which is used to fix RTM_CHANGE support.
Sepherosa Ziehau [Sat, 31 Jan 2009 09:54:12 +0000 (17:54 +0800)]
route: Add rtsearch_global(), which is used to fix RTM_CHANGE support.

rtsearch_global() forwards a netmsg to each CPUs.  On each CPU, it
uses radix tree lookup function to locate the requested route, if the
route is found, then call the passed in callback.  The callback could
return error thus terminate the message forwarding.  If the requested
route was not found on any of the CPUs, then ESRCH is replied on the
last CPU.

15 years agortsock: Minor style change
Sepherosa Ziehau [Sat, 31 Jan 2009 05:26:18 +0000 (13:26 +0800)]
rtsock: Minor style change

15 years agortsock: Fix a reversed condition
Sepherosa Ziehau [Sat, 31 Jan 2009 05:16:59 +0000 (13:16 +0800)]
rtsock: Fix a reversed condition

15 years agortsock: Fix !SO_USELOOPBACK support in route_output()
Sepherosa Ziehau [Sat, 31 Jan 2009 04:07:32 +0000 (12:07 +0800)]
rtsock: Fix !SO_USELOOPBACK support in route_output()

Old BSD code assumes that rts_input() is synchronous, so clear/set
sp_family could be used to skip the current rawcb.  However, our
rts_input() is asynchronous, thus the clear/set sp_family trick no
longer takes any effect.

Reimplement the rawcb skipping in the following way:
- Record the address of rawcb to be skipped in netmsg.
- Extend raw_input() interface to accept a 'skip' argument.  At the
  beginning of the rawcb list iteration, check the address of the
  current rawcb against the 'skip'.

15 years agobusdma(9): Dup i386 busdma_machdep.c to vkernel
Sepherosa Ziehau [Thu, 29 Jan 2009 11:25:37 +0000 (19:25 +0800)]
busdma(9): Dup i386 busdma_machdep.c to vkernel

15 years agobusdma(9): Dup i386 busdma_machdep.c to amd64
Sepherosa Ziehau [Thu, 29 Jan 2009 11:24:33 +0000 (19:24 +0800)]
busdma(9): Dup i386 busdma_machdep.c to amd64

15 years agoUnbreak LINT build
Sepherosa Ziehau [Thu, 29 Jan 2009 10:51:10 +0000 (18:51 +0800)]
Unbreak LINT build

15 years agosis(4): Rework busdma(9) related bits
Sepherosa Ziehau [Thu, 29 Jan 2009 08:25:56 +0000 (16:25 +0800)]
sis(4): Rework busdma(9) related bits

- RX/TX descriptor rings need to be 4bytes aligned.
- RX buffers need to be 4bytes aligned.
- Create TX/RX buffer busdma map at attaching time and destroy them
  at detaching time.
- Rework sis_newbuf() by utilizing bus_dmamap_load_mbuf_segment().
- Factor sis_setup_rxdesc() out of sis_newbuf() and call it on RX
  error handling path.
- Rework sis_encap() by utilizing bus_dmamap_load_mbuf_defrag().
- Correct IFF_OACTIVE handling in sis_start()/sis_txeof().

15 years agosis(4): Move software specific fields out of hardware descriptor structure
Sepherosa Ziehau [Thu, 29 Jan 2009 03:39:40 +0000 (11:39 +0800)]
sis(4): Move software specific fields out of hardware descriptor structure

15 years agobce(4): Remove unnecessary bus_dmamap_sync()
Sepherosa Ziehau [Wed, 28 Jan 2009 12:16:51 +0000 (20:16 +0800)]
bce(4): Remove unnecessary bus_dmamap_sync()

15 years agobce(4): Adjust RX path to avoid fatal error caused by busdma failure
Sepherosa Ziehau [Tue, 27 Jan 2009 14:53:18 +0000 (22:53 +0800)]
bce(4): Adjust RX path to avoid fatal error caused by busdma failure

- Create tmp busdma map for loading mbuf on RX path, so busdma map
  loading failure will not be fatal.
- Don't unload RX buffer's busdma map until we could make sure that
  new RX buffer could be loaded.
- On RX path, if error happens, we only need to reconfigure RX desc,
  so just call bce_setup_rxdesc_std().
- Make sure that sw_chain_cons and sw_chain_prod are same, else
  log error and reconfigure the RX desc indiced by sw_chain_cons.
- Utilize bus_dmamap_load_mbuf_segment().

15 years agobce(4): Factor RX desc setup out of bce_newbuf_std()
Sepherosa Ziehau [Tue, 27 Jan 2009 09:00:27 +0000 (17:00 +0800)]
bce(4): Factor RX desc setup out of bce_newbuf_std()

15 years agobce(4): Utilize bus_dmamap_load_mbuf_defrag()
Sepherosa Ziehau [Tue, 27 Jan 2009 05:05:12 +0000 (13:05 +0800)]
bce(4): Utilize bus_dmamap_load_mbuf_defrag()

15 years agobce(4): Use coherent for non-buffer data storage
Sepherosa Ziehau [Tue, 27 Jan 2009 04:37:30 +0000 (12:37 +0800)]
bce(4): Use coherent for non-buffer data storage

- Utilize bus_dmamem_coherent_any()
- Put RX/TX pages into coherent memory
- Don't sync coherent memory

15 years agobce(4): Correct parameters passed to busdma(9) functions
Sepherosa Ziehau [Tue, 27 Jan 2009 03:20:33 +0000 (11:20 +0800)]
bce(4): Correct parameters passed to busdma(9) functions

15 years agostge(4): Remove unnecessary bus_dmamap_sync()
Sepherosa Ziehau [Mon, 26 Jan 2009 14:07:10 +0000 (22:07 +0800)]
stge(4): Remove unnecessary bus_dmamap_sync()

15 years agostge(4): Adjust TX path
Sepherosa Ziehau [Mon, 26 Jan 2009 13:53:25 +0000 (21:53 +0800)]
stge(4): Adjust TX path

- Utilize bus_dmamap_load_mbuf_defrag()
- Sync TX buffer before setup the TX desc
- In stge_{txeof,start}(), use the same condition to clear/set IFF_OACTIVE

15 years agostge(4): Utilize bus_dmamap_load_mbuf_segment()
Sepherosa Ziehau [Mon, 26 Jan 2009 12:25:41 +0000 (20:25 +0800)]
stge(4): Utilize bus_dmamap_load_mbuf_segment()

15 years agostge(4): Don't sync coherent memory
Sepherosa Ziehau [Mon, 26 Jan 2009 12:08:15 +0000 (20:08 +0800)]
stge(4): Don't sync coherent memory

15 years agostge(4): Adjust the error handling code on stge_dma_alloc()
Sepherosa Ziehau [Mon, 26 Jan 2009 12:05:03 +0000 (20:05 +0800)]
stge(4): Adjust the error handling code on stge_dma_alloc()

15 years agostge(4): Utilize bus_dmamem_coherent_any()
Sepherosa Ziehau [Mon, 26 Jan 2009 11:45:29 +0000 (19:45 +0800)]
stge(4): Utilize bus_dmamem_coherent_any()

15 years agostge(4): Regroup busdma tag creation; prepare for the upcoming changes
Sepherosa Ziehau [Mon, 26 Jan 2009 11:31:44 +0000 (19:31 +0800)]
stge(4): Regroup busdma tag creation; prepare for the upcoming changes

15 years agostge(4): Correct parameters passed to busdma(9) functions
Sepherosa Ziehau [Mon, 26 Jan 2009 11:22:07 +0000 (19:22 +0800)]
stge(4): Correct parameters passed to busdma(9) functions

15 years agoet(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()
Sepherosa Ziehau [Mon, 26 Jan 2009 07:11:56 +0000 (15:11 +0800)]
et(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()

15 years agoet(4): Split RX/TX mbuf busdma tag
Sepherosa Ziehau [Mon, 26 Jan 2009 06:52:42 +0000 (14:52 +0800)]
et(4): Split RX/TX mbuf busdma tag

15 years agoet(4): Don't sync coherent memory
Sepherosa Ziehau [Mon, 26 Jan 2009 06:21:00 +0000 (14:21 +0800)]
et(4): Don't sync coherent memory

15 years agoet(4): Utilize bus_dmamem_coherent_any()
Sepherosa Ziehau [Mon, 26 Jan 2009 05:26:12 +0000 (13:26 +0800)]
et(4): Utilize bus_dmamem_coherent_any()

15 years agobusdma(9): Add bus_dmamem_coherent_any()
Sepherosa Ziehau [Mon, 26 Jan 2009 05:24:48 +0000 (13:24 +0800)]
busdma(9): Add bus_dmamem_coherent_any()

This function is a simplified version of bus_dmamem_coherent(),
see the comment in sys/bus_dma.h for details.

15 years agoet(4): Utilize bus_dmamem_coherent()
Sepherosa Ziehau [Mon, 26 Jan 2009 04:29:38 +0000 (12:29 +0800)]
et(4): Utilize bus_dmamem_coherent()

15 years agoet(4): Correct parameters passed to busdma(9) functions
Sepherosa Ziehau [Mon, 26 Jan 2009 04:09:08 +0000 (12:09 +0800)]
et(4): Correct parameters passed to busdma(9) functions

15 years agomsk(4): Align TX buffer to 64bytes boundary instead of 8bytes boundary
Sepherosa Ziehau [Mon, 26 Jan 2009 03:05:06 +0000 (11:05 +0800)]
msk(4): Align TX buffer to 64bytes boundary instead of 8bytes boundary

The correct alignment boundary is found out by using busdma(9)'s
alignment constraint.  However, it seems that using in-place copy
results in better performance than let busdma(9) to bounce misaligned
TX buffer, especially with tiny packets; probably due to the "in-place"

15 years agomsk(4): Align TX buffer to 8bytes boundary to improve TX performance
Sepherosa Ziehau [Sun, 25 Jan 2009 07:39:40 +0000 (15:39 +0800)]
msk(4): Align TX buffer to 8bytes boundary to improve TX performance

The performance improvement is ~100Mbps (from 83xMbps to 93xMbps) for
bulk data.  This is accidentally found by forcing msk(4) to bounce TX
buffers to lower address during a busdma(4) test (bounce pages are
PAGE_SIZE aligned).

15 years agobusdma(9): Obey alignment constraint by default
Sepherosa Ziehau [Sun, 25 Jan 2009 03:38:56 +0000 (11:38 +0800)]
busdma(9): Obey alignment constraint by default

15 years agomsk(4): Avoid busdma map leakage on error handling path
Sepherosa Ziehau [Sun, 25 Jan 2009 03:17:47 +0000 (11:17 +0800)]
msk(4): Avoid busdma map leakage on error handling path

15 years agomsk(4): Adjust TX path
Sepherosa Ziehau [Sun, 25 Jan 2009 03:09:55 +0000 (11:09 +0800)]
msk(4): Adjust TX path

- Utilize bus_dmamap_load_mbuf_defrag().
- Fix the IFF_OACTIVE setting in msk_start().  This restores the
  fragmented UDP output performance.
- Sync TX buffer before setup TX desc.
- Remove unnecessary bus_dmamap_sync().

15 years agomsk(4): Utilize bus_dmamap_load_mbuf_segment()
Sepherosa Ziehau [Sun, 25 Jan 2009 02:26:31 +0000 (10:26 +0800)]
msk(4): Utilize bus_dmamap_load_mbuf_segment()

15 years agomsk(4): Utilize bus_dmamem_coherent() and don't sync coherent memory
Sepherosa Ziehau [Sun, 25 Jan 2009 02:06:01 +0000 (10:06 +0800)]
msk(4): Utilize bus_dmamem_coherent() and don't sync coherent memory

15 years agomsk(4): Correct parameters passed to busdma(9) functions
Sepherosa Ziehau [Sat, 24 Jan 2009 09:04:06 +0000 (17:04 +0800)]
msk(4): Correct parameters passed to busdma(9) functions

15 years agosk(4): Utilize bus_dmamap_load_mbuf_defrag()
Sepherosa Ziehau [Sat, 24 Jan 2009 06:59:14 +0000 (14:59 +0800)]
sk(4): Utilize bus_dmamap_load_mbuf_defrag()

15 years agosk(4): Adjust RX path a little bit
Sepherosa Ziehau [Sat, 24 Jan 2009 06:33:42 +0000 (14:33 +0800)]
sk(4): Adjust RX path a little bit

- Utilize bus_dmamap_load_mbuf_segment()
- Don't try m_devget(); it does not help much, if the NIC is quenched
  by the peer, e.g. by line rate fragmented UDP datagrams
- Move bus_dmamap_sync() from sk_rxeof() into sk_newbuf_std()

15 years agosk(4): Rework busdma(9) related bits
Sepherosa Ziehau [Sat, 24 Jan 2009 05:56:27 +0000 (13:56 +0800)]
sk(4): Rework busdma(9) related bits

- According to data sheet, sk(4) does support 64bits address space.
  However, the RX/TX descriptors' high 32bits must be same, i.e.
  descriptors' can't spread above and below 4Gbytes boundary.  Since
  sk(4)'s RX/TX descriptors are in contiguous memory, this means we
  only need to make sure that the contiguous memory does not cross
  4Gbytes boundary.
- RX/TX descriptors' is 8bytes aligned not 64bytes aligned.
- Split RX/TX descriptor rings.
- Use bus_dmamem_coherent() to allocate RX/TX descriptor rings.
- Don't sync coherent memory.

15 years agosk(4): Adjust TX path a little bit.
Sepherosa Ziehau [Fri, 23 Jan 2009 12:01:10 +0000 (20:01 +0800)]
sk(4): Adjust TX path a little bit.

15 years agorl(4): Don't use magic number
Sepherosa Ziehau [Fri, 23 Jan 2009 10:40:18 +0000 (18:40 +0800)]
rl(4): Don't use magic number

15 years agorl(4): Rework busdma(9) related bits
Sepherosa Ziehau [Fri, 23 Jan 2009 10:31:25 +0000 (18:31 +0800)]
rl(4): Rework busdma(9) related bits

- Correct parameters passed to busdma(9) functions.
- Split RX/TX busdma tag.
- Use bus_dmamem_coherent() to allocate RX buffers.
- Create TX buffer busdma map at attach time and destroy them only
  at detach time.
- Rework rl_encap().
- Don't sync RX buffers, which is coherent memory.

15 years agobge(4): Remove unnecessary bus_dmamap_sync()
Sepherosa Ziehau [Fri, 23 Jan 2009 07:45:54 +0000 (15:45 +0800)]
bge(4): Remove unnecessary bus_dmamap_sync()

15 years agobge(4): Utilize bus_dmamap_load_mbuf_{defrag,segment}()
Sepherosa Ziehau [Fri, 23 Jan 2009 07:43:36 +0000 (15:43 +0800)]
bge(4): Utilize bus_dmamap_load_mbuf_{defrag,segment}()

15 years agobge(4): Rework bge_newbuf_{std,jumbo}()
Sepherosa Ziehau [Fri, 23 Jan 2009 07:15:00 +0000 (15:15 +0800)]
bge(4): Rework bge_newbuf_{std,jumbo}()

- Always fill the std RX ring, instead of leaving it half full.
  On modern system, 1MBytes non-contiguous memory will not be
  the source of trouble.
- Record RX buffer's physical address along with the RX mbuf.
- Factor out bge_setup_rxdesc_{std,jumbo}(); call them if RX errors
  happen.
- Move RX std buffer busdma map sync/unload into bge_newbuf_std()
- Use temporary busdma map to load RX std buffer, so that the busdma
  map loading failure will not be fatal.

15 years agobge(4): Split RX/TX mbuf busdma tags
Sepherosa Ziehau [Fri, 23 Jan 2009 04:35:27 +0000 (12:35 +0800)]
bge(4): Split RX/TX mbuf busdma tags

15 years agobge(4): Don't sync coherent memory
Sepherosa Ziehau [Fri, 23 Jan 2009 04:05:35 +0000 (12:05 +0800)]
bge(4): Don't sync coherent memory

15 years agobge(4): Utilize bus_dmamem_coherent()
Sepherosa Ziehau [Fri, 23 Jan 2009 03:55:17 +0000 (11:55 +0800)]
bge(4): Utilize bus_dmamem_coherent()

15 years agobge(4): Correct busdma parameters
Sepherosa Ziehau [Fri, 23 Jan 2009 03:36:19 +0000 (11:36 +0800)]
bge(4): Correct busdma parameters

15 years agoif_bgereg.h: Remove extra white space
Sepherosa Ziehau [Fri, 23 Jan 2009 03:13:19 +0000 (11:13 +0800)]
if_bgereg.h: Remove extra white space

15 years agobusdma(9): Update FreeBSD RSCID.
Sepherosa Ziehau [Fri, 23 Jan 2009 02:47:55 +0000 (10:47 +0800)]
busdma(9): Update FreeBSD RSCID.

15 years agobusdma(9): Don't record/use boundary in bounce zone
Sepherosa Ziehau [Thu, 22 Jan 2009 13:08:48 +0000 (21:08 +0800)]
busdma(9): Don't record/use boundary in bounce zone

Bounce zone's boundary does not make any sense for PAGE_SIZE
contiguous allocation which also aligned on multiple or one
PAGE_SIZE.

15 years agobusdma(9): Use the passed in 'flags' instead of hard coding BUS_DMA_NOWAIT
Sepherosa Ziehau [Thu, 22 Jan 2009 12:45:01 +0000 (20:45 +0800)]
busdma(9): Use the passed in 'flags' instead of hard coding BUS_DMA_NOWAIT

15 years agojme(4): Don't sync coherent memory
Sepherosa Ziehau [Thu, 22 Jan 2009 12:30:57 +0000 (20:30 +0800)]
jme(4): Don't sync coherent memory

15 years agore(4): Don't sync coherent memory
Sepherosa Ziehau [Thu, 22 Jan 2009 12:13:07 +0000 (20:13 +0800)]
re(4): Don't sync coherent memory

15 years agonfe(4): Coherent memory does not need to be synced
Sepherosa Ziehau [Thu, 22 Jan 2009 12:12:51 +0000 (20:12 +0800)]
nfe(4): Coherent memory does not need to be synced

15 years agoxl(4): Coherent memory does not need to be synced
Sepherosa Ziehau [Thu, 22 Jan 2009 11:56:17 +0000 (19:56 +0800)]
xl(4): Coherent memory does not need to be synced

15 years agobfe(4): Coherent memory does not need to be synced
Sepherosa Ziehau [Thu, 22 Jan 2009 11:35:48 +0000 (19:35 +0800)]
bfe(4): Coherent memory does not need to be synced

15 years agojme(4): Move TX buffer syncing before setting up TX desc
Sepherosa Ziehau [Thu, 22 Jan 2009 11:03:17 +0000 (19:03 +0800)]
jme(4): Move TX buffer syncing before setting up TX desc

15 years agojme(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()
Sepherosa Ziehau [Thu, 22 Jan 2009 10:31:53 +0000 (18:31 +0800)]
jme(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()

15 years agojme(4): Depend on parent busdma tag to apply lowaddr constraint
Sepherosa Ziehau [Thu, 22 Jan 2009 09:54:23 +0000 (17:54 +0800)]
jme(4): Depend on parent busdma tag to apply lowaddr constraint

15 years agojme(4): jme_dma_free() is only called on detach path now
Sepherosa Ziehau [Wed, 21 Jan 2009 14:21:59 +0000 (22:21 +0800)]
jme(4): jme_dma_free() is only called on detach path now

15 years agojme(4): Utilize bus_dmamem_coherent()
Sepherosa Ziehau [Wed, 21 Jan 2009 14:18:10 +0000 (22:18 +0800)]
jme(4): Utilize bus_dmamem_coherent()

15 years agojme(4): Fix busdma(9) parameters
Sepherosa Ziehau [Wed, 21 Jan 2009 13:49:24 +0000 (21:49 +0800)]
jme(4): Fix busdma(9) parameters

15 years agojme(4): Rely on busdma(9) to do the boundary check
Sepherosa Ziehau [Wed, 21 Jan 2009 13:19:26 +0000 (21:19 +0800)]
jme(4): Rely on busdma(9) to do the boundary check

15 years agobusdma(9): Add sysctl node to show whether aligment constraint is obeyed or not
Sepherosa Ziehau [Wed, 21 Jan 2009 10:54:10 +0000 (18:54 +0800)]
busdma(9): Add sysctl node to show whether aligment constraint is obeyed or not

15 years agobusdma(9): Obey alignment constraint, disabled by default
Sepherosa Ziehau [Tue, 20 Jan 2009 15:11:59 +0000 (23:11 +0800)]
busdma(9): Obey alignment constraint, disabled by default

- Obey alignment constraint
  Obtained-from: FreeBSD
- Correct "cross page boundary" check in bus_dmamem_alloc()
- Make sure that after kmalloc() retry, memory will not cross page
  boundary and is properly aligned.  If not, print backtrace; should
  panic though.
- Factor out BUS_DMA_KMALLOC(), so we don't duplicate the conditions
  in bus_dmamem_alloc() and bus_dmamem_free()
- Assert the input memory is properly aligned, if caller told us so

15 years agobusdma(9): get rid of bounce_lowaddr, which serves no purpose
Sepherosa Ziehau [Tue, 20 Jan 2009 12:09:57 +0000 (20:09 +0800)]
busdma(9): get rid of bounce_lowaddr, which serves no purpose

15 years agoxl(4): Remove unused bus_dmamap_sync()
Sepherosa Ziehau [Tue, 20 Jan 2009 11:38:41 +0000 (19:38 +0800)]
xl(4): Remove unused bus_dmamap_sync()

15 years agoxl(4): Rework xl_encap()
Sepherosa Ziehau [Mon, 19 Jan 2009 13:53:08 +0000 (21:53 +0800)]
xl(4): Rework xl_encap()

15 years agoxl(4): Rework xl_newbuf()
Sepherosa Ziehau [Mon, 19 Jan 2009 11:52:48 +0000 (19:52 +0800)]
xl(4): Rework xl_newbuf()

- Utilize bus_dmamap_load_mbuf_segment()
- Move setting buffer address before clearing status
- Add init flag, so we could use M_WAIT during device initialization
- Move bus_dmamap_sync(POSTREAD) into xl_newbuf() and do busdma sync
  and unload iff we previously loaded a mbuf.

15 years agoxl(4): Split RX and TX mbuf busdma tag
Sepherosa Ziehau [Mon, 19 Jan 2009 11:24:09 +0000 (19:24 +0800)]
xl(4): Split RX and TX mbuf busdma tag

15 years agoxl(4): Utilize bus_dmamem_coherent()
Sepherosa Ziehau [Mon, 19 Jan 2009 11:01:32 +0000 (19:01 +0800)]
xl(4): Utilize bus_dmamem_coherent()

15 years agoxl(4): Allocate parent busdma tag, which is used to constraint lowaddr
Sepherosa Ziehau [Mon, 19 Jan 2009 10:46:37 +0000 (18:46 +0800)]
xl(4): Allocate parent busdma tag, which is used to constraint lowaddr

15 years agonfe(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()
Sepherosa Ziehau [Sun, 18 Jan 2009 11:33:31 +0000 (19:33 +0800)]
nfe(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()

15 years agore(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()
Sepherosa Ziehau [Sun, 18 Jan 2009 08:36:03 +0000 (16:36 +0800)]
re(4): Utilize bus_dmamap_load_mbuf_{segment,defrag}()

15 years agobusdma(9): Add BUS_DMA_ALIGNED hint flag
Sepherosa Ziehau [Sun, 18 Jan 2009 05:55:18 +0000 (13:55 +0800)]
busdma(9): Add BUS_DMA_ALIGNED hint flag

This flag is used to give hint to busdma(9) that all to-be-loaded
memory is proper aligned, thus no bounce pages should be allocated.
This will be used when busdma obeys alignment requirement.

It could save us some bounce page memory under following situation:
Some NICs require RX buffer to be 4 or 8 bytes aligned while our mbuf
cluster allocation always promises 2048 bytes alignment.

Rename BUS_DMA_ONEPAGE to BUS_DMA_ONEBPAGE, should have done that
in the first place though ...

15 years agobfe(4): Utilize bus_dmamap_load_mbuf_defrag()
Sepherosa Ziehau [Sun, 18 Jan 2009 03:58:03 +0000 (11:58 +0800)]
bfe(4): Utilize bus_dmamap_load_mbuf_defrag()

15 years agobusdma(9): Add bus_dmamap_load_mbuf_defrag()
Sepherosa Ziehau [Sun, 18 Jan 2009 03:56:03 +0000 (11:56 +0800)]
busdma(9): Add bus_dmamap_load_mbuf_defrag()

This function is mainly used to avoid code duplication in various
(should be many) NIC driver code.

15 years agobfe(4): Utilize bus_dmamap_load_mbuf_segment()
Sepherosa Ziehau [Sun, 18 Jan 2009 03:18:18 +0000 (11:18 +0800)]
bfe(4): Utilize bus_dmamap_load_mbuf_segment()

15 years agobusdma(9): Add bus_dmamap_load_mbuf_segment()
Sepherosa Ziehau [Sun, 18 Jan 2009 03:14:38 +0000 (11:14 +0800)]
busdma(9): Add bus_dmamap_load_mbuf_segment()

See the comment in sys/bus_dma.h for detailed information
about this function.

Let bus_dmamap_load_mbuf() call this function with busdma tag's
segments and nsegments.

Inspired-by: FreeBSD's bus_dmamap_load_mbuf_sg()
15 years agonfe(4): busdma(9) fixes
Sepherosa Ziehau [Sat, 17 Jan 2009 13:02:16 +0000 (21:02 +0800)]
nfe(4): busdma(9) fixes

On RX path:
- Unload busdma map iff the map has already been loaded
- Add missing bus_dmamap_sync()

On TX path:
- Reduce log verbosity
- Move buffer content's bus_dmamap_sync() to the proper place

Misc:
- Nuke unnecessary bus_dmamap_sync()

15 years agobusdma(9): More bounce page bug fixing
Sepherosa Ziehau [Sat, 17 Jan 2009 12:59:58 +0000 (20:59 +0800)]
busdma(9): More bounce page bug fixing

Turn on BUS_DMA_MIN_ALLOC_COMP, iff we do allocate bounce pages for
the busdma tag.

15 years agobusdma(9): Add tunable and read-only sysctl node for max # of bounce
Sepherosa Ziehau [Sat, 17 Jan 2009 11:24:28 +0000 (19:24 +0800)]
busdma(9): Add tunable and read-only sysctl node for max # of bounce
pages per bounce zone.

15 years agonfe(4): Always set high part of the address if the NIC supports
Sepherosa Ziehau [Sat, 17 Jan 2009 11:22:57 +0000 (19:22 +0800)]
nfe(4): Always set high part of the address if the NIC supports
40bits address space accessing.

15 years agonfe(4): busdma(9) correction
Sepherosa Ziehau [Sat, 17 Jan 2009 10:59:57 +0000 (18:59 +0800)]
nfe(4): busdma(9) correction

- Use bus_dmamem_coherent()
- Fix busdma(9) parameters

15 years agore(4): add missing BUS_DMA_WAITOK
Sepherosa Ziehau [Sat, 17 Jan 2009 10:34:50 +0000 (18:34 +0800)]
re(4): add missing BUS_DMA_WAITOK

15 years agobfe(4): Add missing BUS_DMA_WAITOK
Sepherosa Ziehau [Sat, 17 Jan 2009 10:35:38 +0000 (18:35 +0800)]
bfe(4): Add missing BUS_DMA_WAITOK