Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bnxt/bnxt_sysctl.c
Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | else | ||||
softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_VLAN_STRIP; | softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_VLAN_STRIP; | ||||
if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) | if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) | ||||
rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); | rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); | ||||
return rc; | return rc; | ||||
} | } | ||||
static int | |||||
bnxt_set_coal_rx_usecs(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->rx_coal_usecs; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->rx_coal_usecs = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_rx_frames(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->rx_coal_frames; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->rx_coal_frames = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_rx_usecs_irq(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->rx_coal_usecs_irq; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->rx_coal_usecs_irq = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_rx_frames_irq(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->rx_coal_frames_irq; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->rx_coal_frames_irq = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_tx_usecs(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->tx_coal_usecs; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->tx_coal_usecs = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_tx_frames(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->tx_coal_frames; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->tx_coal_frames = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_tx_usecs_irq(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->tx_coal_usecs_irq; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->tx_coal_usecs_irq = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
static int | |||||
bnxt_set_coal_tx_frames_irq(SYSCTL_HANDLER_ARGS) { | |||||
struct bnxt_softc *softc = arg1; | |||||
int rc; | |||||
int val; | |||||
if (softc == NULL) | |||||
return EBUSY; | |||||
val = softc->tx_coal_frames_irq; | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); | |||||
if (rc || !req->newptr) | |||||
return rc; | |||||
softc->tx_coal_frames_irq = val; | |||||
rc = bnxt_hwrm_set_coal(softc); | |||||
return rc; | |||||
} | |||||
int | int | ||||
bnxt_create_config_sysctls_pre(struct bnxt_softc *softc) | bnxt_create_config_sysctls_pre(struct bnxt_softc *softc) | ||||
{ | { | ||||
struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(softc->dev); | struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(softc->dev); | ||||
struct sysctl_oid_list *children; | struct sysctl_oid_list *children; | ||||
children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));; | children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));; | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_key", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_key", | ||||
CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_key_sysctl, "A", | CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_key_sysctl, "A", | ||||
"RSS key"); | "RSS key"); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_type", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_type", | ||||
CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_type_sysctl, "A", | CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_type_sysctl, "A", | ||||
"RSS type bits"); | "RSS type bits"); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_stall", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_stall", | ||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_rx_stall_sysctl, "I", | CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_rx_stall_sysctl, "I", | ||||
"buffer rx packets in hardware until the host posts new buffers"); | "buffer rx packets in hardware until the host posts new buffers"); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_strip", | SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_strip", | ||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_strip_sysctl, "I", | CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_strip_sysctl, "I", | ||||
"strip VLAN tag in the RX path"); | "strip VLAN tag in the RX path"); | ||||
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD, | SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD, | ||||
iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name"); | iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name"); | ||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs, | |||||
"I", "interrupt coalescing Rx Usecs"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames, | |||||
"I", "interrupt coalescing Rx Frames"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs_irq", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs_irq, | |||||
"I", "interrupt coalescing Rx Usecs IRQ"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames_irq", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames_irq, | |||||
"I", "interrupt coalescing Rx Frames IRQ"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs, | |||||
"I", "interrupt coalescing Tx Usces"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames, | |||||
"I", "interrupt coalescing Tx Frames"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs_irq", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs_irq, | |||||
"I", "interrupt coalescing Tx Usecs IRQ"); | |||||
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames_irq", | |||||
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames_irq, | |||||
"I", "interrupt coalescing Tx Frames IRQ"); | |||||
return 0; | return 0; | ||||
} | } | ||||
static int | static int | ||||
bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS) { | bnxt_vlan_only_sysctl(SYSCTL_HANDLER_ARGS) { | ||||
struct bnxt_softc *softc = arg1; | struct bnxt_softc *softc = arg1; | ||||
int rc; | int rc; | ||||
Show All 37 Lines |