There is no need to test __FreeBSD_version for features that have

been around for a long time now (7.1-ish or even earlier); assume
they are present.  These includes MSI, TSO, LRO, VLAN, INTR_FILTERS,
FIRMWARE, etc.

Also, eliminate some dead code and clean up in other places as part
of this quick once-over.

MFC after:	1 week
This commit is contained in:
Navdeep Parhar 2010-02-24 10:16:18 +00:00
parent be688bde90
commit e83ec3e5c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=204274
12 changed files with 29 additions and 256 deletions

View file

@ -392,11 +392,9 @@ struct adapter_params {
const struct adapter_info *info;
#ifdef CONFIG_CHELSIO_T3_CORE
unsigned short mtus[NMTUS];
unsigned short a_wnd[NCCTRL_WIN];
unsigned short b_wnd[NCCTRL_WIN];
#endif
unsigned int nports; /* # of ethernet ports */
unsigned int chan_map; /* bitmap of in-use Tx channels */
unsigned int stats_update_period; /* MAC stats accumulation period */
@ -650,11 +648,7 @@ static inline int is_10G(const adapter_t *adap)
static inline int is_offload(const adapter_t *adap)
{
#if defined(CONFIG_CHELSIO_T3_CORE)
return adap->params.offload;
#else
return 0;
#endif
}
static inline unsigned int core_ticks_per_usec(const adapter_t *adap)
@ -772,7 +766,6 @@ void t3_mc5_intr_handler(struct mc5 *mc5);
int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n,
u32 *buf);
#ifdef CONFIG_CHELSIO_T3_CORE
int t3_tp_set_coalescing_size(adapter_t *adap, unsigned int size, int psh);
void t3_tp_set_max_rxsize(adapter_t *adap, unsigned int size);
void t3_tp_get_mib_stats(adapter_t *adap, struct tp_mib_stats *tps);
@ -793,7 +786,6 @@ void t3_get_tx_sched(adapter_t *adap, unsigned int sched, unsigned int *kbps,
void t3_read_pace_tbl(adapter_t *adap, unsigned int pace_vals[NTX_SCHED]);
void t3_set_pace_tbl(adapter_t *adap, unsigned int *pace_vals,
unsigned int start, unsigned int n);
#endif
int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index,
u32 *size, void *data);

View file

@ -3263,7 +3263,6 @@ static void tp_set_timers(adapter_t *adap, unsigned int core_clk)
#undef SECONDS
}
#ifdef CONFIG_CHELSIO_T3_CORE
/**
* t3_tp_set_coalescing_size - set receive coalescing size
* @adap: the adapter
@ -3566,7 +3565,6 @@ int t3_set_proto_sram(adapter_t *adap, const u8 *data)
}
return 0;
}
#endif
/**
* t3_config_trace_filter - configure one of the tracing filters
@ -4150,14 +4148,12 @@ int t3_init_hw(adapter_t *adapter, u32 fw_params)
if (tp_init(adapter, &adapter->params.tp))
goto out_err;
#ifdef CONFIG_CHELSIO_T3_CORE
t3_tp_set_coalescing_size(adapter,
min(adapter->params.sge.max_pkt_size,
MAX_RX_COALESCING_LEN), 1);
t3_tp_set_max_rxsize(adapter,
min(adapter->params.sge.max_pkt_size, 16384U));
ulp_config(adapter, &adapter->params.tp);
#endif
if (is_pcie(adapter))
config_pcie(adapter);
else
@ -4508,10 +4504,8 @@ int __devinit t3_prep_adapter(adapter_t *adapter,
adapter->params.mc5.nroutes = 0;
t3_mc5_prep(adapter, &adapter->mc5, MC5_MODE_144_BIT);
#ifdef CONFIG_CHELSIO_T3_CORE
init_mtus(adapter->params.mtus);
init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd);
#endif
}
early_hw_init(adapter, ai);

View file

@ -1,41 +0,0 @@
/**************************************************************************
Copyright (c) 2007-2008, Chelsio Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Neither the name of the Chelsio Corporation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
$FreeBSD$
***************************************************************************/
/*
* Note that although this driver doesn't contain all of the functionality of the Linux driver
* the common code is 99% the same. Hence we keep the same version number to indicate what linux
* driver the common code corresponds to.
*/
#ifndef __CHELSIO_VERSION_H
#define __CHELSIO_VERSION_H
#define DRV_DESC "Chelsio T3 Network Driver"
#define DRV_NAME "cxgb"
#define DRV_VERSION "1.0.133"
#endif

