diff --git a/sys/dev/cxgb/cxgb_config.h b/sys/dev/cxgb/cxgb_config.h index 8b111f6297cf..79af94ca8e00 100644 --- a/sys/dev/cxgb/cxgb_config.h +++ b/sys/dev/cxgb/cxgb_config.h @@ -33,6 +33,8 @@ $FreeBSD$ #define _CXGB_CONFIG_H_ #define CONFIG_CHELSIO_T3_CORE -#define IFNET_MULTIQUEUE +#if __FreeBSD_version > 800053 +#define IFNET_MULTIQUEUE +#endif #endif diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 2a754ac83505..5199a60ae92a 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -946,8 +946,9 @@ cxgb_port_attach(device_t dev) } ether_ifattach(ifp, p->hw_addr); - +#ifdef IFNET_MULTIQUEUE ifp->if_transmit = cxgb_pcpu_transmit; +#endif /* * Only default to jumbo frames on 10GigE */ diff --git a/sys/dev/cxgb/cxgb_osdep.h b/sys/dev/cxgb/cxgb_osdep.h index d0a72580d060..f03cb0d3f1b3 100644 --- a/sys/dev/cxgb/cxgb_osdep.h +++ b/sys/dev/cxgb/cxgb_osdep.h @@ -117,6 +117,30 @@ struct t3_mbuf_hdr { #define TOE_SUPPORTED #endif +#if __FreeBSD_version < 800054 +#if defined (__GNUC__) + #if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ + #define mb() __asm__ __volatile__ ("mfence;": : :"memory") + #define wmb() __asm__ __volatile__ ("sfence;": : :"memory") + #define rmb() __asm__ __volatile__ ("lfence;": : :"memory") + #elif #cpu(sparc64) || defined sparc64 || defined __sparcv9 + #define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") + #define wmb() mb() + #define rmb() mb() + #elif #cpu(sparc) || defined sparc || defined __sparc__ + #define mb() __asm__ __volatile__ ("stbar;": : :"memory") + #define wmb() mb() + #define rmb() mb() +#else + #define wmb() mb() + #define rmb() mb() + #define mb() /* XXX just to make this compile */ + #endif +#else + #error "unknown compiler" +#endif +#endif + #define __read_mostly __attribute__((__section__(".data.read_mostly"))) /*