svn commit: r255268 - in head/sys/dev/ntb: if_ntb ntb_hw
Carl Delsey
carl at FreeBSD.org
Thu Sep 5 22:46:50 UTC 2013
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_ */
More information about the svn-src-head
mailing list