diff -r 616b57c32406 sys/dev/cxgbe/t4_main.c --- a/sys/dev/cxgbe/t4_main.c Tue May 02 09:34:55 2017 -0700 +++ b/sys/dev/cxgbe/t4_main.c Fri May 05 18:01:09 2017 -0700 @@ -520,6 +520,7 @@ static int sysctl_holdoff_tmr_idx(SYSCTL static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); +static int sysctl_blink_led(SYSCTL_HANDLER_ARGS); static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS); static int sysctl_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); @@ -5390,6 +5391,10 @@ vi_sysctls(struct vi_info *vi) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_txq", CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_qsize_txq, "I", "tx queue size"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "blink_led", + CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_blink_led, "I", + "Blink the LED for this VI"); } static void @@ -5843,6 +5848,32 @@ sysctl_qsize_txq(SYSCTL_HANDLER_ARGS) } static int +sysctl_blink_led(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct adapter *sc = vi->pi->adapter; + int n, rc; + + n = 0; + rc = sysctl_handle_int(oidp, &n, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (n < 0) + return (EINVAL); + + rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4led"); + if (rc) + return (rc); + + t4_identify_port(sc, sc->mbox, vi->viid, n); + + end_synchronized_op(sc, LOCK_HELD); + return (rc); +} + +static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1;