Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/liquidio/lio_sysctl.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
| struct lio_intrmod_resp { | struct lio_intrmod_resp { | ||||
| uint64_t rh; | uint64_t rh; | ||||
| struct octeon_intrmod_cfg intrmod; | struct octeon_intrmod_cfg intrmod; | ||||
| uint64_t status; | uint64_t status; | ||||
| }; | }; | ||||
| static int | static int | ||||
| lio_send_queue_count_update(struct ifnet *ifp, uint32_t num_queues) | lio_send_queue_count_update(if_t ifp, uint32_t num_queues) | ||||
| { | { | ||||
| struct lio_ctrl_pkt nctrl; | struct lio_ctrl_pkt nctrl; | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct octeon_device *oct = lio->oct_dev; | struct octeon_device *oct = lio->oct_dev; | ||||
| int ret = 0; | int ret = 0; | ||||
| bzero(&nctrl, sizeof(struct lio_ctrl_pkt)); | bzero(&nctrl, sizeof(struct lio_ctrl_pkt)); | ||||
| ▲ Show 20 Lines • Show All 610 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Return register dump user app. */ | /* Return register dump user app. */ | ||||
| static int | static int | ||||
| lio_get_regs(SYSCTL_HANDLER_ARGS) | lio_get_regs(SYSCTL_HANDLER_ARGS) | ||||
| { | { | ||||
| struct lio *lio = (struct lio *)arg1; | struct lio *lio = (struct lio *)arg1; | ||||
| struct octeon_device *oct = lio->oct_dev; | struct octeon_device *oct = lio->oct_dev; | ||||
| struct ifnet *ifp = lio->ifp; | if_t ifp = lio->ifp; | ||||
| char *regbuf; | char *regbuf; | ||||
| int error = EINVAL, len = 0; | int error = EINVAL, len = 0; | ||||
| if (!(if_getflags(ifp) & IFF_DEBUG)) { | if (!(if_getflags(ifp) & IFF_DEBUG)) { | ||||
| char debug_info[30] = "Debugging is disabled"; | char debug_info[30] = "Debugging is disabled"; | ||||
| return (sysctl_handle_string(oidp, debug_info, | return (sysctl_handle_string(oidp, debug_info, | ||||
| strlen(debug_info), req)); | strlen(debug_info), req)); | ||||
| ▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | case LIO_SET_RING_TX: | ||||
| err = sysctl_handle_int(oidp, &tx_max_pending, 0, req); | err = sysctl_handle_int(oidp, &tx_max_pending, 0, req); | ||||
| break; | break; | ||||
| } | } | ||||
| return (err); | return (err); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_reset_queues(struct ifnet *ifp, uint32_t num_qs) | lio_reset_queues(if_t ifp, uint32_t num_qs) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct octeon_device *oct = lio->oct_dev; | struct octeon_device *oct = lio->oct_dev; | ||||
| int i, update = 0; | int i, update = 0; | ||||
| if (lio_wait_for_pending_requests(oct)) | if (lio_wait_for_pending_requests(oct)) | ||||
| lio_dev_err(oct, "There were pending requests\n"); | lio_dev_err(oct, "There were pending requests\n"); | ||||
| ▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | lio_set_channels(SYSCTL_HANDLER_ARGS) | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_get_set_fwmsglevel(SYSCTL_HANDLER_ARGS) | lio_get_set_fwmsglevel(SYSCTL_HANDLER_ARGS) | ||||
| { | { | ||||
| struct lio *lio = (struct lio *)arg1; | struct lio *lio = (struct lio *)arg1; | ||||
| struct ifnet *ifp = lio->ifp; | if_t ifp = lio->ifp; | ||||
| int err, new_msglvl = 0, old_msglvl = 0; | int err, new_msglvl = 0, old_msglvl = 0; | ||||
| if (lio_ifstate_check(lio, LIO_IFSTATE_RESETTING)) | if (lio_ifstate_check(lio, LIO_IFSTATE_RESETTING)) | ||||
| return (ENXIO); | return (ENXIO); | ||||
| old_msglvl = new_msglvl = lio->msg_enable; | old_msglvl = new_msglvl = lio->msg_enable; | ||||
| err = sysctl_handle_int(oidp, &new_msglvl, 0, req); | err = sysctl_handle_int(oidp, &new_msglvl, 0, req); | ||||
| Show All 40 Lines | |||||
| { | { | ||||
| struct lio_soft_command *sc = (struct lio_soft_command *)ptr; | struct lio_soft_command *sc = (struct lio_soft_command *)ptr; | ||||
| struct lio_fw_stats_resp *resp = | struct lio_fw_stats_resp *resp = | ||||
| (struct lio_fw_stats_resp *)sc->virtrptr; | (struct lio_fw_stats_resp *)sc->virtrptr; | ||||
| struct octeon_rx_stats *rsp_rstats = &resp->stats.fromwire; | struct octeon_rx_stats *rsp_rstats = &resp->stats.fromwire; | ||||
| struct octeon_tx_stats *rsp_tstats = &resp->stats.fromhost; | struct octeon_tx_stats *rsp_tstats = &resp->stats.fromhost; | ||||
| struct octeon_rx_stats *rstats = &oct_dev->link_stats.fromwire; | struct octeon_rx_stats *rstats = &oct_dev->link_stats.fromwire; | ||||
| struct octeon_tx_stats *tstats = &oct_dev->link_stats.fromhost; | struct octeon_tx_stats *tstats = &oct_dev->link_stats.fromhost; | ||||
| struct ifnet *ifp = oct_dev->props.ifp; | if_t ifp = oct_dev->props.ifp; | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| if ((status != LIO_REQUEST_TIMEOUT) && !resp->status) { | if ((status != LIO_REQUEST_TIMEOUT) && !resp->status) { | ||||
| lio_swap_8B_data((uint64_t *)&resp->stats, | lio_swap_8B_data((uint64_t *)&resp->stats, | ||||
| (sizeof(struct octeon_link_stats)) >> 3); | (sizeof(struct octeon_link_stats)) >> 3); | ||||
| /* RX link-level stats */ | /* RX link-level stats */ | ||||
| rstats->total_rcvd = rsp_rstats->total_rcvd; | rstats->total_rcvd = rsp_rstats->total_rcvd; | ||||
| ▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Callback function for intrmod */ | /* Callback function for intrmod */ | ||||
| static void | static void | ||||
| lio_get_intrmod_callback(struct octeon_device *oct_dev, uint32_t status, | lio_get_intrmod_callback(struct octeon_device *oct_dev, uint32_t status, | ||||
| void *ptr) | void *ptr) | ||||
| { | { | ||||
| struct lio_soft_command *sc = (struct lio_soft_command *)ptr; | struct lio_soft_command *sc = (struct lio_soft_command *)ptr; | ||||
| struct ifnet *ifp = oct_dev->props.ifp; | if_t ifp = oct_dev->props.ifp; | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct lio_intrmod_resp *resp; | struct lio_intrmod_resp *resp; | ||||
| if (status) { | if (status) { | ||||
| lio_dev_err(oct_dev, "Failed to get intrmod\n"); | lio_dev_err(oct_dev, "Failed to get intrmod\n"); | ||||
| } else { | } else { | ||||
| resp = (struct lio_intrmod_resp *)sc->virtrptr; | resp = (struct lio_intrmod_resp *)sc->virtrptr; | ||||
| lio_swap_8B_data((uint64_t *)&resp->intrmod, | lio_swap_8B_data((uint64_t *)&resp->intrmod, | ||||
| ▲ Show 20 Lines • Show All 516 Lines • Show Last 20 Lines | |||||