PERFORCE change 124806 for review
Kip Macy
kmacy at FreeBSD.org
Tue Aug 7 01:21:41 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=124806
Change 124806 by kmacy at kmacy_home:ethng on 2007/08/07 08:21:12
integrate baseline multiq support functionality
Affected files ...
.. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_adapter.h#3 edit
.. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_main.c#4 edit
.. //depot/projects/ethng/src/sys/dev/cxgb/cxgb_multiq.c#1 add
.. //depot/projects/ethng/src/sys/modules/cxgb/Makefile#4 edit
Differences ...
==== //depot/projects/ethng/src/sys/dev/cxgb/cxgb_adapter.h#3 (text+ko) ====
@@ -572,5 +572,12 @@
return isset(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT);
}
+#ifdef IFNET_MULTIQUEUE
+int cxgb_pcpu_enqueue_packet(struct ifnet *ifp, int32_t cpuid, struct mbuf *m);
+int cxgb_pcpu_start(struct ifnet *ifp, int32_t cpuid, struct mbuf *m);
+int32_t cxgb_pcpu_get_cookie(struct ifnet *ifp, struct in6_addr *lip, uint16_t lport,
+ struct in6_addr *rip, uint16_t rport, int ipv6);
+
#endif
+#endif
==== //depot/projects/ethng/src/sys/dev/cxgb/cxgb_main.c#4 (text+ko) ====
@@ -636,6 +636,10 @@
{
int i;
+#ifdef IFNET_MULTIQUEUE
+ cxgb_pcpu_shutdown_threads(sc);
+#endif
+
ADAPTER_LOCK(sc);
/*
* drops the lock
@@ -993,6 +997,18 @@
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = cxgb_ioctl;
ifp->if_start = cxgb_start;
+
+#ifdef IFNET_MULTIQUEUE
+ if (ifnet_multiqueue == 0) {
+ device_printf(dev, "cxgb compiled with multi-queue support, but kernel doesn't support it\n");
+ return (EDOOFUS);
+ }
+ ifp->if_flags |= IFF_MULTIQ;
+ ifp->if_mq_start = cxgb_pcpu_start;
+ ifp->if_mq_enqueue_packet = cxgb_pcpu_enqueue_packet;
+ ifp->if_mq_get_cookie = cxgb_pcpu_get_cookie;
+#endif
+
ifp->if_timer = 0; /* Disable ifnet watchdog */
ifp->if_watchdog = NULL;
@@ -1408,6 +1424,10 @@
{
int i, j;
+#ifdef IFNET_MULTIQUEUE
+ cxgb_pcpu_startup_threads(sc);
+#endif
+
for (i = 0; i < (sc)->params.nports; ++i) {
const struct port_info *pi = adap2pinfo(sc, i);
@@ -2007,6 +2027,16 @@
} while (error == 0);
}
+#ifndef IFNET_MULTIQUEUE
+static inline struct mbuf *
+cxgb_dequeue_packet(struct ifnet *ifp, struct sge_txq *unused)
+{
+ struct mbuf *m;
+
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+ return (m);
+}
+
static void
cxgb_start(struct ifnet *ifp)
{
@@ -2027,7 +2057,7 @@
if (err == 0)
taskqueue_enqueue(pi->tq, &pi->start_task);
}
-
+#endif
static int
cxgb_media_change(struct ifnet *ifp)
==== //depot/projects/ethng/src/sys/modules/cxgb/Makefile#4 (text+ko) ====
@@ -8,7 +8,7 @@
SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c
SRCS+= cxgb_sge.c cxgb_lro.c cxgb_offload.c cxgb_l2t.c
SRCS+= device_if.h bus_if.h pci_if.h opt_zero.h
-SRCS+= uipc_mvec.c
+SRCS+= uipc_mvec.c cxgb_multiq.c
CFLAGS+= -DCONFIG_CHELSIO_T3_CORE -g -DCONFIG_DEFINED -DDEFAULT_JUMBO -I${CXGB}
#CFLAGS+= -DIFNET_MULTIQUEUE
More information about the p4-projects
mailing list