cxgb_sge.c (172101) | cxgb_sge.c (174626) |
---|---|
1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> | 1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_sge.c 172101 2007-09-09 04:34:03Z kmacy $"); | 31__FBSDID("$FreeBSD: head/sys/dev/cxgb/cxgb_sge.c 174626 2007-12-15 21:54:59Z kmacy $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/bus.h> 38#include <sys/conf.h> 39#include <machine/bus.h> 40#include <machine/resource.h> 41#include <sys/bus_dma.h> 42#include <sys/rman.h> 43#include <sys/queue.h> 44#include <sys/sysctl.h> | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/bus.h> 38#include <sys/conf.h> 39#include <machine/bus.h> 40#include <machine/resource.h> 41#include <sys/bus_dma.h> 42#include <sys/rman.h> 43#include <sys/queue.h> 44#include <sys/sysctl.h> |
45#include <sys/syslog.h> |
|
45#include <sys/taskqueue.h> 46 47#include <sys/proc.h> 48#include <sys/sched.h> 49#include <sys/smp.h> 50#include <sys/systm.h> 51 52#include <netinet/in_systm.h> --- 1930 unchanged lines hidden (view full) --- 1983 * @tdev: the offload device to send to 1984 * @m: the packet 1985 * 1986 * Sends an offload packet. We use the packet priority to select the 1987 * appropriate Tx queue as follows: bit 0 indicates whether the packet 1988 * should be sent as regular or control, bits 1-3 select the queue set. 1989 */ 1990int | 46#include <sys/taskqueue.h> 47 48#include <sys/proc.h> 49#include <sys/sched.h> 50#include <sys/smp.h> 51#include <sys/systm.h> 52 53#include <netinet/in_systm.h> --- 1930 unchanged lines hidden (view full) --- 1984 * @tdev: the offload device to send to 1985 * @m: the packet 1986 * 1987 * Sends an offload packet. We use the packet priority to select the 1988 * appropriate Tx queue as follows: bit 0 indicates whether the packet 1989 * should be sent as regular or control, bits 1-3 select the queue set. 1990 */ 1991int |
1991t3_offload_tx(struct toedev *tdev, struct mbuf *m) | 1992t3_offload_tx(struct t3cdev *tdev, struct mbuf *m) |
1992{ 1993 adapter_t *adap = tdev2adap(tdev); 1994 struct sge_qset *qs = &adap->sge.qs[queue_set(m)]; 1995 1996 if (__predict_false(is_ctrl_pkt(m))) 1997 return ctrl_xmit(adap, &qs->txq[TXQ_CTRL], m); 1998 1999 return ofld_xmit(adap, &qs->txq[TXQ_OFLD], m); --- 4 unchanged lines hidden (view full) --- 2004 * @tdev: the offload device that will be receiving the packets 2005 * @q: the SGE response queue that assembled the bundle 2006 * @m: the partial bundle 2007 * @n: the number of packets in the bundle 2008 * 2009 * Delivers a (partial) bundle of Rx offload packets to an offload device. 2010 */ 2011static __inline void | 1993{ 1994 adapter_t *adap = tdev2adap(tdev); 1995 struct sge_qset *qs = &adap->sge.qs[queue_set(m)]; 1996 1997 if (__predict_false(is_ctrl_pkt(m))) 1998 return ctrl_xmit(adap, &qs->txq[TXQ_CTRL], m); 1999 2000 return ofld_xmit(adap, &qs->txq[TXQ_OFLD], m); --- 4 unchanged lines hidden (view full) --- 2005 * @tdev: the offload device that will be receiving the packets 2006 * @q: the SGE response queue that assembled the bundle 2007 * @m: the partial bundle 2008 * @n: the number of packets in the bundle 2009 * 2010 * Delivers a (partial) bundle of Rx offload packets to an offload device. 2011 */ 2012static __inline void |
2012deliver_partial_bundle(struct toedev *tdev, | 2013deliver_partial_bundle(struct t3cdev *tdev, |
2013 struct sge_rspq *q, 2014 struct mbuf *mbufs[], int n) 2015{ 2016 if (n) { 2017 q->offload_bundles++; 2018 cxgb_ofld_recv(tdev, mbufs, n); 2019 } 2020} 2021 2022static __inline int | 2014 struct sge_rspq *q, 2015 struct mbuf *mbufs[], int n) 2016{ 2017 if (n) { 2018 q->offload_bundles++; 2019 cxgb_ofld_recv(tdev, mbufs, n); 2020 } 2021} 2022 2023static __inline int |
2023rx_offload(struct toedev *tdev, struct sge_rspq *rq, | 2024rx_offload(struct t3cdev *tdev, struct sge_rspq *rq, |
2024 struct mbuf *m, struct mbuf *rx_gather[], 2025 unsigned int gather_idx) 2026{ 2027 rq->offload_pkts++; 2028 m->m_pkthdr.header = mtod(m, void *); 2029 2030 rx_gather[gather_idx++] = m; 2031 if (gather_idx == RX_BUNDLE_SIZE) { --- 854 unchanged lines hidden --- | 2025 struct mbuf *m, struct mbuf *rx_gather[], 2026 unsigned int gather_idx) 2027{ 2028 rq->offload_pkts++; 2029 m->m_pkthdr.header = mtod(m, void *); 2030 2031 rx_gather[gather_idx++] = m; 2032 if (gather_idx == RX_BUNDLE_SIZE) { --- 854 unchanged lines hidden --- |