From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 19:42:06 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB02209; Fri, 20 Feb 2015 19:42:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B870EDB0; Fri, 20 Feb 2015 19:42:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KJg6cd048074; Fri, 20 Feb 2015 19:42:06 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KJg6E9048073; Fri, 20 Feb 2015 19:42:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502201942.t1KJg6E9048073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 20 Feb 2015 19:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279078 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 19:42:06 -0000 Author: arybchik Date: Fri Feb 20 19:42:05 2015 New Revision: 279078 URL: https://svnweb.freebsd.org/changeset/base/279078 Log: sfxge: add assertions that required event handlers are implemented efx_ev_mcdi() does not assert or check that all event handlers it calls are non-null. Add assertions at the top for all required event handlers, as some events (in the case of this bug, monitor events) are rare. Submitted by: Ben Hutchings Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_ev.c Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 19:39:40 2015 (r279077) +++ head/sys/dev/sfxge/common/efx_ev.c Fri Feb 20 19:42:05 2015 (r279078) @@ -567,6 +567,12 @@ efx_ev_mcdi( if (enp->en_family != EFX_FAMILY_SIENA) goto out; + EFSYS_ASSERT(eecp->eec_link_change != NULL); + EFSYS_ASSERT(eecp->eec_exception != NULL); +#if EFSYS_OPT_MON_STATS + EFSYS_ASSERT(eecp->eec_monitor != NULL); +#endif + EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE); code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE);