Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jun 2010 10:13:32 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r209585 - user/jmallett/octeon/sys/mips/cavium/octe
Message-ID:  <201006291013.o5TADWx7091057@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Tue Jun 29 10:13:32 2010
New Revision: 209585
URL: http://svn.freebsd.org/changeset/base/209585

Log:
  Remove unused and overwrought code related to (1) reusing mbufs from transmit
  for receive (2) intercepting incoming packets and dropping them or consuming
  them elsewhere, which is easily generically implementable on FreeBSD using e.g.
  netgraph.
  
  This should allow for some simplification of nearby code in the near future.

Modified:
  user/jmallett/octeon/sys/mips/cavium/octe/cavium-ethernet.h
  user/jmallett/octeon/sys/mips/cavium/octe/ethernet-defines.h
  user/jmallett/octeon/sys/mips/cavium/octe/ethernet-rx.c
  user/jmallett/octeon/sys/mips/cavium/octe/ethernet-tx.c
  user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c

Modified: user/jmallett/octeon/sys/mips/cavium/octe/cavium-ethernet.h
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/cavium-ethernet.h	Tue Jun 29 06:38:56 2010	(r209584)
+++ user/jmallett/octeon/sys/mips/cavium/octe/cavium-ethernet.h	Tue Jun 29 10:13:32 2010	(r209585)
@@ -40,47 +40,6 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
 #include <net/if_media.h>
 
 /**
- * These enumerations are the return codes for the Ethernet
- * driver intercept callback. Depending on the return code,
- * the ethernet driver will continue processing in different
- * ways.
- */
-typedef enum {
-	CVM_OCT_PASS,               /**< The ethernet driver will pass the packet
-					to the kernel, just as if the intercept
-					callback didn't exist */
-	CVM_OCT_DROP,               /**< The ethernet driver will drop the packet,
-					cleaning of the work queue entry and the
-					mbuf */
-	CVM_OCT_TAKE_OWNERSHIP_WORK,/**< The intercept callback takes over
-					ownership of the work queue entry. It is
-					the responsibility of the callback to free
-					the work queue entry and all associated
-					packet buffers. The ethernet driver will
-					dispose of the mbuf without affecting the
-					work queue entry */
-	CVM_OCT_TAKE_OWNERSHIP_SKB  /**< The intercept callback takes over
-					ownership of the mbuf. The work queue
-					entry and packet buffer will be disposed of
-					in a way keeping the mbuf valid */
-} cvm_oct_callback_result_t;
-
-
-/**
- * The is the definition of the Ethernet driver intercept
- * callback. The callback receives three parameters and
- * returns a struct cvm_oct_callback_result code.
- *
- * The first parameter is the linux device for the ethernet
- * port the packet came in on.
- * The second parameter is the raw work queue entry from the
- * hardware.
- * Th third parameter is the packet converted into a Linux
- * mbuf.
- */
-typedef cvm_oct_callback_result_t (*cvm_oct_callback_t)(struct ifnet *ifp, void *work_queue_entry, struct mbuf *m);
-
-/**
  * This is the definition of the Ethernet driver's private
  * driver state stored in ifp->if_softc.
  */
