From owner-svn-src-head@FreeBSD.ORG Thu Sep 5 22:46:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AF0BFDC; Thu, 5 Sep 2013 22:46:50 +0000 (UTC) (envelope-from carl@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB94825B6; Thu, 5 Sep 2013 22:46:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r85Mkn5J068902; Thu, 5 Sep 2013 22:46:49 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r85MknRe068897; Thu, 5 Sep 2013 22:46:49 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201309052246.r85MknRe068897@svn.freebsd.org> From: Carl Delsey Date: Thu, 5 Sep 2013 22:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255268 - in head/sys/dev/ntb: if_ntb ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 22:46:50 -0000 Author: carl Date: Thu Sep 5 22:46:48 2013 New Revision: 255268 URL: http://svnweb.freebsd.org/changeset/base/255268 Log: Add some logging to ntb link up. Approved by: jimharris Sponsored by: Intel Modified: head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/ntb/ntb_hw/ntb_hw.c head/sys/dev/ntb/ntb_hw/ntb_hw.h Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Thu Sep 5 21:19:16 2013 (r255267) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Thu Sep 5 22:46:48 2013 (r255268) @@ -475,8 +475,11 @@ ntb_transport_init(struct ntb_softc *ntb if (rc != 0) goto err; - if (ntb_query_link_status(ntb)) + if (ntb_query_link_status(ntb)) { + if (bootverbose) + device_printf(ntb_get_device(ntb), "link up\n"); callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); + } return (0); @@ -673,6 +676,8 @@ ntb_transport_link_up(struct ntb_transpo return; qp->client_ready = NTB_LINK_UP; + if (bootverbose) + device_printf(ntb_get_device(qp->ntb), "qp client ready\n"); if (qp->transport->transport_link == NTB_LINK_UP) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); @@ -988,9 +993,13 @@ ntb_transport_event_callback(void *data, switch (event) { case NTB_EVENT_HW_LINK_UP: + if (bootverbose) + device_printf(ntb_get_device(nt->ntb), "HW link up\n"); callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); break; case NTB_EVENT_HW_LINK_DOWN: + if (bootverbose) + device_printf(ntb_get_device(nt->ntb), "HW link down\n"); ntb_transport_link_cleanup(nt); break; default: @@ -1071,6 +1080,8 @@ ntb_transport_link_work(void *arg) return; nt->transport_link = NTB_LINK_UP; + if (bootverbose) + device_printf(ntb_get_device(ntb), "transport link up\n"); for (i = 0; i < nt->max_qps; i++) { qp = &nt->qps[i]; @@ -1176,6 +1187,8 @@ ntb_qp_link_work(void *arg) qp->qp_link = NTB_LINK_UP; if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_UP); + if (bootverbose) + device_printf(ntb_get_device(ntb), "qp link up\n"); } else if (nt->transport_link == NTB_LINK_UP) { callout_reset(&qp->link_work, NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Sep 5 21:19:16 2013 (r255267) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Sep 5 22:46:48 2013 (r255268) @@ -1286,3 +1286,9 @@ is_bar_for_data_transfer(int bar_num) else return false; } + +device_t ntb_get_device(struct ntb_softc *ntb) +{ + + return (ntb->device); +} Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.h ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.h Thu Sep 5 21:19:16 2013 (r255267) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.h Thu Sep 5 22:46:48 2013 (r255268) @@ -69,5 +69,6 @@ u_long ntb_get_mw_size(struct ntb_softc void ntb_set_mw_addr(struct ntb_softc *ntb, unsigned int mw, uint64_t addr); void ntb_ring_sdb(struct ntb_softc *ntb, unsigned int db); bool ntb_query_link_status(struct ntb_softc *ntb); +device_t ntb_get_device(struct ntb_softc *ntb); #endif /* _NTB_HW_H_ */