Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Feb 2010 10:16:19 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204274 - in head/sys: dev/cxgb dev/cxgb/common dev/cxgb/ulp/iw_cxgb dev/cxgb/ulp/tom modules/cxgb/cxgb
Message-ID:  <201002241016.o1OAGJso054160@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Feb 24 10:16:18 2010
New Revision: 204274
URL: http://svn.freebsd.org/changeset/base/204274

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

Deleted:
  head/sys/dev/cxgb/common/cxgb_version.h
  head/sys/dev/cxgb/cxgb_config.h
Modified:
  head/sys/dev/cxgb/common/cxgb_common.h
  head/sys/dev/cxgb/common/cxgb_t3_hw.c
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_offload.h
  head/sys/dev/cxgb/cxgb_osdep.h
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c
  head/sys/modules/cxgb/cxgb/Makefile

Modified: head/sys/dev/cxgb/common/cxgb_common.h
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_common.h	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/common/cxgb_common.h	Wed Feb 24 10:16:18 2010	(r204274)
@@ -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
 
 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, un
 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);

Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_t3_hw.c	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/common/cxgb_t3_hw.c	Wed Feb 24 10:16:18 2010	(r204274)
@@ -3263,7 +3263,6 @@ static void tp_set_timers(adapter_t *ada
 #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, c
 	}
 	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 f
 	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->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);

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- head/sys/dev/cxgb/cxgb_adapter.h	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/cxgb_adapter.h	Wed Feb 24 10:16:18 2010	(r204274)
@@ -46,6 +46,7 @@ $FreeBSD$
 #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 @@ $FreeBSD$
 #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];

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/cxgb_main.c	Wed Feb 24 10:16:18 2010	(r204274)
@@ -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 @@ release_tpeeprom:
 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_inf
 	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 en
 	}
 	return (0);
 }
-#endif
 
 static int
 cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
@@ -2125,14 +2068,12 @@ fail:
 			} 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) {

Modified: head/sys/dev/cxgb/cxgb_offload.h
==============================================================================
--- head/sys/dev/cxgb/cxgb_offload.h	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/cxgb_offload.h	Wed Feb 24 10:16:18 2010	(r204274)
@@ -33,8 +33,6 @@ $FreeBSD$
 #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>
 

Modified: head/sys/dev/cxgb/cxgb_osdep.h
==============================================================================
--- head/sys/dev/cxgb/cxgb_osdep.h	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/cxgb_osdep.h	Wed Feb 24 10:16:18 2010	(r204274)
@@ -41,9 +41,6 @@ $FreeBSD$
 
 #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__

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/cxgb_sge.c	Wed Feb 24 10:16:18 2010	(r204274)
@@ -1145,10 +1145,9 @@ calc_tx_descs(const struct mbuf *m, int 
 		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, str
 /* 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 mbu
 	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_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 i
 	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 i
 		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 s
 		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, struc
 	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, struc
 
 			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, struc
 			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, struc
 
 	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. */

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
==============================================================================
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c	Wed Feb 24 10:16:18 2010	(r204274)
@@ -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");

Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c
==============================================================================
--- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c	Wed Feb 24 10:16:18 2010	(r204274)
@@ -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>

Modified: head/sys/modules/cxgb/cxgb/Makefile
==============================================================================
--- head/sys/modules/cxgb/cxgb/Makefile	Wed Feb 24 07:53:29 2010	(r204273)
+++ head/sys/modules/cxgb/cxgb/Makefile	Wed Feb 24 10:16:18 2010	(r204274)
@@ -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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002241016.o1OAGJso054160>