Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bnxt/bnxt_hwrm.c
Show First 20 Lines • Show All 971 Lines • ▼ Show 20 Lines | else { | ||||
req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); | req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); | ||||
req.async_event_cr = softc->def_cp_ring.ring.phys_id; | req.async_event_cr = softc->def_cp_ring.ring.phys_id; | ||||
rc = hwrm_send_message(softc, &req, sizeof(req)); | rc = hwrm_send_message(softc, &req, sizeof(req)); | ||||
} | } | ||||
return rc; | return rc; | ||||
} | } | ||||
void | |||||
bnxt_validate_hw_lro_settings(struct bnxt_softc *softc) | |||||
{ | |||||
softc->hw_lro.enable = min(softc->hw_lro.enable, 1); | |||||
softc->hw_lro.is_mode_gro = min(softc->hw_lro.is_mode_gro, 1); | |||||
softc->hw_lro.max_agg_segs = min(softc->hw_lro.max_agg_segs, | |||||
HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX); | |||||
softc->hw_lro.max_aggs = min(softc->hw_lro.max_aggs, | |||||
HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX); | |||||
softc->hw_lro.min_agg_len = min(softc->hw_lro.min_agg_len, BNXT_MAX_MTU); | |||||
} | |||||
int | int | ||||
bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, | bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc) | ||||
uint32_t flags) | |||||
{ | { | ||||
struct hwrm_vnic_tpa_cfg_input req = {0}; | struct hwrm_vnic_tpa_cfg_input req = {0}; | ||||
uint32_t flags; | |||||
bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG); | bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG); | ||||
if (softc->hw_lro.enable) { | |||||
flags = HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA | | |||||
HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA | | |||||
HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN | | |||||
HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ; | |||||
if (softc->hw_lro.is_mode_gro) | |||||
flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO; | |||||
else | |||||
flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE; | |||||
req.flags = htole32(flags); | req.flags = htole32(flags); | ||||
req.vnic_id = htole16(vnic->id); | |||||
req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS | | req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS | | ||||
HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS | | HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS | | ||||
/* HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER | */ | |||||
HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN); | HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN); | ||||
/* TODO: Calculate this based on ring size? */ | |||||
req.max_agg_segs = htole16(3); | req.max_agg_segs = htole16(softc->hw_lro.max_agg_segs); | ||||
/* Base this in the allocated TPA start size... */ | req.max_aggs = htole16(softc->hw_lro.max_aggs); | ||||
req.max_aggs = htole16(7); | req.min_agg_len = htole32(softc->hw_lro.min_agg_len); | ||||
/* | } | ||||
* TODO: max_agg_timer? | |||||
* req.mag_agg_timer = htole32(XXX); | req.vnic_id = htole16(softc->vnic_info.id); | ||||
*/ | |||||
req.min_agg_len = htole32(0); | |||||
return hwrm_send_message(softc, &req, sizeof(req)); | return hwrm_send_message(softc, &req, sizeof(req)); | ||||
} | } | ||||
int | int | ||||
bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, | bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, | ||||
uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index, | uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index, | ||||
uint8_t search_opt, uint32_t *data_length, uint32_t *item_length, | uint8_t search_opt, uint32_t *data_length, uint32_t *item_length, | ||||
▲ Show 20 Lines • Show All 725 Lines • Show Last 20 Lines |