Add backward compatibility ifdefs for non-multiq kernels

This commit is contained in:
Kip Macy 2008-11-23 07:30:07 +00:00
parent f7eb979a5e
commit 5eba27fe0c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185199
3 changed files with 29 additions and 2 deletions

View File

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

View File

@ -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
*/

View File

@ -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")))
/*