svn commit: r212298 - in projects/sv/sys: net netinet

Attilio Rao attilio at FreeBSD.org
Tue Sep 7 17:51:24 UTC 2010


Author: attilio
Date: Tue Sep  7 17:51:23 2010
New Revision: 212298
URL: http://svn.freebsd.org/changeset/base/212298

Log:
  Add the possibility to specify, in drivers, nethdump virtual methods that
  will be used by the netdump for carrying on interface polling and testing.
  
  ASAP, will be offered an implementation for if_em and if_ixgb.

Modified:
  projects/sv/sys/net/if_var.h
  projects/sv/sys/netinet/netdump_client.c

Modified: projects/sv/sys/net/if_var.h
==============================================================================
--- projects/sv/sys/net/if_var.h	Tue Sep  7 17:24:05 2010	(r212297)
+++ projects/sv/sys/net/if_var.h	Tue Sep  7 17:51:23 2010	(r212298)
@@ -72,6 +72,7 @@ struct	carp_if;
 struct  ifvlantrunk;
 struct	route;
 struct	vnet;
+struct	netdump_methods;
 #endif
 
 #include <sys/queue.h>		/* get TAILQ macros */
@@ -195,6 +196,7 @@ struct ifnet {
 					/* protected by if_addr_mtx */
 	void	*if_pf_kif;
 	void	*if_lagg;		/* lagg glue */
+	struct	netdump_methods *if_ndumpfuncs; /* netdump virtual methods */
 	u_char	 if_alloctype;		/* if_type at time of allocation */
 
 	/*
@@ -204,7 +206,7 @@ struct ifnet {
 	 */
 	char	 if_cspare[3];
 	char	*if_description;	/* interface description */
-	void	*if_pspare[7];
+	void	*if_pspare[6];
 	int	if_ispare[4];
 };
 

Modified: projects/sv/sys/netinet/netdump_client.c
==============================================================================
--- projects/sv/sys/netinet/netdump_client.c	Tue Sep  7 17:24:05 2010	(r212297)
+++ projects/sv/sys/netinet/netdump_client.c	Tue Sep  7 17:51:23 2010	(r212298)
@@ -158,7 +158,7 @@ static int nd_retries=10; /* Times to re
 static __inline int
 netdump_supported_nic(struct ifnet *ifn)
 {
-	return ifn->if_netdump != NULL;
+	return ifn->if_ndumpfuncs != NULL;
 }
 
 /*-
@@ -288,7 +288,7 @@ sysctl_force_crash(SYSCTL_HANDLER_ARGS) 
 		case 3:
 			printf("\nLivelocking system while holding the "
 			    "interface lock\n");
-			nd_nic->if_netdump->test_get_lock(nd_nic);
+			nd_nic->if_ndumpfuncs->test_get_lock(nd_nic);
 			for (;;);
 			break;
 		case 5:
@@ -1075,7 +1075,7 @@ done:
 static void
 netdump_network_poll()
 {
-	nd_nic->if_netdump->poll_locked(nd_nic, POLL_AND_CHECK_STATUS, 1000);
+	nd_nic->if_ndumpfuncs->poll_locked(nd_nic, POLL_AND_CHECK_STATUS, 1000);
 }
 
 /*-
@@ -1186,7 +1186,7 @@ netdump_trigger(void *arg, int howto)
 	dumping++;
 
 	if (panicstr == NULL)
-		nd_nic->if_netdump->acquire_lock(nd_nic);
+		nd_nic->if_ndumpfuncs->acquire_lock(nd_nic);
 
 	/* Make the card use *our* receive callback */
 	old_if_input = nd_nic->if_input;
@@ -1244,7 +1244,7 @@ trig_abort:
 	if (old_if_input)
 		nd_nic->if_input = old_if_input;
 	if (panicstr == NULL)
-		nd_nic->if_netdump->release_lock(nd_nic);
+		nd_nic->if_ndumpfuncs->release_lock(nd_nic);
 	dumping--;
 }
 


More information about the svn-src-projects mailing list