Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bnxt/if_bnxt.c
Show First 20 Lines • Show All 820 Lines • ▼ Show 20 Lines | scctx->isc_ntxqsets_max = min(softc->fn_qcfg.alloc_tx_rings, | ||||
softc->fn_qcfg.alloc_completion_rings - scctx->isc_nrxqsets_max - 1); | softc->fn_qcfg.alloc_completion_rings - scctx->isc_nrxqsets_max - 1); | ||||
scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE; | scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE; | ||||
scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; | scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; | ||||
/* iflib will map and release this bar */ | /* iflib will map and release this bar */ | ||||
scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); | scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); | ||||
/* | |||||
* Default settings for HW LRO (TPA): | |||||
* Disable HW LRO by default | |||||
* Can be enabled after taking care of 'packet forwarding' | |||||
*/ | |||||
softc->hw_lro.enable = 0; | |||||
softc->hw_lro.is_mode_gro = 0; | |||||
softc->hw_lro.max_agg_segs = 5; /* 2^5 = 32 segs */ | |||||
softc->hw_lro.max_aggs = HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX; | |||||
softc->hw_lro.min_agg_len = 512; | |||||
/* Allocate the default completion ring */ | /* Allocate the default completion ring */ | ||||
softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; | softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; | ||||
softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; | softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; | ||||
softc->def_cp_ring.ring.softc = softc; | softc->def_cp_ring.ring.softc = softc; | ||||
softc->def_cp_ring.ring.id = 0; | softc->def_cp_ring.ring.id = 0; | ||||
softc->def_cp_ring.ring.doorbell = softc->def_cp_ring.ring.id * 0x80; | softc->def_cp_ring.ring.doorbell = softc->def_cp_ring.ring.id * 0x80; | ||||
softc->def_cp_ring.ring.ring_size = PAGE_SIZE / | softc->def_cp_ring.ring.ring_size = PAGE_SIZE / | ||||
sizeof(struct cmpl_base); | sizeof(struct cmpl_base); | ||||
Show All 19 Lines | softc->vnic_info.rss_hash_type = | ||||
HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 | | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 | | ||||
HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 | | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 | | ||||
HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 | | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 | | ||||
HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6; | HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6; | ||||
rc = bnxt_create_config_sysctls_pre(softc); | rc = bnxt_create_config_sysctls_pre(softc); | ||||
if (rc) | if (rc) | ||||
goto failed; | goto failed; | ||||
rc = bnxt_create_hw_lro_sysctls(softc); | |||||
if (rc) | |||||
goto failed; | |||||
/* Initialize the vlan list */ | /* Initialize the vlan list */ | ||||
SLIST_INIT(&softc->vnic_info.vlan_tags); | SLIST_INIT(&softc->vnic_info.vlan_tags); | ||||
softc->vnic_info.vlan_tag_list.idi_vaddr = NULL; | softc->vnic_info.vlan_tag_list.idi_vaddr = NULL; | ||||
return (rc); | return (rc); | ||||
failed: | failed: | ||||
bnxt_free_sysctl_ctx(softc); | bnxt_free_sysctl_ctx(softc); | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | if (++j == softc->nrxqsets) | ||||
j = 0; | j = 0; | ||||
} | } | ||||
rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, | rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, | ||||
softc->vnic_info.rss_hash_type); | softc->vnic_info.rss_hash_type); | ||||
if (rc) | if (rc) | ||||
goto fail; | goto fail; | ||||
/* | rc = bnxt_hwrm_vnic_tpa_cfg(softc); | ||||
* Enable LRO/TPA/GRO | |||||
* TBD: | |||||
* Enable / Disable HW_LRO based on | |||||
* ifconfig lro / ifconfig -lro setting | |||||
*/ | |||||
rc = bnxt_hwrm_vnic_tpa_cfg(softc, &softc->vnic_info, | |||||
(if_getcapenable(iflib_get_ifp(ctx)) & IFCAP_LRO) ? | |||||
HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA : 0); | |||||
if (rc) | if (rc) | ||||
goto fail; | goto fail; | ||||
for (i = 0; i < softc->ntxqsets; i++) { | for (i = 0; i < softc->ntxqsets; i++) { | ||||
/* Allocate the statistics context */ | /* Allocate the statistics context */ | ||||
rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->tx_cp_rings[i], | rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->tx_cp_rings[i], | ||||
softc->tx_stats.idi_paddr + | softc->tx_stats.idi_paddr + | ||||
(sizeof(struct ctx_hw_stats) * i)); | (sizeof(struct ctx_hw_stats) * i)); | ||||
▲ Show 20 Lines • Show All 1,559 Lines • Show Last 20 Lines |