cxgb_sge.c (8adc65addaf28b4304b4539e717c19e62ffd940e) cxgb_sge.c (3e96c7e790c3d5388385ced9c80192fb6f08ecfc)
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

--- 28 unchanged lines hidden (view full) ---

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>
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

--- 28 unchanged lines hidden (view full) ---

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 ---