Author: np
Date: Mon Feb 13 18:54:15 2012
New Revision: 231593
URL: http://svn.freebsd.org/changeset/base/231593

Log:
  MFC r231115:
  cxgbe: reduce diffs with other branches.

Modified:
  stable/9/sys/dev/cxgbe/adapter.h
  stable/9/sys/dev/cxgbe/t4_l2t.c
  stable/9/sys/dev/cxgbe/t4_l2t.h
  stable/9/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/9/sys/dev/cxgbe/adapter.h    Mon Feb 13 18:41:32 2012        
(r231592)
+++ stable/9/sys/dev/cxgbe/adapter.h    Mon Feb 13 18:54:15 2012        
(r231593)
@@ -66,6 +66,17 @@ prefetch(void *x)
 #define prefetch(x)
 #endif
 
+#ifndef SYSCTL_ADD_UQUAD
+#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
+#define sysctl_handle_64 sysctl_handle_quad
+#define CTLTYPE_U64 CTLTYPE_QUAD
+#endif
+
+#if (__FreeBSD_version >= 900030) || \
+    ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000))
+#define SBUF_DRAIN 1
+#endif
+
 #ifdef __amd64__
 /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
 static __inline uint64_t

Modified: stable/9/sys/dev/cxgbe/t4_l2t.c
==============================================================================
--- stable/9/sys/dev/cxgbe/t4_l2t.c     Mon Feb 13 18:41:32 2012        
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_l2t.c     Mon Feb 13 18:54:15 2012        
(r231593)
@@ -259,6 +259,7 @@ t4_free_l2t(struct l2t_data *d)
        return (0);
 }
 
+#ifdef SBUF_DRAIN
 static inline unsigned int
 vlan_prio(const struct l2t_entry *e)
 {
@@ -333,6 +334,7 @@ skip:
 
        return (rc);
 }
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
 static inline void
@@ -652,6 +654,11 @@ t4_l2t_get(struct port_info *pi, struct 
        } else
                return (NULL);
 
+#ifndef VLAN_TAG
+       if (ifp->if_type == IFT_L2VLAN)
+               return (NULL);
+#endif
+
        hash = addr_hash(addr, addr_len, ifp->if_index);
 
        rw_wlock(&d->lock);
@@ -678,10 +685,12 @@ t4_l2t_get(struct port_info *pi, struct 
                e->v6 = (addr_len == 16);
                e->lle = NULL;
                atomic_store_rel_int(&e->refcnt, 1);
+#ifdef VLAN_TAG
                if (ifp->if_type == IFT_L2VLAN)
                        VLAN_TAG(ifp, &e->vlan);
                else
                        e->vlan = VLAN_NONE;
+#endif
                e->next = d->l2tab[hash].first;
                d->l2tab[hash].first = e;
                mtx_unlock(&e->lock);

Modified: stable/9/sys/dev/cxgbe/t4_l2t.h
==============================================================================
--- stable/9/sys/dev/cxgbe/t4_l2t.h     Mon Feb 13 18:41:32 2012        
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_l2t.h     Mon Feb 13 18:54:15 2012        
(r231593)
@@ -67,7 +67,9 @@ struct l2t_entry *t4_l2t_alloc_switching
 int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t,
     uint8_t, uint8_t *);
 void t4_l2t_release(struct l2t_entry *);
+#ifdef SBUF_DRAIN
 int sysctl_l2t(SYSCTL_HANDLER_ARGS);
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
 struct l2t_entry *t4_l2t_get(struct port_info *, struct ifnet *,

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/9/sys/dev/cxgbe/t4_main.c    Mon Feb 13 18:41:32 2012        
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_main.c    Mon Feb 13 18:54:15 2012        
(r231593)
@@ -309,6 +309,7 @@ static int sysctl_holdoff_pktc_idx(SYSCT
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
+#ifdef SBUF_DRAIN
 static int sysctl_cctrl(SYSCTL_HANDLER_ARGS);
 static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS);
 static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS);
@@ -324,6 +325,7 @@ static int sysctl_tcp_stats(SYSCTL_HANDL
 static int sysctl_tids(SYSCTL_HANDLER_ARGS);
 static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS);
 static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS);
+#endif
 static inline void txq_start(struct ifnet *, struct sge_txq *);
 static uint32_t fconf_to_mode(uint32_t);
 static uint32_t mode_to_fconf(uint32_t);
@@ -2980,6 +2982,7 @@ t4_sysctls(struct adapter *sc)
            sizeof(sc->sge.counter_val), sysctl_int_array, "A",
            "interrupt holdoff packet counter values");
 
+#ifdef SBUF_DRAIN
        /*
         * dev.t4nex.X.misc.  Marked CTLFLAG_SKIP to avoid information overload.
         */
@@ -3051,6 +3054,7 @@ t4_sysctls(struct adapter *sc)
        SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate",
            CTLTYPE_STRING | CTLFLAG_RD, sc, 0,
            sysctl_tx_rate, "A", "Tx rate");
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
        if (is_offload(sc)) {
@@ -3465,6 +3469,7 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR
        return (sysctl_handle_64(oidp, &val, 0, req));
 }
 
+#ifdef SBUF_DRAIN
 static int
 sysctl_cctrl(SYSCTL_HANDLER_ARGS)
 {
@@ -4297,6 +4302,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS)
 
        return (rc);
 }
+#endif
 
 static inline void
 txq_start(struct ifnet *ifp, struct sge_txq *txq)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to