From owner-svn-src-projects@FreeBSD.ORG Tue Sep 7 17:51:24 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 529E810656CA; Tue, 7 Sep 2010 17:51:24 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27D0B8FC0C; Tue, 7 Sep 2010 17:51:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o87HpOM2011120; Tue, 7 Sep 2010 17:51:24 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o87HpOJk011117; Tue, 7 Sep 2010 17:51:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009071751.o87HpOJk011117@svn.freebsd.org> From: Attilio Rao Date: Tue, 7 Sep 2010 17:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212298 - in projects/sv/sys: net netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2010 17:51:24 -0000 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 /* 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--; }