Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/if_iavf.c
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
| static void iavf_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); | static void iavf_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); | ||||
| static int iavf_if_media_change(if_ctx_t ctx); | static int iavf_if_media_change(if_ctx_t ctx); | ||||
| static int iavf_if_promisc_set(if_ctx_t ctx, int flags); | static int iavf_if_promisc_set(if_ctx_t ctx, int flags); | ||||
| static void iavf_if_timer(if_ctx_t ctx, uint16_t qid); | static void iavf_if_timer(if_ctx_t ctx, uint16_t qid); | ||||
| static void iavf_if_vlan_register(if_ctx_t ctx, u16 vtag); | static void iavf_if_vlan_register(if_ctx_t ctx, u16 vtag); | ||||
| static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); | ||||
| static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); | static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); | ||||
| static void iavf_if_stop(if_ctx_t ctx); | static void iavf_if_stop(if_ctx_t ctx); | ||||
| static bool iavf_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); | |||||
| static int iavf_allocate_pci_resources(struct iavf_sc *); | static int iavf_allocate_pci_resources(struct iavf_sc *); | ||||
| static int iavf_reset_complete(struct i40e_hw *); | static int iavf_reset_complete(struct i40e_hw *); | ||||
| static int iavf_setup_vc(struct iavf_sc *); | static int iavf_setup_vc(struct iavf_sc *); | ||||
| static int iavf_reset(struct iavf_sc *); | static int iavf_reset(struct iavf_sc *); | ||||
| static int iavf_vf_config(struct iavf_sc *); | static int iavf_vf_config(struct iavf_sc *); | ||||
| static void iavf_init_filters(struct iavf_sc *); | static void iavf_init_filters(struct iavf_sc *); | ||||
| static void iavf_free_pci_resources(struct iavf_sc *); | static void iavf_free_pci_resources(struct iavf_sc *); | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | static device_method_t iavf_if_methods[] = { | ||||
| DEVMETHOD(ifdi_mtu_set, iavf_if_mtu_set), | DEVMETHOD(ifdi_mtu_set, iavf_if_mtu_set), | ||||
| DEVMETHOD(ifdi_media_status, iavf_if_media_status), | DEVMETHOD(ifdi_media_status, iavf_if_media_status), | ||||
| DEVMETHOD(ifdi_media_change, iavf_if_media_change), | DEVMETHOD(ifdi_media_change, iavf_if_media_change), | ||||
| DEVMETHOD(ifdi_promisc_set, iavf_if_promisc_set), | DEVMETHOD(ifdi_promisc_set, iavf_if_promisc_set), | ||||
| DEVMETHOD(ifdi_timer, iavf_if_timer), | DEVMETHOD(ifdi_timer, iavf_if_timer), | ||||
| DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), | DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), | ||||
| DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), | DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), | ||||
| DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), | DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), | ||||
| DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), | |||||
| DEVMETHOD_END | DEVMETHOD_END | ||||
| }; | }; | ||||
| static driver_t iavf_if_driver = { | static driver_t iavf_if_driver = { | ||||
| "iavf_if", iavf_if_methods, sizeof(struct iavf_sc) | "iavf_if", iavf_if_methods, sizeof(struct iavf_sc) | ||||
| }; | }; | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 1,261 Lines • ▼ Show 20 Lines | case IFCOUNTER_OQDROPS: | ||||
| return (vsi->oqdrops); | return (vsi->oqdrops); | ||||
| case IFCOUNTER_NOPROTO: | case IFCOUNTER_NOPROTO: | ||||
| return (vsi->noproto); | return (vsi->noproto); | ||||
| default: | default: | ||||
| return (if_get_counter_default(ifp, cnt)); | return (if_get_counter_default(ifp, cnt)); | ||||
| } | } | ||||
| } | } | ||||
| /* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized | |||||
| * @ctx: iflib context | |||||
| * @event: event code to check | |||||
| * | |||||
| * Defaults to returning true for every event. | |||||
| * | |||||
| * @returns true if iflib needs to reinit the interface | |||||
| */ | |||||
| static bool | |||||
| iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) | |||||
| { | |||||
| switch (event) { | |||||
| case IFLIB_RESTART_VLAN_CONFIG: | |||||
| /* This case must return true if VLAN anti-spoof checks are | |||||
| * enabled by the PF driver for the VF. | |||||
| */ | |||||
| default: | |||||
| return (true); | |||||
| } | |||||
| } | |||||
| static void | static void | ||||
| iavf_free_pci_resources(struct iavf_sc *sc) | iavf_free_pci_resources(struct iavf_sc *sc) | ||||
| { | { | ||||
| struct ixl_vsi *vsi = &sc->vsi; | struct ixl_vsi *vsi = &sc->vsi; | ||||
| struct ixl_rx_queue *rx_que = vsi->rx_queues; | struct ixl_rx_queue *rx_que = vsi->rx_queues; | ||||
| device_t dev = sc->dev; | device_t dev = sc->dev; | ||||
| /* We may get here before stations are set up */ | /* We may get here before stations are set up */ | ||||
| ▲ Show 20 Lines • Show All 954 Lines • Show Last 20 Lines | |||||