Lines Matching +full:mac +full:- +full:s

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2018-2020, Intel Corporation. */
8 * ice_fltr_free_list - free filter lists helper
20 list_del(&e->list_entry); in ice_fltr_free_list()
26 * ice_fltr_add_entry_to_list - allocate and add filter entry to list
29 * @list: pointer to the list which contains MAC filters entry
39 return -ENOMEM; in ice_fltr_add_entry_to_list()
41 entry->fltr_info = *info; in ice_fltr_add_entry_to_list()
43 INIT_LIST_HEAD(&entry->list_entry); in ice_fltr_add_entry_to_list()
44 list_add(&entry->list_entry, list); in ice_fltr_add_entry_to_list()
55 * Set VSI with all associated VLANs to given promiscuous mode(s)
61 struct ice_pf *pf = hw->back; in ice_fltr_set_vlan_vsi_promisc()
64 result = ice_set_vlan_vsi_promisc(hw, vsi->idx, promisc_mask, false); in ice_fltr_set_vlan_vsi_promisc()
65 if (result && result != -EEXIST) in ice_fltr_set_vlan_vsi_promisc()
68 vsi->vsi_num, result); in ice_fltr_set_vlan_vsi_promisc()
79 * Clear VSI with all associated VLANs to given promiscuous mode(s)
85 struct ice_pf *pf = hw->back; in ice_fltr_clear_vlan_vsi_promisc()
88 result = ice_set_vlan_vsi_promisc(hw, vsi->idx, promisc_mask, true); in ice_fltr_clear_vlan_vsi_promisc()
89 if (result && result != -EEXIST) in ice_fltr_clear_vlan_vsi_promisc()
92 vsi->vsi_num, result); in ice_fltr_clear_vlan_vsi_promisc()
98 * ice_fltr_clear_vsi_promisc - clear specified promiscuous mode(s)
108 struct ice_pf *pf = hw->back; in ice_fltr_clear_vsi_promisc()
112 if (result && result != -EEXIST) in ice_fltr_clear_vsi_promisc()
121 * ice_fltr_set_vsi_promisc - set given VSI to given promiscuous mode(s)
131 struct ice_pf *pf = hw->back; in ice_fltr_set_vsi_promisc()
135 if (result && result != -EEXIST) in ice_fltr_set_vsi_promisc()
144 * ice_fltr_add_mac_list - add list of MAC filters
150 return ice_add_mac(&vsi->back->hw, list); in ice_fltr_add_mac_list()
154 * ice_fltr_remove_mac_list - remove list of MAC filters
160 return ice_remove_mac(&vsi->back->hw, list); in ice_fltr_remove_mac_list()
164 * ice_fltr_add_vlan_list - add list of VLAN filters
170 return ice_add_vlan(&vsi->back->hw, list); in ice_fltr_add_vlan_list()
174 * ice_fltr_remove_vlan_list - remove list of VLAN filters
181 return ice_remove_vlan(&vsi->back->hw, list); in ice_fltr_remove_vlan_list()
185 * ice_fltr_add_eth_list - add list of ethertype filters
191 return ice_add_eth_mac(&vsi->back->hw, list); in ice_fltr_add_eth_list()
195 * ice_fltr_remove_eth_list - remove list of ethertype filters
201 return ice_remove_eth_mac(&vsi->back->hw, list); in ice_fltr_remove_eth_list()
205 * ice_fltr_remove_all - remove all filters associated with VSI
210 ice_remove_vsi_fltr(&vsi->back->hw, vsi->idx); in ice_fltr_remove_all()
214 * ice_fltr_add_mac_to_list - add MAC filter info to exsisting list
217 * @mac: MAC address to add
222 const u8 *mac, enum ice_sw_fwd_act_type action) in ice_fltr_add_mac_to_list() argument
230 info.vsi_handle = vsi->idx; in ice_fltr_add_mac_to_list()
232 ether_addr_copy(info.l_data.mac.mac_addr, mac); in ice_fltr_add_mac_to_list()
234 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_mac_to_list()
239 * ice_fltr_add_vlan_to_list - add VLAN filter info to exsisting list
254 info.vsi_handle = vsi->idx; in ice_fltr_add_vlan_to_list()
255 info.l_data.vlan.vlan_id = vlan->vid; in ice_fltr_add_vlan_to_list()
256 info.l_data.vlan.tpid = vlan->tpid; in ice_fltr_add_vlan_to_list()
259 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_vlan_to_list()
264 * ice_fltr_add_eth_to_list - add ethertype filter info to exsisting list
281 info.vsi_handle = vsi->idx; in ice_fltr_add_eth_to_list()
289 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_eth_to_list()
294 * ice_fltr_prepare_mac - add or remove MAC rule
296 * @mac: MAC address to add
298 * @mac_action: pointer to add or remove MAC function
301 ice_fltr_prepare_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_prepare_mac() argument
308 if (ice_fltr_add_mac_to_list(vsi, &tmp_list, mac, action)) { in ice_fltr_prepare_mac()
309 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac()
310 return -ENOMEM; in ice_fltr_prepare_mac()
314 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac()
319 * ice_fltr_prepare_mac_and_broadcast - add or remove MAC and broadcast filter
321 * @mac: MAC address to add
323 * @mac_action: pointer to add or remove MAC function
326 ice_fltr_prepare_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_prepare_mac_and_broadcast() argument
336 if (ice_fltr_add_mac_to_list(vsi, &tmp_list, mac, action) || in ice_fltr_prepare_mac_and_broadcast()
338 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac_and_broadcast()
339 return -ENOMEM; in ice_fltr_prepare_mac_and_broadcast()
343 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac_and_broadcast()
348 * ice_fltr_prepare_vlan - add or remove VLAN filter
361 return -ENOMEM; in ice_fltr_prepare_vlan()
364 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_vlan()
369 * ice_fltr_prepare_eth - add or remove ethertype filter
385 return -ENOMEM; in ice_fltr_prepare_eth()
388 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_eth()
393 * ice_fltr_add_mac - add single MAC filter
395 * @mac: MAC to add
398 int ice_fltr_add_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_add_mac() argument
401 return ice_fltr_prepare_mac(vsi, mac, action, ice_fltr_add_mac_list); in ice_fltr_add_mac()
405 * ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
407 * @mac: MAC to add
411 ice_fltr_add_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_add_mac_and_broadcast() argument
414 return ice_fltr_prepare_mac_and_broadcast(vsi, mac, action, in ice_fltr_add_mac_and_broadcast()
419 * ice_fltr_remove_mac - remove MAC filter
421 * @mac: filter MAC to remove
424 int ice_fltr_remove_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_remove_mac() argument
427 return ice_fltr_prepare_mac(vsi, mac, action, ice_fltr_remove_mac_list); in ice_fltr_remove_mac()
431 * ice_fltr_add_vlan - add single VLAN filter
441 * ice_fltr_remove_vlan - remove VLAN filter
451 * ice_fltr_add_eth - add specyfic ethertype filter
465 * ice_fltr_remove_eth - remove ethertype filter