Lines Matching +full:back +full:- +full:to +full:- +full:back
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2018-2020, Intel Corporation. */
8 * ice_fltr_free_list - free filter lists helper
9 * @dev: pointer to the device struct
10 * @h: pointer to the list head to be freed
12 * Helper function to free filter lists previously created using
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
27 * @dev: pointer to device needed by alloc function
28 * @info: filter info struct that gets added to the passed in 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()
51 * @hw: pointer to the hardware structure
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()
75 * @hw: pointer to the hardware structure
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)
99 * @hw: pointer to the hardware structure
100 * @vsi_handle: VSI handle to clear mode
101 * @promisc_mask: mask of promiscuous config bits to clear
102 * @vid: VLAN ID to clear VLAN promiscuous
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)
122 * @hw: pointer to the hardware structure
123 * @vsi_handle: VSI handle to configure
125 * @vid: VLAN ID to set VLAN promiscuous
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
145 * @vsi: pointer to VSI struct
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
155 * @vsi: pointer to VSI struct
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
165 * @vsi: pointer to VSI struct
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
175 * @vsi: pointer to VSI struct
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
186 * @vsi: pointer to VSI struct
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
196 * @vsi: pointer to VSI struct
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
206 * @vsi: pointer to VSI struct
210 ice_remove_vsi_fltr(&vsi->back->hw, vsi->idx); in ice_fltr_remove_all()
212 if (vsi->netdev) { in ice_fltr_remove_all()
213 __dev_uc_unsync(vsi->netdev, NULL); in ice_fltr_remove_all()
214 __dev_mc_unsync(vsi->netdev, NULL); in ice_fltr_remove_all()
219 * ice_fltr_add_mac_to_list - add MAC filter info to exsisting list
220 * @vsi: pointer to VSI struct
221 * @list: list to add filter info to
222 * @mac: MAC address to add
235 info.vsi_handle = vsi->idx; in ice_fltr_add_mac_to_list()
239 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_mac_to_list()
244 * ice_fltr_add_vlan_to_list - add VLAN filter info to exsisting list
245 * @vsi: pointer to VSI struct
246 * @list: list to add filter info to
259 info.vsi_handle = vsi->idx; in ice_fltr_add_vlan_to_list()
260 info.l_data.vlan.vlan_id = vlan->vid; in ice_fltr_add_vlan_to_list()
261 info.l_data.vlan.tpid = vlan->tpid; in ice_fltr_add_vlan_to_list()
264 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_vlan_to_list()
269 * ice_fltr_add_eth_to_list - add ethertype filter info to exsisting list
270 * @vsi: pointer to VSI struct
271 * @list: list to add filter info to
286 info.vsi_handle = vsi->idx; in ice_fltr_add_eth_to_list()
294 return ice_fltr_add_entry_to_list(ice_pf_to_dev(vsi->back), &info, in ice_fltr_add_eth_to_list()
299 * ice_fltr_prepare_mac - add or remove MAC rule
300 * @vsi: pointer to VSI struct
301 * @mac: MAC address to add
302 * @action: action to be performed on filter match
303 * @mac_action: pointer to add or remove MAC function
314 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac()
315 return -ENOMEM; in ice_fltr_prepare_mac()
319 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac()
324 * ice_fltr_prepare_mac_and_broadcast - add or remove MAC and broadcast filter
325 * @vsi: pointer to VSI struct
326 * @mac: MAC address to add
327 * @action: action to be performed on filter match
328 * @mac_action: pointer to add or remove MAC function
343 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac_and_broadcast()
344 return -ENOMEM; in ice_fltr_prepare_mac_and_broadcast()
348 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_mac_and_broadcast()
353 * ice_fltr_prepare_vlan - add or remove VLAN filter
354 * @vsi: pointer to VSI struct
356 * @vlan_action: pointer to add or remove VLAN function
366 return -ENOMEM; in ice_fltr_prepare_vlan()
369 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_vlan()
374 * ice_fltr_prepare_eth - add or remove ethertype filter
375 * @vsi: pointer to VSI struct
376 * @ethertype: ethertype of packet to be filtered
378 * @action: action to be performed on filter match
379 * @eth_action: pointer to add or remove ethertype function
390 return -ENOMEM; in ice_fltr_prepare_eth()
393 ice_fltr_free_list(ice_pf_to_dev(vsi->back), &tmp_list); in ice_fltr_prepare_eth()
398 * ice_fltr_add_mac - add single MAC filter
399 * @vsi: pointer to VSI struct
400 * @mac: MAC to add
401 * @action: action to be performed on filter match
410 * ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
411 * @vsi: pointer to VSI struct
412 * @mac: MAC to add
413 * @action: action to be performed on filter match
424 * ice_fltr_remove_mac - remove MAC filter
425 * @vsi: pointer to VSI struct
426 * @mac: filter MAC to remove
427 * @action: action to remove
436 * ice_fltr_add_vlan - add single VLAN filter
437 * @vsi: pointer to VSI struct
446 * ice_fltr_remove_vlan - remove VLAN filter
447 * @vsi: pointer to VSI struct
456 * ice_fltr_add_eth - add specyfic ethertype filter
457 * @vsi: pointer to VSI struct
459 * @flag: direction of packet to be filtered, Tx or Rx
460 * @action: action to be performed on filter match
470 * ice_fltr_remove_eth - remove ethertype filter
471 * @vsi: pointer to VSI struct
474 * @action: action to remove