Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/ixl_pf_main.c
Show First 20 Lines • Show All 1,117 Lines • ▼ Show 20 Lines | ixl_switch_config(struct ixl_pf *pf) | ||||
if (ret) { | if (ret) { | ||||
device_printf(dev, "aq_get_switch_config() failed, error %d," | device_printf(dev, "aq_get_switch_config() failed, error %d," | ||||
" aq_error %d\n", ret, pf->hw.aq.asq_last_status); | " aq_error %d\n", ret, pf->hw.aq.asq_last_status); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { | if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { | ||||
device_printf(dev, | device_printf(dev, | ||||
"Switch config: header reported: %d in structure, %d total\n", | "Switch config: header reported: %d in structure, %d total\n", | ||||
sw_config->header.num_reported, sw_config->header.num_total); | LE16_TO_CPU(sw_config->header.num_reported), | ||||
for (int i = 0; i < sw_config->header.num_reported; i++) { | LE16_TO_CPU(sw_config->header.num_total)); | ||||
for (int i = 0; | |||||
i < LE16_TO_CPU(sw_config->header.num_reported); i++) { | |||||
device_printf(dev, | device_printf(dev, | ||||
"-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, | "-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, | ||||
sw_config->element[i].element_type, | sw_config->element[i].element_type, | ||||
sw_config->element[i].seid, | LE16_TO_CPU(sw_config->element[i].seid), | ||||
sw_config->element[i].uplink_seid, | LE16_TO_CPU(sw_config->element[i].uplink_seid), | ||||
sw_config->element[i].downlink_seid); | LE16_TO_CPU(sw_config->element[i].downlink_seid)); | ||||
} | } | ||||
} | } | ||||
/* Simplified due to a single VSI */ | /* Simplified due to a single VSI */ | ||||
vsi->uplink_seid = sw_config->element[0].uplink_seid; | vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid); | ||||
vsi->downlink_seid = sw_config->element[0].downlink_seid; | vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid); | ||||
vsi->seid = sw_config->element[0].seid; | vsi->seid = LE16_TO_CPU(sw_config->element[0].seid); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* Initialize the VSI: this handles contexts, which means things | * Initialize the VSI: this handles contexts, which means things | ||||
* like the number of descriptors, buffer size, | * like the number of descriptors, buffer size, | ||||
* plus we init the rings thru this function. | * plus we init the rings thru this function. | ||||
▲ Show 20 Lines • Show All 905 Lines • ▼ Show 20 Lines | ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int cnt) | ||||
** the add bit. | ** the add bit. | ||||
*/ | */ | ||||
SLIST_FOREACH(f, &vsi->ftl, next) { | SLIST_FOREACH(f, &vsi->ftl, next) { | ||||
if ((f->flags & flags) == flags) { | if ((f->flags & flags) == flags) { | ||||
b = &a[j]; // a pox on fvl long names :) | b = &a[j]; // a pox on fvl long names :) | ||||
bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); | bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); | ||||
if (f->vlan == IXL_VLAN_ANY) { | if (f->vlan == IXL_VLAN_ANY) { | ||||
b->vlan_tag = 0; | b->vlan_tag = 0; | ||||
b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN; | b->flags = CPU_TO_LE16( | ||||
I40E_AQC_MACVLAN_ADD_IGNORE_VLAN); | |||||
} else { | } else { | ||||
b->vlan_tag = f->vlan; | b->vlan_tag = CPU_TO_LE16(f->vlan); | ||||
b->flags = 0; | b->flags = 0; | ||||
} | } | ||||
b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; | b->flags |= CPU_TO_LE16( | ||||
I40E_AQC_MACVLAN_ADD_PERFECT_MATCH); | |||||
f->flags &= ~IXL_FILTER_ADD; | f->flags &= ~IXL_FILTER_ADD; | ||||
j++; | j++; | ||||
ixl_dbg_filter(pf, "ADD: " MAC_FORMAT "\n", | ixl_dbg_filter(pf, "ADD: " MAC_FORMAT "\n", | ||||
MAC_FORMAT_ARGS(f->macaddr)); | MAC_FORMAT_ARGS(f->macaddr)); | ||||
} | } | ||||
if (j == cnt) | if (j == cnt) | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 3,027 Lines • Show Last 20 Lines |