@@ -92,8 +51,6 @@ typedef struct {
 	int                     queue;          /* PKO hardware queue for the port */
 	int                     fau;            /* Hardware fetch and add to count outstanding tx buffers */
 	int                     imode;          /* Type of port. This is one of the enums in cvmx_helper_interface_mode_t */
-	/* Keeping intercept_cb close the the part of stats that is most often modified helps throughput. */
-	cvm_oct_callback_t      intercept_cb;   /* Optional intecept callback defined above */
 #if 0
 	struct ifnet_stats stats;          /* Device statistics */
 #endif
@@ -125,23 +82,6 @@ typedef struct {
 
 
 /**
- * Registers a intercept callback for the names ethernet
- * device. It returns the Linux device structure for the
- * ethernet port. Usign a callback of NULL will remove
- * the callback. Note that this callback must not disturb
- * scratch. It will be called with SYNCIOBDMAs in progress
- * and userspace may be using scratch. It also must not
- * disturb the group mask.
- *
- * @param device_name
- *                 Device name to register for. (Example: "eth0")
- * @param callback Intercept callback to set.
- * @return Device structure for the ethernet port or NULL on failure.
- */
-struct ifnet *cvm_oct_register_callback(const char *device_name, cvm_oct_callback_t callback);
-
-
-/**
  * Free a work queue entry received in a intercept callback.
  *
  * @param work_queue_entry
@@ -150,45 +90,4 @@ struct ifnet *cvm_oct_register_callback(
  */
 int cvm_oct_free_work(void *work_queue_entry);
 
-
-/**
- * Transmit a work queue entry out of the ethernet port. Both
- * the work queue entry and the packet data can optionally be
- * freed. The work will be freed on error as well.
- *
- * @param dev     Device to transmit out.
- * @param work_queue_entry
- *                Work queue entry to send
- * @param do_free True if the work queue entry and packet data should be
- *                freed. If false, neither will be freed.
- * @param qos     Index into the queues for this port to transmit on. This
- *                is used to implement QoS if their are multiple queues per
- *                port. This parameter must be between 0 and the number of
- *                queues per port minus 1. Values outside of this range will
- *                be change to zero.
- *
- * @return Zero on success, negative on failure.
- */
-int cvm_oct_transmit_qos(struct ifnet *ifp, void *work_queue_entry, int do_free, int qos);
-
-
-/**
- * Transmit a work queue entry out of the ethernet port. Both
- * the work queue entry and the packet data can optionally be
- * freed. The work will be freed on error as well. This simply
- * wraps cvmx_oct_transmit_qos() for backwards compatability.
- *
- * @param dev     Device to transmit out.
- * @param work_queue_entry
- *                Work queue entry to send
- * @param do_free True if the work queue entry and packet data should be
- *                freed. If false, neither will be freed.
- *
- * @return Zero on success, negative on failure.
- */
-static inline int cvm_oct_transmit(struct ifnet *ifp, void *work_queue_entry, int do_free)
-{
-	return cvm_oct_transmit_qos(ifp, work_queue_entry, do_free, 0);
-}
-
 #endif

Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-defines.h
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet-defines.h	Tue Jun 29 06:38:56 2010	(r209584)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet-defines.h	Tue Jun 29 10:13:32 2010	(r209585)
@@ -58,12 +58,6 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
  *      Use asynchronous IO access to hardware. This uses Octeon's asynchronous
  *      IOBDMAs to issue IO accesses without stalling. Set this to zero
  *      to disable this. Note that IOBDMAs require CVMSEG.
- *  REUSE_MBUFS_WITHOUT_FREE
- *      Allows the TX path to free an mbuf into the FPA hardware pool. This
- *      can significantly improve performance for forwarding and bridging, but
- *      may be somewhat dangerous. Checks are made, but if any buffer is reused
- *      without the proper Linux cleanup, the networking stack may have very
- *      bizarre bugs.
  */
 #ifndef CONFIG_CAVIUM_RESERVE32
 #define CONFIG_CAVIUM_RESERVE32 0
@@ -72,19 +66,9 @@ AND WITH ALL FAULTS AND CAVIUM  NETWORKS
 #if CONFIG_CAVIUM_RESERVE32
 	#define USE_32BIT_SHARED            1
 	#define USE_MBUFS_IN_HW           0
-	#define REUSE_MBUFS_WITHOUT_FREE  0
 #else
 	#define USE_32BIT_SHARED            0
 	#define USE_MBUFS_IN_HW           1
-#if 0
-	#ifdef CONFIG_NETFILTER
-		#define REUSE_MBUFS_WITHOUT_FREE  0
-	#else
-		#define REUSE_MBUFS_WITHOUT_FREE  1
-	#endif
-#else
-	#define REUSE_MBUFS_WITHOUT_FREE  0
-#endif
 #endif
 
 #define INTERRUPT_LIMIT             10000   /* Max interrupts per second per core */

Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-rx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet-rx.c	Tue Jun 29 06:38:56 2010	(r209584)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet-rx.c	Tue Jun 29 10:13:32 2010	(r209585)
@@ -191,7 +191,6 @@ void cvm_oct_tasklet_rx(void *context, i
 
 	while (1) {
 		struct mbuf *m = NULL;
-		cvm_oct_callback_result_t callback_result;
 		int mbuf_in_hw;
 		cvmx_wqe_t *work;
 
@@ -312,7 +311,6 @@ void cvm_oct_tasklet_rx(void *context, i
 		if (((work->ipprt < TOTAL_NUMBER_OF_PORTS) &&
 		    cvm_oct_device[work->ipprt])) {
 			struct ifnet *ifp = cvm_oct_device[work->ipprt];
-			cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
 
 			/* Only accept packets for devices
 			   that are currently up */
@@ -326,40 +324,9 @@ void cvm_oct_tasklet_rx(void *context, i
 					m->m_pkthdr.csum_data = 0xffff;
 				}
 
-				if (priv->intercept_cb) {
-					callback_result = priv->intercept_cb(ifp, work, m);
+				ifp->if_ipackets++;
 
-					switch (callback_result) {
-					case CVM_OCT_PASS:
-						ifp->if_ipackets++;
-
-						(*ifp->if_input)(ifp, m);
-						break;
-					case CVM_OCT_DROP:
-						m_freem(m);
-						ifp->if_ierrors++;
-						break;
-					case CVM_OCT_TAKE_OWNERSHIP_WORK:
-						/* Interceptor stole our work, but
-						   we need to free the mbuf */
-						if (USE_MBUFS_IN_HW && (packet_not_copied)) {
-							/* We can't free the mbuf since its data is
-							the same as the work. In this case we don't
-							do anything */
-						} else
-							m_freem(m);
-						break;
-					case CVM_OCT_TAKE_OWNERSHIP_SKB:
-						/* Interceptor stole our packet */
-						break;
-					}
-				} else {
-					ifp->if_ipackets++;
-
-					(*ifp->if_input)(ifp, m);
-
-					callback_result = CVM_OCT_PASS;
-				}
+				(*ifp->if_input)(ifp, m);
 			} else {
 				/* Drop any packet received for a device that isn't up */
 				/*
@@ -367,33 +334,26 @@ void cvm_oct_tasklet_rx(void *context, i
 					   if_name(ifp));
 				*/
 				m_freem(m);
-				callback_result = CVM_OCT_DROP;
 			}
 		} else {
 			/* Drop any packet received for a device that
 			   doesn't exist */
 			DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n", work->ipprt);
 			m_freem(m);
-			callback_result = CVM_OCT_DROP;
 		}
 
-		/* We only need to free the work if the interceptor didn't
-		   take over ownership of it */
-		if (callback_result != CVM_OCT_TAKE_OWNERSHIP_WORK) {
-
-			/* Check to see if the mbuf and work share
-			   the same packet buffer */
-			if (USE_MBUFS_IN_HW && (packet_not_copied)) {
-				/* This buffer needs to be replaced, increment
-				the number of buffers we need to free by one */
-				cvmx_fau_atomic_add32(
-					FAU_NUM_PACKET_BUFFERS_TO_FREE, 1);
-
-				cvmx_fpa_free(work, CVMX_FPA_WQE_POOL,
-					      DONT_WRITEBACK(1));
-			} else
-				cvm_oct_free_work(work);
-		}
+		/* Check to see if the mbuf and work share
+		   the same packet buffer */
+		if (USE_MBUFS_IN_HW && (packet_not_copied)) {
+			/* This buffer needs to be replaced, increment
+			the number of buffers we need to free by one */
+			cvmx_fau_atomic_add32(
+				FAU_NUM_PACKET_BUFFERS_TO_FREE, 1);
+
+			cvmx_fpa_free(work, CVMX_FPA_WQE_POOL,
+				      DONT_WRITEBACK(1));
+		} else
+			cvm_oct_free_work(work);
 	}
 
 	/* Restore the original POW group mask */

Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet-tx.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet-tx.c	Tue Jun 29 06:38:56 2010	(r209584)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet-tx.c	Tue Jun 29 10:13:32 2010	(r209585)
@@ -71,9 +71,6 @@ int cvm_oct_xmit(struct mbuf *m, struct 
 	cvm_oct_private_t          *priv = (cvm_oct_private_t *)ifp->if_softc;
 	int32_t in_use;
 	int32_t buffers_to_free;
-#if REUSE_MBUFS_WITHOUT_FREE
-	unsigned char *fpa_head;
-#endif
 	cvmx_wqe_t *work;
 
 	/* Prefetch the private data structure.
@@ -194,102 +191,6 @@ int cvm_oct_xmit(struct mbuf *m, struct 
 	pko_command.s.size0 = CVMX_FAU_OP_SIZE_32;
 	pko_command.s.subone0 = 1;
 
-	pko_command.s.dontfree = 1;
-	pko_command.s.reg0 = priv->fau+qos*4;
-
-	/* See if we can put this m in the FPA pool. Any strange behavior
-	   from the Linux networking stack will most likely be caused by a bug
-	   in the following code. If some field is in use by the network stack
-	   and get carried over when a buffer is reused, bad thing may happen.
-	   If in doubt and you dont need the absolute best performance, disable
-	   the define REUSE_MBUFS_WITHOUT_FREE. The reuse of buffers has
-	   shown a 25% increase in performance under some loads */
-#if REUSE_MBUFS_WITHOUT_FREE
-	fpa_head = m->head + 128 - ((unsigned long)m->head&0x7f);
-	if (__predict_false(m->data < fpa_head)) {
-		/*
-		printf("TX buffer beginning can't meet FPA alignment constraints\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false((m_end_pointer(m) - fpa_head) < CVMX_FPA_PACKET_POOL_SIZE)) {
-		/*
-		printf("TX buffer isn't large enough for the FPA\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m_shared(m))) {
-		/*
-		printf("TX buffer sharing data with someone else\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m_cloned(m))) {
-		/*
-		printf("TX buffer has been cloned\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m_header_cloned(m))) {
-		/*
-		printf("TX buffer header has been cloned\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m->destructor)) {
-		/*
-		printf("TX buffer has a destructor\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m_shinfo(m)->nr_frags)) {
-		/*
-		printf("TX buffer has fragments\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-	if (__predict_false(m->truesize != sizeof(*m) + m_end_pointer(m) - m->head)) {
-		/*
-		printf("TX buffer truesize has been changed\n");
-		*/
-		goto dont_put_mbuf_in_hw;
-	}
-
-	/* We can use this buffer in the FPA.
-	   We don't need the FAU update anymore */
-	pko_command.s.reg0 = 0;
-	pko_command.s.dontfree = 0;
-
-	hw_buffer.s.back = (m->data - fpa_head)>>7;
-	*(struct mbuf **)(fpa_head-sizeof(void *)) = m;
-
-	/* The mbuf will be reused without ever being freed. We must cleanup a
-	   bunch of Linux stuff */
-	dst_release(m->dst);
-	m->dst = NULL;
-#ifdef CONFIG_XFRM
-	secpath_put(m->sp);
-	m->sp = NULL;
-#endif
-	nf_reset(m);
-#ifdef CONFIG_BRIDGE_NETFILTER
-	/* The next two lines are done in nf_reset() for 2.6.21. 2.6.16 needs
-	   them. I'm leaving it for all versions since the compiler will
-	   optimize them away when they aren't needed. It can tell that
-	   m->nf_bridge was set to NULL in the inlined nf_reset(). */
-	nf_bridge_put(m->nf_bridge);
-	m->nf_bridge = NULL;
-#endif /* CONFIG_BRIDGE_NETFILTER */
-#ifdef CONFIG_NET_SCHED
-	m->tc_index = 0;
-#ifdef CONFIG_NET_CLS_ACT
-	m->tc_verd = 0;
-#endif /* CONFIG_NET_CLS_ACT */
-#endif /* CONFIG_NET_SCHED */
-
-dont_put_mbuf_in_hw:
-#endif /* REUSE_MBUFS_WITHOUT_FREE */
-
 	/* Check if we can use the hardware checksumming */
 	if (USE_HW_TCPUDP_CHECKSUM &&
 	    (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) != 0) {
@@ -308,13 +209,6 @@ dont_put_mbuf_in_hw:
 		buffers_to_free = cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0);
 	}
 
-	/* If we're sending faster than the receive can free them then don't do
-	   the HW free */
-	if ((buffers_to_free < -100) && !pko_command.s.dontfree) {
-		pko_command.s.dontfree = 1;
-		pko_command.s.reg0 = priv->fau+qos*4;
-	}
-
 	cvmx_pko_send_packet_prepare(priv->port, priv->queue + qos, CVMX_PKO_LOCK_CMD_QUEUE);
 
 	/* Drop this packet if we have too many already queued to the HW */
@@ -339,18 +233,8 @@ dont_put_mbuf_in_hw:
 		cvmx_fau_atomic_add32(priv->fau+qos*4, -1);
 		ifp->if_oerrors++;
 	} else {
-		if (USE_MBUFS_IN_HW) {
-			/* Put this packet on the queue to be freed later */
-			if (pko_command.s.dontfree)
-				IF_ENQUEUE(&priv->tx_free_queue[qos], m);
-			else {
-				cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, -1);
-				cvmx_fau_atomic_add32(priv->fau+qos*4, -1);
-			}
-		} else {
-			/* Put this packet on the queue to be freed later */
-			IF_ENQUEUE(&priv->tx_free_queue[qos], m);
-		}
+		/* Put this packet on the queue to be freed later */
+		IF_ENQUEUE(&priv->tx_free_queue[qos], m);
 	}
 	if (work != NULL)
 		cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
@@ -496,96 +380,6 @@ int cvm_oct_xmit_pow(struct mbuf *m, str
 
 
 /**
- * Transmit a work queue entry out of the ethernet port. Both
- * the work queue entry and the packet data can optionally be
- * freed. The work will be freed on error as well.
- *
- * @param dev     Device to transmit out.
- * @param work_queue_entry
- *                Work queue entry to send
- * @param do_free True if the work queue entry and packet data should be
- *                freed. If false, neither will be freed.
- * @param qos     Index into the queues for this port to transmit on. This
- *                is used to implement QoS if their are multiple queues per
- *                port. This parameter must be between 0 and the number of
- *                queues per port minus 1. Values outside of this range will
- *                be change to zero.
- *
- * @return Zero on success, negative on failure.
- */
-int cvm_oct_transmit_qos(struct ifnet *ifp, void *work_queue_entry, int do_free, int qos)
-{
-	cvmx_buf_ptr_t             hw_buffer;
-	cvmx_pko_command_word0_t   pko_command;
-	int                        dropped;
-	cvm_oct_private_t         *priv = (cvm_oct_private_t *)ifp->if_softc;
-	cvmx_wqe_t                *work = work_queue_entry;
-
-	if (!(ifp->if_flags & IFF_UP)) {
-		DEBUGPRINT("%s: Device not up\n", if_name(ifp));
-		if (do_free)
-			cvm_oct_free_work(work);
-		return -1;
-	}
-
-	/* The check on CVMX_PKO_QUEUES_PER_PORT_* is designed to completely
-	   remove "qos" in the event neither interface supports
-	   multiple queues per port */
-	if ((CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1) ||
-		(CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1)) {
-		if (qos <= 0)
-			qos = 0;
-		else if (qos >= cvmx_pko_get_num_queues(priv->port))
-			qos = 0;
-	} else
-		qos = 0;
-
-	/* Start off assuming no drop */
-	dropped = 0;
-
-	critical_enter();
-	cvmx_pko_send_packet_prepare(priv->port, priv->queue + qos, CVMX_PKO_LOCK_CMD_QUEUE);
-
-	/* Build the PKO buffer pointer */
-	hw_buffer.u64 = 0;
-	hw_buffer.s.addr = work->packet_ptr.s.addr;
-	hw_buffer.s.pool = CVMX_FPA_PACKET_POOL;
-	hw_buffer.s.size = CVMX_FPA_PACKET_POOL_SIZE;
-	hw_buffer.s.back = work->packet_ptr.s.back;
-
-	/* Build the PKO command */
-	pko_command.u64 = 0;
-	pko_command.s.n2 = 1; /* Don't pollute L2 with the outgoing packet */
-	pko_command.s.dontfree = !do_free;
-	pko_command.s.segs = work->word2.s.bufs;
-	pko_command.s.total_bytes = work->len;
-
-	/* Check if we can use the hardware checksumming */
-	if (__predict_false(work->word2.s.not_IP || work->word2.s.IP_exc))
-		pko_command.s.ipoffp1 = 0;
-	else
-		pko_command.s.ipoffp1 = ETHER_HDR_LEN + 1;
-
-	/* Send the packet to the output queue */
-	if (__predict_false(cvmx_pko_send_packet_finish(priv->port, priv->queue + qos, pko_command, hw_buffer, CVMX_PKO_LOCK_CMD_QUEUE))) {
-		DEBUGPRINT("%s: Failed to send the packet\n", if_name(ifp));
-		dropped = -1;
-	}
-	critical_exit();
-
-	if (__predict_false(dropped)) {
-		if (do_free)
-			cvm_oct_free_work(work);
-		ifp->if_oerrors++;
-	} else
-	if (do_free)
-		cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
-
-	return dropped;
-}
-
-
-/**
  * This function frees all mbufs that are currenty queued for TX.
  *
  * @param dev    Device being shutdown

Modified: user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c	Tue Jun 29 06:38:56 2010	(r209584)
+++ user/jmallett/octeon/sys/mips/cavium/octe/ethernet.c	Tue Jun 29 10:13:32 2010	(r209585)
@@ -252,40 +252,6 @@ static void cvm_oct_configure_common_hw(
 
 
 /**
- * Registers a intercept callback for the names ethernet
- * device. It returns the Linux device structure for the
- * ethernet port. Usign a callback of NULL will remove
- * the callback. Note that this callback must not disturb
- * scratch. It will be called with SYNCIOBDMAs in progress
- * and userspace may be using scratch. It also must not
- * disturb the group mask.
- *
- * @param device_name
- *                 Device name to register for. (Example: "eth0")
- * @param callback Intercept callback to set.
- * @return Device structure for the ethernet port or NULL on failure.
- */
-#if 0
-struct ifnet *cvm_oct_register_callback(const char *device_name, cvm_oct_callback_t callback)
-{
-	int port;
-
-	for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) {
-		if (cvm_oct_device[port] &&
-		    (strcmp(device_name, cvm_oct_device[port]->name) == 0)) {
-			cvm_oct_private_t *priv = (cvm_oct_private_t *)cvm_oct_device[port]->if_softc;
-			priv->intercept_cb = callback;
-			wmb();
-			return cvm_oct_device[port];
-		}
-	}
-
-	return NULL;
-}
-#endif
-
-
-/**
  * Free a work queue entry received in a intercept callback.
  *
  * @param work_queue_entry
@@ -426,7 +392,6 @@ int cvm_oct_init_module(device_t bus)
 			priv->imode = imode;
 			priv->port = port;
 			priv->queue = cvmx_pko_get_base_queue(priv->port);
-			priv->intercept_cb = NULL;
 			priv->fau = fau - cvmx_pko_get_num_queues(port) * 4;
 			for (qos = 0; qos < cvmx_pko_get_num_queues(port); qos++)
 				cvmx_fau_atomic_write32(priv->fau+qos*4, 0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006291013.o5TADWx7091057>