diff options
author | harti <harti@FreeBSD.org> | 2003-10-29 15:15:19 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-10-29 15:15:19 +0000 |
commit | 5dd57a3567c7d0579b6f15c074cadeb424e388b2 (patch) | |
tree | 619900b61f8cefd389072e2293a6e8773e8fe2ef /sys/dev/hatm/if_hatm_tx.c | |
parent | 7ff4941bd61c3c7e962615c4c28c6745b387e23c (diff) | |
download | FreeBSD-src-5dd57a3567c7d0579b6f15c074cadeb424e388b2.zip FreeBSD-src-5dd57a3567c7d0579b6f15c074cadeb424e388b2.tar.gz |
Allow sending of more than one raw cell from a single mbuf. Only the
very first cell in the mbuf should have a cell header word (of which
everything except the payload type and the CLP bit is ignored). All
other cells should be 48 byte and get the same header as the first cell.
This fixes a problem with sending more than 120000 raw cells/sec through
an HE155. The card seems to need 2 cell times to DMA the transmit buffer
ready queue entry and the transmit buffer descriptor so at 1/3 the
link rate the transmit buffer ready queue starts to fill up. Even with this
patch it's obviously impossible to send raw cells at link rate.
Diffstat (limited to 'sys/dev/hatm/if_hatm_tx.c')
-rw-r--r-- | sys/dev/hatm/if_hatm_tx.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c index c868951..dbb2d01 100644 --- a/sys/dev/hatm/if_hatm_tx.c +++ b/sys/dev/hatm/if_hatm_tx.c @@ -321,8 +321,6 @@ hatm_load_txbuf(void *uarg, bus_dma_segment_t *segs, int nseg, /* * Start output on the interface - * - * For raw aal we process only the first cell in the mbuf chain! XXX */ void hatm_start(struct ifnet *ifp) @@ -381,21 +379,26 @@ hatm_start(struct ifnet *ifp) arg.pti = 0; if (arg.vcc->param.aal == ATMIO_AAL_RAW) { if (len < 52) { + /* too short */ m_freem(m); continue; } - if (len > 52) { - m_adj(m, -((int)(len - 52))); - len = 52; - } + + /* + * Get the header and ignore except + * payload type and CLP. + */ if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) continue; - - /* ignore header except payload type and CLP */ arg.pti = mtod(m, u_char *)[3] & 0xf; arg.pti = ((arg.pti & 0xe) << 2) | ((arg.pti & 1) << 1); m_adj(m, 4); len -= 4; + + if (len % 48 != 0) { + m_adj(m, -((int)(len % 48))); + len -= len % 48; + } } #ifdef ENABLE_BPF |