Beispiel #1
0
int LL_PROC_PROTO(proc_console_backoff)
{
        int rc, backoff;
        cfs_sysctl_table_t dummy = *table;

        dummy.data = &backoff;
        dummy.proc_handler = &proc_dointvec;

        if (!write) { /* read */
                backoff= libcfs_console_backoff;
                rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos);
                return rc;
        }

        /* write */
        backoff = 0;
        rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos);
        if (rc < 0)
                return rc;
        if (backoff <= 0)
                return -EINVAL;

        libcfs_console_backoff = backoff;

        return rc;
}
Beispiel #2
0
int LL_PROC_PROTO(proc_console_min_delay_cs)
{
        int rc, min_delay_cs;
        cfs_sysctl_table_t dummy = *table;
        cfs_duration_t d;

        dummy.data = &min_delay_cs;
        dummy.proc_handler = &proc_dointvec;

        if (!write) { /* read */
                min_delay_cs = cfs_duration_sec(libcfs_console_min_delay * 100);
                rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos);
                return rc;
        }

        /* write */
        min_delay_cs = 0;
        rc = ll_proc_dointvec(&dummy, write, filp, buffer, lenp, ppos);
        if (rc < 0)
                return rc;
        if (min_delay_cs <= 0)
                return -EINVAL;

        d = cfs_time_seconds(min_delay_cs) / 100;
        if (d == 0 || d > libcfs_console_max_delay)
                return -EINVAL;
        libcfs_console_min_delay = d;

        return rc;
}
static int LL_PROC_PROTO(proc_hw_quiesce)
{
	int              rc = 0;
	kgn_device_t    *dev;
	ENTRY;

	rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
	if (!write) {
		/* read */
		RETURN(rc);
	}

	if (kgnilnd_data.kgn_init != GNILND_INIT_ALL) {
		rc = -EINVAL;
		RETURN(rc);
	}


	/* only device 0 gets the handle, see kgnilnd_dev_init */
	dev = &kgnilnd_data.kgn_devices[0];

	LASSERTF(dev != NULL, "dev 0 is NULL\n");

	kgnilnd_quiesce_end_callback(dev->gnd_handle,
				     kgnilnd_sysctl.ksd_quiesce_secs * MSEC_PER_SEC);

	RETURN(rc);
}
static int LL_PROC_PROTO(proc_toggle_thread_pause)
{
	int  old_val = kgnilnd_sysctl.ksd_pause_trigger;
	int  rc = 0;
	ENTRY;

	rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
	if (!write) {
		/* read */
		RETURN(rc);
	}

	if (kgnilnd_data.kgn_init != GNILND_INIT_ALL) {
		rc = -EINVAL;
		RETURN(rc);
	}

	if (old_val != kgnilnd_sysctl.ksd_pause_trigger) {
		down(&kgnilnd_data.kgn_quiesce_sem);
		CDEBUG(D_NET, "setting quiesce_trigger %d\n", old_val);
		kgnilnd_data.kgn_quiesce_trigger = kgnilnd_sysctl.ksd_pause_trigger;
		kgnilnd_quiesce_wait("admin sysctl");
		up(&kgnilnd_data.kgn_quiesce_sem);
	}

	RETURN(rc);
}
static int LL_PROC_PROTO(proc_toggle_rdmaq_override)
{
	int  old_val = kgnilnd_sysctl.ksd_rdmaq_override;
	int  rc = 0;
	ENTRY;

	rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
	if (!write) {
		/* read */
		RETURN(rc);
	}

	if (kgnilnd_data.kgn_init != GNILND_INIT_ALL) {
		rc = -EINVAL;
		RETURN(rc);
	}

	if (old_val != kgnilnd_sysctl.ksd_rdmaq_override) {
		long    new_mb = kgnilnd_sysctl.ksd_rdmaq_override * (long)(1024*1024);
		LCONSOLE_INFO("changing RDMAQ override to %d mbytes/sec\n",
			      kgnilnd_sysctl.ksd_rdmaq_override);
		/* override proc is mbytes, but we calc in bytes */
		kgnilnd_data.kgn_rdmaq_override = new_mb;
		smp_wmb();
	}

	RETURN(rc);
}
int LL_PROC_PROTO(proc_trigger_stack_reset)
{
	int              rc = 0;
	int                i = 1;
       kgn_device_t    *dev;
	ENTRY;

	if (!write) {
		/* read */
		rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
		RETURN(rc);
	}

	/* only device 0 gets the handle, see kgnilnd_dev_init */
	dev = &kgnilnd_data.kgn_devices[0];

	LASSERTF(dev != NULL, "dev 0 is NULL\n");

	kgnilnd_critical_error(dev->gnd_err_handle);

	/* Wait for the reset to complete.  This prevents any races in testing
	 * where we'd immediately try to send traffic again */
       while (kgnilnd_data.kgn_needs_reset != 0) {
	       i++;
	       LCONSOLE((((i) & (-i)) == i) ? D_WARNING : D_NET,
			       "Waiting for stack reset request to clear\n");
	       cfs_pause(cfs_time_seconds(1 * i));
       }

	RETURN(rc);
}
Beispiel #7
0
int LL_PROC_PROTO(proc_set_timeout)
{
	int rc;

	rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
	if (ldlm_timeout >= obd_timeout)
		ldlm_timeout = max(obd_timeout / 3, 1U);
	return rc;
}
Beispiel #8
0
int LL_PROC_PROTO(proc_at_history)
{
	return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
}
Beispiel #9
0
int LL_PROC_PROTO(proc_at_early_margin)
{
	return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
}