diff options
author | David Edmondson <dme@sun.com> | 2009-02-11 12:58:52 +0100 |
---|---|---|
committer | David Edmondson <dme@sun.com> | 2009-02-11 12:58:52 +0100 |
commit | 6ac4daad36c316964b0677a7acf258e81b39b981 (patch) | |
tree | 804db866fe1fa16461c587acac9eb06c6821f5df /usr/src | |
parent | 07fa36358f9a5e7ee888a363f7546db5748591f3 (diff) | |
download | illumos-gate-6ac4daad36c316964b0677a7acf258e81b39b981.tar.gz |
6796376 RX_BUFFER_HEADROOM should go
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/xen/io/xnb.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/usr/src/uts/common/xen/io/xnb.c b/usr/src/uts/common/xen/io/xnb.c index 308f3c60ff..957c6247ff 100644 --- a/usr/src/uts/common/xen/io/xnb.c +++ b/usr/src/uts/common/xen/io/xnb.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -71,15 +71,6 @@ */ /* - * Linux expects to have some headroom in received buffers. The Linux - * frontend driver (netfront) checks to see if the headroom is - * available and will re-allocate the buffer to make room if - * necessary. To avoid this we add RX_BUFFER_HEADROOM bytes of - * headroom to each packet we pass to the peer. - */ -#define RX_BUFFER_HEADROOM 16 - -/* * Should we attempt to defer checksum calculation? */ static boolean_t xnb_cksum_offload = B_TRUE; @@ -683,7 +674,6 @@ xnb_to_peer(xnb_t *xnbp, mblk_t *mp) netif_rx_request_t *rxreq; netif_rx_response_t *rxresp; char *valoop; - size_t offset; mblk_t *ml; uint16_t cksum_flags; @@ -708,11 +698,9 @@ xnb_to_peer(xnb_t *xnbp, mblk_t *mp) hat_devload(kas.a_hat, xnbp->xnb_rx_va, PAGESIZE, pfn, PROT_READ | PROT_WRITE, HAT_LOAD); - offset = RX_BUFFER_HEADROOM; - /* 3 */ len = 0; - valoop = xnbp->xnb_rx_va + offset; + valoop = xnbp->xnb_rx_va; for (ml = mp; ml != NULL; ml = ml->b_cont) { size_t chunk = ml->b_wptr - ml->b_rptr; @@ -721,7 +709,7 @@ xnb_to_peer(xnb_t *xnbp, mblk_t *mp) len += chunk; } - ASSERT(len + offset < PAGESIZE); + ASSERT(len < PAGESIZE); /* Release the pfn. */ hat_unload(kas.a_hat, xnbp->xnb_rx_va, PAGESIZE, @@ -735,7 +723,7 @@ xnb_to_peer(xnb_t *xnbp, mblk_t *mp) /* 5.1 */ rxresp = RING_GET_RESPONSE(&xnbp->xnb_rx_ring, prod); - rxresp->offset = offset; + rxresp->offset = 0; rxresp->flags = 0; cksum_flags = xnbp->xnb_flavour->xf_cksum_to_peer(xnbp, mp); @@ -1026,7 +1014,7 @@ xnb_copy_to_peer(xnb_t *xnbp, mblk_t *mp) XNB_RING_HAS_UNCONSUMED_REQUESTS(&xnbp->xnb_rx_ring)) { netif_rx_request_t *rxreq; netif_rx_response_t *rxresp; - size_t offset, d_offset; + size_t d_offset; size_t len; uint16_t cksum_flags; int16_t status = NETIF_RSP_OKAY; @@ -1043,7 +1031,7 @@ xnb_copy_to_peer(xnb_t *xnbp, mblk_t *mp) #endif /* XNB_DEBUG */ /* 2 */ - d_offset = offset = RX_BUFFER_HEADROOM; + d_offset = 0; len = 0; item_count = 0; @@ -1142,7 +1130,7 @@ xnb_copy_to_peer(xnb_t *xnbp, mblk_t *mp) /* 4 */ rxresp = RING_GET_RESPONSE(&xnbp->xnb_rx_ring, prod); - rxresp->offset = offset; + rxresp->offset = 0; rxresp->flags = 0; |