Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl_pf_main.c
Show First 20 Lines • Show All 1,025 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
ixl_config_rss(struct ixl_pf *pf) | ixl_config_rss(struct ixl_pf *pf) | ||||
{ | { | ||||
ixl_set_rss_key(pf); | ixl_set_rss_key(pf); | ||||
ixl_set_rss_pctypes(pf); | ixl_set_rss_pctypes(pf); | ||||
ixl_set_rss_hlut(pf); | ixl_set_rss_hlut(pf); | ||||
} | } | ||||
int | |||||
ixl_get_udp_port_idx(struct ixl_pf *pf, u16 port) | |||||
{ | |||||
u8 i; | |||||
for (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; ++i) { | |||||
/* Do not report ports with pending deletions as | |||||
* being available. | |||||
*/ | |||||
if (!port && (pf->pending_udp_bitmap & BIT_ULL(i))) | |||||
continue; | |||||
if (pf->udp_ports[i].is_marked_for_deletion == TRUE) | |||||
continue; | |||||
if (pf->udp_ports[i].port == port) | |||||
return i; | |||||
} | |||||
return -1; | |||||
} | |||||
void | |||||
ixl_sync_udp_filters(struct ixl_pf *pf, bool all) | |||||
{ | |||||
struct ixl_udp_port_config *udp_port; | |||||
struct i40e_hw *hw = &pf->hw; | |||||
enum i40e_status_code status; | |||||
bool is_marked_for_deletion; | |||||
u8 i, filter_index; | |||||
u16 port; | |||||
for (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; ++i) { | |||||
if (all || pf->pending_udp_bitmap & BIT_ULL(i)) { | |||||
status = I40E_SUCCESS; | |||||
udp_port = &pf->udp_ports[i]; | |||||
pf->pending_udp_bitmap &= ~BIT_ULL(i); | |||||
port = udp_port->port; | |||||
is_marked_for_deletion = udp_port->is_marked_for_deletion; | |||||
filter_index = udp_port->filter_index; | |||||
if (!is_marked_for_deletion && port > 0) { | |||||
status = i40e_aq_add_udp_tunnel(hw, port, | |||||
I40E_AQC_TUNNEL_TYPE_VXLAN, &filter_index, NULL); | |||||
} else if (filter_index != IXL_UDP_PORT_INDEX_UNUSED) | |||||
status = i40e_aq_del_udp_tunnel(hw, filter_index, NULL); | |||||
if (status) { | |||||
device_printf(pf->dev, | |||||
"VXLAN %s port %d, index %d failed, err %s aq_err %s\n", | |||||
is_marked_for_deletion ? "delete" : "add", | |||||
port, filter_index, i40e_stat_str(&pf->hw, status), | |||||
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); | |||||
if (is_marked_for_deletion == FALSE) { | |||||
/* failed to add, just reset port, | |||||
* drop pending bit for any deletion | |||||
*/ | |||||
udp_port->port = 0; | |||||
pf->pending_udp_bitmap &= ~BIT_ULL(i); | |||||
} | |||||
} else { | |||||
if (is_marked_for_deletion == FALSE) { | |||||
/* record filter index on success */ | |||||
udp_port->filter_index = filter_index; | |||||
} | |||||
/* clear the deletion flag */ | |||||
udp_port->is_marked_for_deletion = FALSE; | |||||
} | |||||
} | |||||
} | |||||
atomic_clear_32(&pf->state, IXL_PF_STATE_UDP_FILTER_SYNC_PENDING); | |||||
} | |||||
/* | /* | ||||
* In some firmware versions there is default MAC/VLAN filter | * In some firmware versions there is default MAC/VLAN filter | ||||
* configured which interferes with filters managed by driver. | * configured which interferes with filters managed by driver. | ||||
* Make sure it's removed. | * Make sure it's removed. | ||||
*/ | */ | ||||
void | void | ||||
ixl_del_default_hw_filters(struct ixl_vsi *vsi) | ixl_del_default_hw_filters(struct ixl_vsi *vsi) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 3,654 Lines • Show Last 20 Lines |