Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/liquidio/lio_main.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | |||||
| static void lio_watchdog(void *param); | static void lio_watchdog(void *param); | ||||
| static int lio_load_firmware(struct octeon_device *oct); | static int lio_load_firmware(struct octeon_device *oct); | ||||
| static int lio_nic_starter(struct octeon_device *oct); | static int lio_nic_starter(struct octeon_device *oct); | ||||
| static int lio_init_nic_module(struct octeon_device *oct); | static int lio_init_nic_module(struct octeon_device *oct); | ||||
| static int lio_setup_nic_devices(struct octeon_device *octeon_dev); | static int lio_setup_nic_devices(struct octeon_device *octeon_dev); | ||||
| static int lio_link_info(struct lio_recv_info *recv_info, void *ptr); | static int lio_link_info(struct lio_recv_info *recv_info, void *ptr); | ||||
| static void lio_if_cfg_callback(struct octeon_device *oct, uint32_t status, | static void lio_if_cfg_callback(struct octeon_device *oct, uint32_t status, | ||||
| void *buf); | void *buf); | ||||
| static int lio_set_rxcsum_command(struct ifnet *ifp, int command, | static int lio_set_rxcsum_command(if_t ifp, int command, | ||||
| uint8_t rx_cmd); | uint8_t rx_cmd); | ||||
| static int lio_setup_glists(struct octeon_device *oct, struct lio *lio, | static int lio_setup_glists(struct octeon_device *oct, struct lio *lio, | ||||
| int num_iqs); | int num_iqs); | ||||
| static void lio_destroy_nic_device(struct octeon_device *oct, int ifidx); | static void lio_destroy_nic_device(struct octeon_device *oct, int ifidx); | ||||
| static inline void lio_update_link_status(struct ifnet *ifp, | static inline void lio_update_link_status(if_t ifp, | ||||
| union octeon_link_status *ls); | union octeon_link_status *ls); | ||||
| static void lio_send_rx_ctrl_cmd(struct lio *lio, int start_stop); | static void lio_send_rx_ctrl_cmd(struct lio *lio, int start_stop); | ||||
| static int lio_stop_nic_module(struct octeon_device *oct); | static int lio_stop_nic_module(struct octeon_device *oct); | ||||
| static void lio_destroy_resources(struct octeon_device *oct); | static void lio_destroy_resources(struct octeon_device *oct); | ||||
| static int lio_setup_rx_oom_poll_fn(struct ifnet *ifp); | static int lio_setup_rx_oom_poll_fn(if_t ifp); | ||||
| static void lio_vlan_rx_add_vid(void *arg, struct ifnet *ifp, uint16_t vid); | static void lio_vlan_rx_add_vid(void *arg, if_t ifp, uint16_t vid); | ||||
| static void lio_vlan_rx_kill_vid(void *arg, struct ifnet *ifp, | static void lio_vlan_rx_kill_vid(void *arg, if_t ifp, | ||||
| uint16_t vid); | uint16_t vid); | ||||
| static struct octeon_device * | static struct octeon_device * | ||||
| lio_get_other_octeon_device(struct octeon_device *oct); | lio_get_other_octeon_device(struct octeon_device *oct); | ||||
| static int lio_wait_for_oq_pkts(struct octeon_device *oct); | static int lio_wait_for_oq_pkts(struct octeon_device *oct); | ||||
| int lio_send_rss_param(struct lio *lio); | int lio_send_rss_param(struct lio *lio); | ||||
| static int lio_dbg_console_print(struct octeon_device *oct, | static int lio_dbg_console_print(struct octeon_device *oct, | ||||
| ▲ Show 20 Lines • Show All 830 Lines • ▼ Show 20 Lines | |||||
| lio_init_failure: | lio_init_failure: | ||||
| oct->ifcount = 0; | oct->ifcount = 0; | ||||
| return (retval); | return (retval); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_ifmedia_update(struct ifnet *ifp) | lio_ifmedia_update(if_t ifp) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct ifmedia *ifm; | struct ifmedia *ifm; | ||||
| ifm = &lio->ifmedia; | ifm = &lio->ifmedia; | ||||
| /* We only support Ethernet media type. */ | /* We only support Ethernet media type. */ | ||||
| if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) | if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | lio_get_baudrate(struct octeon_device *oct) | ||||
| case LIO_CN2360_25G_SUBDEVICE: | case LIO_CN2360_25G_SUBDEVICE: | ||||
| return (IF_Gbps(25)); | return (IF_Gbps(25)); | ||||
| } | } | ||||
| return (IF_Gbps(10)); | return (IF_Gbps(10)); | ||||
| } | } | ||||
| static void | static void | ||||
| lio_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr) | lio_ifmedia_status(if_t ifp, struct ifmediareq *ifmr) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| /* Report link down if the driver isn't running. */ | /* Report link down if the driver isn't running. */ | ||||
| if (!lio_ifstate_check(lio, LIO_IFSTATE_RUNNING)) { | if (!lio_ifstate_check(lio, LIO_IFSTATE_RUNNING)) { | ||||
| ifmr->ifm_active |= IFM_NONE; | ifmr->ifm_active |= IFM_NONE; | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | lio_get_counter(if_t ifp, ift_counter cnt) | ||||
| return (counter); | return (counter); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_init_ifnet(struct lio *lio) | lio_init_ifnet(struct lio *lio) | ||||
| { | { | ||||
| struct octeon_device *oct = lio->oct_dev; | struct octeon_device *oct = lio->oct_dev; | ||||
| if_t ifp = lio->ifp; | if_t ifp = lio->ifp; | ||||
| /* ifconfig entrypoint for media type/status reporting */ | /* ifconfig entrypoint for media type/status reporting */ | ||||
| ifmedia_init(&lio->ifmedia, IFM_IMASK, lio_ifmedia_update, | ifmedia_init(&lio->ifmedia, IFM_IMASK, lio_ifmedia_update, | ||||
| lio_ifmedia_status); | lio_ifmedia_status); | ||||
| /* set the default interface values */ | /* set the default interface values */ | ||||
| ifmedia_add(&lio->ifmedia, | ifmedia_add(&lio->ifmedia, | ||||
| (IFM_ETHER | IFM_FDX | lio_get_media_subtype(oct)), | (IFM_ETHER | IFM_FDX | lio_get_media_subtype(oct)), | ||||
| Show All 26 Lines | lio_init_ifnet(struct lio *lio) | ||||
| if_setcapenable(ifp, if_getcapabilities(ifp)); | if_setcapenable(ifp, if_getcapabilities(ifp)); | ||||
| if_setbaudrate(ifp, lio_get_baudrate(oct)); | if_setbaudrate(ifp, lio_get_baudrate(oct)); | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static void | static void | ||||
| lio_tcp_lro_free(struct octeon_device *octeon_dev, struct ifnet *ifp) | lio_tcp_lro_free(struct octeon_device *octeon_dev, if_t ifp) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct lio_droq *droq; | struct lio_droq *droq; | ||||
| int q_no; | int q_no; | ||||
| int i; | int i; | ||||
| for (i = 0; i < octeon_dev->num_oqs; i++) { | for (i = 0; i < octeon_dev->num_oqs; i++) { | ||||
| q_no = lio->linfo.rxpciq[i].s.q_no; | q_no = lio->linfo.rxpciq[i].s.q_no; | ||||
| droq = octeon_dev->droq[q_no]; | droq = octeon_dev->droq[q_no]; | ||||
| if (droq->lro.ifp) { | if (droq->lro.ifp) { | ||||
| tcp_lro_free(&droq->lro); | tcp_lro_free(&droq->lro); | ||||
| droq->lro.ifp = NULL; | droq->lro.ifp = NULL; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static int | static int | ||||
| lio_tcp_lro_init(struct octeon_device *octeon_dev, struct ifnet *ifp) | lio_tcp_lro_init(struct octeon_device *octeon_dev, if_t ifp) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| struct lio_droq *droq; | struct lio_droq *droq; | ||||
| struct lro_ctrl *lro; | struct lro_ctrl *lro; | ||||
| int i, q_no, ret = 0; | int i, q_no, ret = 0; | ||||
| for (i = 0; i < octeon_dev->num_oqs; i++) { | for (i = 0; i < octeon_dev->num_oqs; i++) { | ||||
| q_no = lio->linfo.rxpciq[i].s.q_no; | q_no = lio->linfo.rxpciq[i].s.q_no; | ||||
| Show All 17 Lines | lro_init_failed: | ||||
| return (ret); | return (ret); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_setup_nic_devices(struct octeon_device *octeon_dev) | lio_setup_nic_devices(struct octeon_device *octeon_dev) | ||||
| { | { | ||||
| union octeon_if_cfg if_cfg; | union octeon_if_cfg if_cfg; | ||||
| struct lio *lio = NULL; | struct lio *lio = NULL; | ||||
| struct ifnet *ifp = NULL; | if_t ifp = NULL; | ||||
| struct lio_version *vdata; | struct lio_version *vdata; | ||||
| struct lio_soft_command *sc; | struct lio_soft_command *sc; | ||||
| struct lio_if_cfg_context *ctx; | struct lio_if_cfg_context *ctx; | ||||
| struct lio_if_cfg_resp *resp; | struct lio_if_cfg_resp *resp; | ||||
| struct lio_if_props *props; | struct lio_if_props *props; | ||||
| int num_iqueues, num_oqueues, retval; | int num_iqueues, num_oqueues, retval; | ||||
| unsigned int base_queue; | unsigned int base_queue; | ||||
| unsigned int gmx_port_id; | unsigned int gmx_port_id; | ||||
| ▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | for (i = 0; i < octeon_dev->ifcount; i++) { | ||||
| if (lio == NULL) { | if (lio == NULL) { | ||||
| lio_dev_err(octeon_dev, "Lio allocation failed\n"); | lio_dev_err(octeon_dev, "Lio allocation failed\n"); | ||||
| goto setup_nic_dev_fail; | goto setup_nic_dev_fail; | ||||
| } | } | ||||
| if_setsoftc(ifp, lio); | if_setsoftc(ifp, lio); | ||||
| ifp->if_hw_tsomax = LIO_MAX_FRAME_SIZE; | if_sethwtsomax(ifp, LIO_MAX_FRAME_SIZE); | ||||
| ifp->if_hw_tsomaxsegcount = LIO_MAX_SG; | if_sethwtsomaxsegcount(ifp, LIO_MAX_SG); | ||||
| ifp->if_hw_tsomaxsegsize = PAGE_SIZE; | if_sethwtsomaxsegsize(ifp, PAGE_SIZE); | ||||
| lio->ifidx = ifidx_or_pfnum; | lio->ifidx = ifidx_or_pfnum; | ||||
| props = &octeon_dev->props; | props = &octeon_dev->props; | ||||
| props->gmxport = resp->cfg_info.linfo.gmxport; | props->gmxport = resp->cfg_info.linfo.gmxport; | ||||
| props->ifp = ifp; | props->ifp = ifp; | ||||
| lio->linfo.num_rxpciq = num_oqueues; | lio->linfo.num_rxpciq = num_oqueues; | ||||
| ▲ Show 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | return ((new[0] != old[0]) || (new[1] != old[1]) || | ||||
| (new[2] != old[2]) || (new[3] != old[3]) || | (new[2] != old[2]) || (new[3] != old[3]) || | ||||
| (new[4] != old[4]) || (new[5] != old[5])); | (new[4] != old[4]) || (new[5] != old[5])); | ||||
| } | } | ||||
| void | void | ||||
| lio_open(void *arg) | lio_open(void *arg) | ||||
| { | { | ||||
| struct lio *lio = arg; | struct lio *lio = arg; | ||||
| struct ifnet *ifp = lio->ifp; | if_t ifp = lio->ifp; | ||||
| struct octeon_device *oct = lio->oct_dev; | struct octeon_device *oct = lio->oct_dev; | ||||
| uint8_t *mac_new, mac_old[ETHER_HDR_LEN]; | uint8_t *mac_new, mac_old[ETHER_HDR_LEN]; | ||||
| int ret = 0; | int ret = 0; | ||||
| lio_ifstate_set(lio, LIO_IFSTATE_RUNNING); | lio_ifstate_set(lio, LIO_IFSTATE_RUNNING); | ||||
| /* Ready for link status updates */ | /* Ready for link status updates */ | ||||
| lio->intf_open = 1; | lio->intf_open = 1; | ||||
| lio_dev_info(oct, "Interface Open, ready for traffic\n"); | lio_dev_info(oct, "Interface Open, ready for traffic\n"); | ||||
| /* tell Octeon to start forwarding packets to host */ | /* tell Octeon to start forwarding packets to host */ | ||||
| lio_send_rx_ctrl_cmd(lio, 1); | lio_send_rx_ctrl_cmd(lio, 1); | ||||
| mac_new = IF_LLADDR(ifp); | mac_new = if_getlladdr(ifp); | ||||
| memcpy(mac_old, ((uint8_t *)&lio->linfo.hw_addr) + 2, ETHER_HDR_LEN); | memcpy(mac_old, ((uint8_t *)&lio->linfo.hw_addr) + 2, ETHER_HDR_LEN); | ||||
| if (lio_is_mac_changed(mac_new, mac_old)) { | if (lio_is_mac_changed(mac_new, mac_old)) { | ||||
| ret = lio_set_mac(ifp, mac_new); | ret = lio_set_mac(ifp, mac_new); | ||||
| if (ret) | if (ret) | ||||
| lio_dev_err(oct, "MAC change failed, error: %d\n", ret); | lio_dev_err(oct, "MAC change failed, error: %d\n", ret); | ||||
| } | } | ||||
| /* Now inform the stack we're ready */ | /* Now inform the stack we're ready */ | ||||
| if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); | if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); | ||||
| lio_dev_info(oct, "Interface is opened\n"); | lio_dev_info(oct, "Interface is opened\n"); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_set_rxcsum_command(struct ifnet *ifp, int command, uint8_t rx_cmd) | lio_set_rxcsum_command(if_t ifp, int command, uint8_t rx_cmd) | ||||
| { | { | ||||
| 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; | ||||
| nctrl.ncmd.cmd64 = 0; | nctrl.ncmd.cmd64 = 0; | ||||
| nctrl.ncmd.s.cmd = command; | nctrl.ncmd.s.cmd = command; | ||||
| ▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | if (j != lio->tx_qsize) { | ||||
| return (1); | return (1); | ||||
| } | } | ||||
| } | } | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| void | void | ||||
| lio_stop(struct ifnet *ifp) | lio_stop(if_t ifp) | ||||
| { | { | ||||
| 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; | ||||
| lio_ifstate_reset(lio, LIO_IFSTATE_RUNNING); | lio_ifstate_reset(lio, LIO_IFSTATE_RUNNING); | ||||
| if_link_state_change(ifp, LINK_STATE_DOWN); | if_link_state_change(ifp, LINK_STATE_DOWN); | ||||
| lio->intf_open = 0; | lio->intf_open = 0; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | lio_poll_check_rx_oom_status(void *arg, int pending __unused) | ||||
| if (lio_ifstate_check(lio, LIO_IFSTATE_RUNNING)) | if (lio_ifstate_check(lio, LIO_IFSTATE_RUNNING)) | ||||
| lio_check_rx_oom_status(lio); | lio_check_rx_oom_status(lio); | ||||
| taskqueue_enqueue_timeout(rx_status_tq->tq, &rx_status_tq->work, | taskqueue_enqueue_timeout(rx_status_tq->tq, &rx_status_tq->work, | ||||
| lio_ms_to_ticks(50)); | lio_ms_to_ticks(50)); | ||||
| } | } | ||||
| static int | static int | ||||
| lio_setup_rx_oom_poll_fn(struct ifnet *ifp) | lio_setup_rx_oom_poll_fn(if_t ifp) | ||||
| { | { | ||||
| 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; | ||||
| struct lio_tq *rx_status_tq; | struct lio_tq *rx_status_tq; | ||||
| rx_status_tq = &lio->rx_status_tq; | rx_status_tq = &lio->rx_status_tq; | ||||
| rx_status_tq->tq = taskqueue_create("lio_rx_oom_status", M_WAITOK, | rx_status_tq->tq = taskqueue_create("lio_rx_oom_status", M_WAITOK, | ||||
| Show All 15 Lines | lio_setup_rx_oom_poll_fn(if_t ifp) | ||||
| taskqueue_enqueue_timeout(rx_status_tq->tq, &rx_status_tq->work, | taskqueue_enqueue_timeout(rx_status_tq->tq, &rx_status_tq->work, | ||||
| lio_ms_to_ticks(50)); | lio_ms_to_ticks(50)); | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static void | static void | ||||
| lio_cleanup_rx_oom_poll_fn(struct ifnet *ifp) | lio_cleanup_rx_oom_poll_fn(if_t ifp) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| if (lio->rx_status_tq.tq != NULL) { | if (lio->rx_status_tq.tq != NULL) { | ||||
| while (taskqueue_cancel_timeout(lio->rx_status_tq.tq, | while (taskqueue_cancel_timeout(lio->rx_status_tq.tq, | ||||
| &lio->rx_status_tq.work, NULL)) | &lio->rx_status_tq.work, NULL)) | ||||
| taskqueue_drain_timeout(lio->rx_status_tq.tq, | taskqueue_drain_timeout(lio->rx_status_tq.tq, | ||||
| &lio->rx_status_tq.work); | &lio->rx_status_tq.work); | ||||
| taskqueue_free(lio->rx_status_tq.tq); | taskqueue_free(lio->rx_status_tq.tq); | ||||
| lio->rx_status_tq.tq = NULL; | lio->rx_status_tq.tq = NULL; | ||||
| } | } | ||||
| } | } | ||||
| static void | static void | ||||
| lio_destroy_nic_device(struct octeon_device *oct, int ifidx) | lio_destroy_nic_device(struct octeon_device *oct, int ifidx) | ||||
| { | { | ||||
| struct ifnet *ifp = oct->props.ifp; | if_t ifp = oct->props.ifp; | ||||
| struct lio *lio; | struct lio *lio; | ||||
| if (ifp == NULL) { | if (ifp == NULL) { | ||||
| lio_dev_err(oct, "%s No ifp ptr for index %d\n", | lio_dev_err(oct, "%s No ifp ptr for index %d\n", | ||||
| __func__, ifidx); | __func__, ifidx); | ||||
| return; | return; | ||||
| } | } | ||||
| Show All 32 Lines | lio_destroy_nic_device(struct octeon_device *oct, int ifidx) | ||||
| if_free(ifp); | if_free(ifp); | ||||
| oct->props.gmxport = -1; | oct->props.gmxport = -1; | ||||
| oct->props.ifp = NULL; | oct->props.ifp = NULL; | ||||
| } | } | ||||
| static void | static void | ||||
| print_link_info(struct ifnet *ifp) | print_link_info(if_t ifp) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| if (!lio_ifstate_check(lio, LIO_IFSTATE_RESETTING) && | if (!lio_ifstate_check(lio, LIO_IFSTATE_RESETTING) && | ||||
| lio_ifstate_check(lio, LIO_IFSTATE_REGISTERED)) { | lio_ifstate_check(lio, LIO_IFSTATE_REGISTERED)) { | ||||
| struct octeon_link_info *linfo = &lio->linfo; | struct octeon_link_info *linfo = &lio->linfo; | ||||
| if (linfo->link.s.link_up) { | if (linfo->link.s.link_up) { | ||||
| lio_dev_info(lio->oct_dev, "%d Mbps %s Duplex UP\n", | lio_dev_info(lio->oct_dev, "%d Mbps %s Duplex UP\n", | ||||
| linfo->link.s.speed, | linfo->link.s.speed, | ||||
| (linfo->link.s.duplex) ? "Full" : "Half"); | (linfo->link.s.duplex) ? "Full" : "Half"); | ||||
| } else { | } else { | ||||
| lio_dev_info(lio->oct_dev, "Link Down\n"); | lio_dev_info(lio->oct_dev, "Link Down\n"); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static inline void | static inline void | ||||
| lio_update_link_status(struct ifnet *ifp, union octeon_link_status *ls) | lio_update_link_status(if_t ifp, union octeon_link_status *ls) | ||||
| { | { | ||||
| struct lio *lio = if_getsoftc(ifp); | struct lio *lio = if_getsoftc(ifp); | ||||
| int changed = (lio->linfo.link.link_status64 != ls->link_status64); | int changed = (lio->linfo.link.link_status64 != ls->link_status64); | ||||
| lio->linfo.link.link_status64 = ls->link_status64; | lio->linfo.link.link_status64 = ls->link_status64; | ||||
| if ((lio->intf_open) && (changed)) { | if ((lio->intf_open) && (changed)) { | ||||
| print_link_info(ifp); | print_link_info(ifp); | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | if (retval == LIO_IQ_SEND_FAILED) { | ||||
| lio_sleep_cond(oct, &ctx->cond); | lio_sleep_cond(oct, &ctx->cond); | ||||
| oct->props.rx_on = start_stop; | oct->props.rx_on = start_stop; | ||||
| } | } | ||||
| lio_free_soft_command(oct, sc); | lio_free_soft_command(oct, sc); | ||||
| } | } | ||||
| static void | static void | ||||
| lio_vlan_rx_add_vid(void *arg, struct ifnet *ifp, uint16_t vid) | lio_vlan_rx_add_vid(void *arg, if_t ifp, uint16_t vid) | ||||
| { | { | ||||
| 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; | ||||
| if (if_getsoftc(ifp) != arg) /* Not our event */ | if (if_getsoftc(ifp) != arg) /* Not our event */ | ||||
| return; | return; | ||||
| Show All 14 Lines | lio_vlan_rx_add_vid(void *arg, if_t ifp, uint16_t vid) | ||||
| ret = lio_send_ctrl_pkt(lio->oct_dev, &nctrl); | ret = lio_send_ctrl_pkt(lio->oct_dev, &nctrl); | ||||
| if (ret < 0) { | if (ret < 0) { | ||||
| lio_dev_err(oct, "Add VLAN filter failed in core (ret: 0x%x)\n", | lio_dev_err(oct, "Add VLAN filter failed in core (ret: 0x%x)\n", | ||||
| ret); | ret); | ||||
| } | } | ||||
| } | } | ||||
| static void | static void | ||||
| lio_vlan_rx_kill_vid(void *arg, struct ifnet *ifp, uint16_t vid) | lio_vlan_rx_kill_vid(void *arg, if_t ifp, uint16_t vid) | ||||
| { | { | ||||
| 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; | ||||
| if (if_getsoftc(ifp) != arg) /* Not our event */ | if (if_getsoftc(ifp) != arg) /* Not our event */ | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines | |||||