View file

@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <net/if.h>
#include <net/if_media.h>
#include <net/if_dl.h>
#include <netinet/tcp_lro.h>
#include <machine/bus.h>
#include <machine/resource.h>
@ -58,10 +59,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <t3cdev.h>
#include <sys/mbufq.h>
#ifdef LRO_SUPPORTED
#include <netinet/tcp_lro.h>
#endif
struct adapter;
struct sge_qset;
extern int cxgb_debug;
@ -156,12 +153,10 @@ enum { TXQ_ETH = 0,
#define WR_LEN (WR_FLITS * 8)
#define PIO_LEN (WR_LEN - sizeof(struct cpl_tx_pkt_lso))
#ifdef LRO_SUPPORTED
struct lro_state {
unsigned short enabled;
struct lro_ctrl ctrl;
};
#endif
#define RX_BUNDLE_SIZE 8
@ -284,9 +279,7 @@ enum {
struct sge_qset {
struct sge_rspq rspq;
struct sge_fl fl[SGE_RXQ_PER_SET];
#ifdef LRO_SUPPORTED
struct lro_state lro;
#endif
struct sge_txq txq[SGE_TXQ_PER_SET];
uint32_t txq_stopped; /* which Tx queues are stopped */
uint64_t port_stats[SGE_PSTAT_MAX];

View file

@ -1,40 +0,0 @@
/**************************************************************************
Copyright (c) 2007-2008, Chelsio Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Neither the name of the Chelsio Corporation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
$FreeBSD$
***************************************************************************/
#ifndef _CXGB_CONFIG_H_
#define _CXGB_CONFIG_H_
#define CONFIG_CHELSIO_T3_CORE
#if __FreeBSD_version > 800053
#define IFNET_MULTIQUEUE
#endif
#endif

View file

@ -376,11 +376,7 @@ cxgb_controller_probe(device_t dev)
static int
upgrade_fw(adapter_t *sc)
{
#ifdef FIRMWARE_LATEST
const struct firmware *fw;
#else
struct firmware *fw;
#endif
int status;
if ((fw = firmware_get(FW_FNAME)) == NULL) {
@ -390,7 +386,8 @@ upgrade_fw(adapter_t *sc)
device_printf(sc->dev, "updating firmware on card\n");
status = t3_load_fw(sc, (const uint8_t *)fw->data, fw->datasize);
device_printf(sc->dev, "firmware update returned %s %d\n", (status == 0) ? "success" : "fail", status);
device_printf(sc->dev, "firmware update returned %s %d\n",
status == 0 ? "success" : "fail", status);
firmware_put(fw, FIRMWARE_UNLOAD);
@ -432,9 +429,7 @@ cxgb_controller_attach(device_t dev)
int i, error = 0;
uint32_t vers;
int port_qsets = 1;
#ifdef MSI_SUPPORTED
int msi_needed, reg;
#endif
char buf[80];
sc = device_get_softc(dev);
@ -442,10 +437,6 @@ cxgb_controller_attach(device_t dev)
sc->msi_count = 0;
ai = cxgb_get_adapter_info(dev);
/*
* XXX not really related but a recent addition
*/
#ifdef MSI_SUPPORTED
/* find the PCIe link width and set max read request to 4KB*/
if (pci_find_extcap(dev, PCIY_EXPRESS, &reg) == 0) {
uint16_t lnk, pectl;
@ -463,7 +454,7 @@ cxgb_controller_attach(device_t dev)
"PCIe x%d Link, expect reduced performance\n",
sc->link_width);
}
#endif
touch_bars(dev);
pci_enable_busmaster(dev);
/*
@ -518,8 +509,6 @@ cxgb_controller_attach(device_t dev)
* back to MSI. If that fails, then try falling back to the legacy
* interrupt pin model.
*/
#ifdef MSI_SUPPORTED
sc->msix_regs_rid = 0x20;
if ((msi_allowed >= 2) &&
(sc->msix_regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@ -565,20 +554,14 @@ cxgb_controller_attach(device_t dev)
device_printf(dev, "using MSI interrupts\n");
}
}
#endif
if (sc->msi_count == 0) {
device_printf(dev, "using line interrupts\n");
sc->cxgb_intr = t3b_intr;
}
/* Create a private taskqueue thread for handling driver events */
#ifdef TASKQUEUE_CURRENT
sc->tq = taskqueue_create("cxgb_taskq", M_NOWAIT,
taskqueue_thread_enqueue, &sc->tq);
#else
sc->tq = taskqueue_create_fast("cxgb_taskq", M_NOWAIT,
taskqueue_thread_enqueue, &sc->tq);
#endif
if (sc->tq == NULL) {
device_printf(dev, "failed to allocate controller task queue\n");
goto out;
@ -764,7 +747,6 @@ cxgb_free(struct adapter *sc)
* Release all interrupt resources.
*/
cxgb_teardown_interrupts(sc);
#ifdef MSI_SUPPORTED
if (sc->flags & (USING_MSI | USING_MSIX)) {
device_printf(sc->dev, "releasing msi message(s)\n");
pci_release_msi(sc->dev);
@ -776,7 +758,6 @@ cxgb_free(struct adapter *sc)
bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->msix_regs_rid,
sc->msix_regs_res);
}
#endif
/*
* Free the adapter's taskqueue.
@ -910,11 +891,8 @@ cxgb_setup_interrupts(adapter_t *sc)
sc->irq_rid = 0;
} else {
err = bus_setup_intr(sc->dev, sc->irq_res,
INTR_MPSAFE | INTR_TYPE_NET,
#ifdef INTR_FILTERS
NULL,
#endif
sc->cxgb_intr, sc, &sc->intr_tag);
INTR_MPSAFE | INTR_TYPE_NET, NULL,
sc->cxgb_intr, sc, &sc->intr_tag);
if (err) {
device_printf(sc->dev,
@ -943,10 +921,7 @@ cxgb_setup_interrupts(adapter_t *sc)
}
err = bus_setup_intr(sc->dev, res, INTR_MPSAFE | INTR_TYPE_NET,
#ifdef INTR_FILTERS
NULL,
#endif
t3_intr_msix, &sc->sge.qs[i], &tag);
NULL, t3_intr_msix, &sc->sge.qs[i], &tag);
if (err) {
device_printf(sc->dev, "Cannot set up interrupt "
"for message %d (%d)\n", rid, err);
@ -996,26 +971,9 @@ cxgb_makedev(struct port_info *pi)
return (0);
}
#ifndef LRO_SUPPORTED
#ifdef IFCAP_LRO
#undef IFCAP_LRO
#endif
#define IFCAP_LRO 0x0
#endif
#ifdef TSO_SUPPORTED
#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO)
/* Don't enable TSO6 yet */
#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO4 | IFCAP_JUMBO_MTU | IFCAP_LRO)
#else
#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU)
/* Don't enable TSO6 yet */
#define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU)
#define IFCAP_TSO4 0x0
#define IFCAP_TSO6 0x0
#define CSUM_TSO 0x0
#endif
#define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO)
#define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6)
static int
cxgb_port_attach(device_t dev)
@ -1024,8 +982,7 @@ cxgb_port_attach(device_t dev)
struct ifnet *ifp;
int err;
struct adapter *sc;
p = device_get_softc(dev);
sc = p->adapter;
snprintf(p->lockbuf, PORT_NAME_LEN, "cxgb port lock %d:%d",
@ -1039,9 +996,6 @@ cxgb_port_attach(device_t dev)
return (ENOMEM);
}
/*
* Note that there is currently no watchdog timer.
*/
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_init = cxgb_init;
ifp->if_softc = p;
@ -1053,16 +1007,16 @@ cxgb_port_attach(device_t dev)
IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
IFQ_SET_READY(&ifp->if_snd);
ifp->if_hwassist = ifp->if_capabilities = ifp->if_capenable = 0;
ifp->if_capabilities |= CXGB_CAP;
ifp->if_capenable |= CXGB_CAP_ENABLE;
ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO);
ifp->if_capabilities = CXGB_CAP;
ifp->if_capenable = CXGB_CAP_ENABLE;
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO;
/*
* disable TSO on 4-port - it isn't supported by the firmware yet
* Disable TSO on 4-port - it isn't supported by the firmware.
*/
if (p->adapter->params.nports > 2) {
ifp->if_capabilities &= ~(IFCAP_TSO4 | IFCAP_TSO6);
ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TSO6);
if (sc->params.nports > 2) {
ifp->if_capabilities &= ~IFCAP_TSO;
ifp->if_capenable &= ~IFCAP_TSO;
ifp->if_hwassist &= ~CSUM_TSO;
}
@ -1070,11 +1024,10 @@ cxgb_port_attach(device_t dev)
ifp->if_transmit = cxgb_transmit;
ifp->if_qflush = cxgb_qflush;
/*
* Only default to jumbo frames on 10GigE
*/
if (p->adapter->params.nports <= 2)
#ifdef DEFAULT_JUMBO
if (sc->params.nports <= 2)
ifp->if_mtu = ETHERMTU_JUMBO;
#endif
if ((err = cxgb_makedev(p)) != 0) {
printf("makedev failed %d\n", err);
return (err);
@ -1583,11 +1536,7 @@ bind_qsets(adapter_t *sc)
static void
update_tpeeprom(struct adapter *adap)
{
#ifdef FIRMWARE_LATEST
const struct firmware *tpeeprom;
#else
struct firmware *tpeeprom;
#endif
uint32_t version;
unsigned int major, minor;
@ -1645,11 +1594,7 @@ update_tpeeprom(struct adapter *adap)
static int
update_tpsram(struct adapter *adap)
{
#ifdef FIRMWARE_LATEST
const struct firmware *tpsram;
#else
struct firmware *tpsram;
#endif
int ret;
char rev, name[32];
@ -1999,7 +1944,6 @@ cxgb_uninit_synchronized(struct port_info *pi)
return (0);
}
#ifdef LRO_SUPPORTED
/*
* Mark lro enabled or disabled in all qsets for this port
*/
@ -2017,7 +1961,6 @@ cxgb_set_lro(struct port_info *p, int enabled)
}
return (0);
}
#endif
static int
cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
@ -2125,14 +2068,12 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
} else
error = EINVAL;
}
#ifdef LRO_SUPPORTED
if (mask & IFCAP_LRO) {
ifp->if_capenable ^= IFCAP_LRO;
/* Safe to do this even if cxgb_up not called yet */
cxgb_set_lro(p, ifp->if_capenable & IFCAP_LRO);
}
#endif
if (mask & IFCAP_VLAN_HWTAGGING) {
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {

View file

@ -33,8 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef _CXGB_OFFLOAD_H
#define _CXGB_OFFLOAD_H
#include <common/cxgb_version.h>
#include <cxgb_config.h>
#include <common/cxgb_tcb.h>
#include <t3cdev.h>

View file

@ -41,9 +41,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <dev/mii/mii.h>
#define CONFIG_CHELSIO_T3_CORE
#include <common/cxgb_version.h>
#ifndef _CXGB_OSDEP_H_
#define _CXGB_OSDEP_H_
@ -91,33 +88,6 @@ struct t3_mbuf_hdr {
#define MT_DONTFREE 128
#if __FreeBSD_version > 700030
#define INTR_FILTERS
#define FIRMWARE_LATEST
#endif
#if ((__FreeBSD_version > 602103) && (__FreeBSD_version < 700000))
#define FIRMWARE_LATEST
#endif
#if __FreeBSD_version > 700000
#define MSI_SUPPORTED
#define TSO_SUPPORTED
#define VLAN_SUPPORTED
#define TASKQUEUE_CURRENT
#else
#define if_name(ifp) (ifp)->if_xname
#define M_SANITY(m, n)
#endif
#if __FreeBSD_version >= 701000
#include "opt_inet.h"
#ifdef INET
#define LRO_SUPPORTED
#define TOE_SUPPORTED
#endif
#endif
#if __FreeBSD_version < 800054
#if defined (__GNUC__)
#if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__

View file

@ -1145,10 +1145,9 @@ calc_tx_descs(const struct mbuf *m, int nsegs)
return 1;
flits = sgl_len(nsegs) + 2;
#ifdef TSO_SUPPORTED
if (m->m_pkthdr.csum_flags & CSUM_TSO)
flits++;
#endif
return flits_to_desc(flits);
}
@ -1366,17 +1365,12 @@ write_wr_hdr_sgl(unsigned int ndesc, struct tx_desc *txd, struct txq_state *txqs
/* sizeof(*eh) + sizeof(*vhdr) + sizeof(*ip) + sizeof(*tcp) */
#define TCPPKTHDRSIZE (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + 20 + 20)
#ifdef VLAN_SUPPORTED
#define GET_VTAG(cntrl, m) \
do { \
if ((m)->m_flags & M_VLANTAG) \
cntrl |= F_TXPKT_VLAN_VLD | V_TXPKT_VLAN((m)->m_pkthdr.ether_vtag); \
} while (0)
#else
#define GET_VTAG(cntrl, m)
#endif
static int
t3_encap(struct sge_qset *qs, struct mbuf **m)
{
@ -1413,11 +1407,10 @@ t3_encap(struct sge_qset *qs, struct mbuf **m)
cntrl = V_TXPKT_INTF(pi->txpkt_intf);
KASSERT(m0->m_flags & M_PKTHDR, ("not packet header\n"));
#ifdef VLAN_SUPPORTED
if (m0->m_nextpkt == NULL && m0->m_next != NULL &&
m0->m_pkthdr.csum_flags & (CSUM_TSO))
tso_info = V_LSO_MSS(m0->m_pkthdr.tso_segsz);
#endif
if (m0->m_nextpkt != NULL) {
busdma_map_sg_vec(txq->entry_tag, txsd->map, m0, segs, &nsegs);
ndesc = 1;
@ -2076,9 +2069,7 @@ t3_free_qset(adapter_t *sc, struct sge_qset *q)
MTX_DESTROY(&q->rspq.lock);
}
#ifdef LRO_SUPPORTED
tcp_lro_free(&q->lro.ctrl);
#endif
bzero(q, sizeof(*q));
}
@ -2663,7 +2654,6 @@ t3_sge_alloc_qset(adapter_t *sc, u_int id, int nports, int irq_vec_idx,
q->fl[1].type = EXT_JUMBOP;
#endif
#ifdef LRO_SUPPORTED
/* Allocate and setup the lro_ctrl structure */
q->lro.enabled = !!(pi->ifp->if_capenable & IFCAP_LRO);
ret = tcp_lro_init(&q->lro.ctrl);
@ -2672,7 +2662,6 @@ t3_sge_alloc_qset(adapter_t *sc, u_int id, int nports, int irq_vec_idx,
goto err;
}
q->lro.ctrl.ifp = pi->ifp;
#endif
mtx_lock_spin(&sc->sge.reg_lock);
ret = -t3_sge_init_rspcntxt(sc, q->rspq.cntxt_id, irq_vec_idx,
@ -2773,16 +2762,12 @@ t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad)
m->m_pkthdr.csum_flags = (CSUM_IP_CHECKED|CSUM_IP_VALID|CSUM_DATA_VALID|CSUM_PSEUDO_HDR);
m->m_pkthdr.csum_data = 0xffff;
}
/*
* XXX need to add VLAN support for 6.x
*/
#ifdef VLAN_SUPPORTED
if (__predict_false(cpl->vlan_valid)) {
if (cpl->vlan_valid) {
m->m_pkthdr.ether_vtag = ntohs(cpl->vlan);
m->m_flags |= M_VLANTAG;
}
#endif
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.header = mtod(m, uint8_t *) + sizeof(*cpl) + ethpad;
/*
@ -2962,11 +2947,9 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget)
struct rsp_desc *r = &rspq->desc[rspq->cidx];
int budget_left = budget;
unsigned int sleeping = 0;
#ifdef LRO_SUPPORTED
int lro_enabled = qs->lro.enabled;
int skip_lro;
struct lro_ctrl *lro_ctrl = &qs->lro.ctrl;
#endif
struct mbuf *offload_mbufs[RX_BUNDLE_SIZE];
int ngathered = 0;
#ifdef DEBUG
@ -3075,7 +3058,6 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget)
t3_rx_eth(adap, rspq, m, ethpad);
#ifdef LRO_SUPPORTED
/*
* The T304 sends incoming packets on any qset. If LRO
* is also enabled, we could end up sending packet up
@ -3089,9 +3071,7 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget)
if (lro_enabled && lro_ctrl->lro_cnt && !skip_lro &&
(tcp_lro_rx(lro_ctrl, m, 0) == 0)) {
/* successfully queue'd for LRO */
} else
#endif
{
} else {
/*
* LRO not enabled, packet unsuitable for LRO,
* or unable to queue. Pass it up right now in
@ -3110,14 +3090,12 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget)
deliver_partial_bundle(&adap->tdev, rspq, offload_mbufs, ngathered);
#ifdef LRO_SUPPORTED
/* Flush LRO */
while (!SLIST_EMPTY(&lro_ctrl->lro_active)) {
struct lro_entry *queued = SLIST_FIRST(&lro_ctrl->lro_active);
SLIST_REMOVE_HEAD(&lro_ctrl->lro_active, next);
tcp_lro_flush(lro_ctrl, queued);
}
#endif
if (sleeping)
check_ring_db(adap, qs, sleeping);
@ -3690,7 +3668,6 @@ t3_add_configured_sysctls(adapter_t *sc)
CTLTYPE_STRING | CTLFLAG_RD, &qs->txq[TXQ_CTRL],
0, t3_dump_txq_ctrl, "A", "dump of the transmit queue");
#ifdef LRO_SUPPORTED
SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_queued",
CTLFLAG_RD, &qs->lro.ctrl.lro_queued, 0, NULL);
SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_flushed",
@ -3699,7 +3676,6 @@ t3_add_configured_sysctls(adapter_t *sc)
CTLFLAG_RD, &qs->lro.ctrl.lro_bad_csum, 0, NULL);
SYSCTL_ADD_INT(ctx, lropoidlist, OID_AUTO, "lro_cnt",
CTLFLAG_RD, &qs->lro.ctrl.lro_cnt, 0, NULL);
#endif
}
/* Now add a node for mac stats. */

View file

@ -138,8 +138,7 @@ open_rnic_dev(struct t3cdev *tdev)
CTR2(KTR_IW_CXGB, "%s t3cdev %p", __FUNCTION__, tdev);
if (!vers_printed++)
printf("Chelsio T3 RDMA Driver - version %s\n",
DRV_VERSION);
printf("Chelsio T3 RDMA Driver - version x.xx\n");
rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp));
if (!rnicp) {
printf("Cannot allocate ib device\n");

View file

@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <cxgb_config.h>
#include <cxgb_osdep.h>
#include <sys/mbufq.h>
#include <ulp/tom/cxgb_tcp_offload.h>

View file

@ -12,13 +12,5 @@ SRCS+= opt_inet.h opt_zero.h opt_sched.h
SRCS+= uipc_mvec.c
CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB}
CFLAGS+= -DDISABLE_MBUF_IOVEC
#CFLAGS+= -DIFNET_MULTIQUEUE
#CFLAGS+= -DDISABLE_MBUF_IOVEC
#CFLAGS+= -DDEBUG -DDEBUG_PRINT
#CFLAGS+= -DINVARIANT_SUPPORT -DINVARIANTS
#CFLAGS+= -DWITNESS
#CFLAGS += -DLOCK_PROFILING
#CFLAGS+= -DWITNESS
.include <bsd.kmod.mk>