From owner-svn-src-head@FreeBSD.ORG Sun Nov 23 07:30:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 650FC1065672; Sun, 23 Nov 2008 07:30:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5438FC0A; Sun, 23 Nov 2008 07:30:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAN7U8ga043933; Sun, 23 Nov 2008 07:30:08 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAN7U8fN043930; Sun, 23 Nov 2008 07:30:08 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811230730.mAN7U8fN043930@svn.freebsd.org> From: Kip Macy Date: Sun, 23 Nov 2008 07:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185199 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2008 07:30:08 -0000 Author: kmacy Date: Sun Nov 23 07:30:07 2008 New Revision: 185199 URL: http://svn.freebsd.org/changeset/base/185199 Log: Add backward compatibility ifdefs for non-multiq kernels Modified: head/sys/dev/cxgb/cxgb_config.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_osdep.h Modified: head/sys/dev/cxgb/cxgb_config.h ============================================================================== --- head/sys/dev/cxgb/cxgb_config.h Sun Nov 23 05:39:49 2008 (r185198) +++ head/sys/dev/cxgb/cxgb_config.h Sun Nov 23 07:30:07 2008 (r185199) @@ -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 Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sun Nov 23 05:39:49 2008 (r185198) +++ head/sys/dev/cxgb/cxgb_main.c Sun Nov 23 07:30:07 2008 (r185199) @@ -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 */ Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Sun Nov 23 05:39:49 2008 (r185198) +++ head/sys/dev/cxgb/cxgb_osdep.h Sun Nov 23 07:30:07 2008 (r185199) @@ -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"))) /*