Lines Matching +full:mode +full:- +full:flag
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
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()
67 "Error setting promisc mode on VSI %i (rc=%d)\n", 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()
91 "Error clearing promisc mode on VSI %i (rc=%d)\n", 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)
100 * @vsi_handle: VSI handle to clear mode
108 struct ice_pf *pf = hw->back; in ice_fltr_clear_vsi_promisc()
112 if (result && result != -EEXIST) in ice_fltr_clear_vsi_promisc()
114 "Error clearing promisc mode on VSI %i for VID %u (rc=%d)\n", 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()
137 "Error setting promisc mode on VSI %i for VID %u (rc=%d)\n", 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()
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
231 info.flag = ICE_FLTR_TX; in ice_fltr_add_mac_to_list()
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
255 info.flag = ICE_FLTR_TX; in ice_fltr_add_vlan_to_list()
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
273 * @flag: filter direction, Tx or Rx
278 u16 ethertype, u16 flag, in ice_fltr_add_eth_to_list() argument
283 info.flag = flag; in ice_fltr_add_eth_to_list()
286 info.vsi_handle = vsi->idx; in ice_fltr_add_eth_to_list()
289 if (flag == ICE_FLTR_TX) 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
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
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
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
377 * @flag: direction of packet, Tx or Rx
382 ice_fltr_prepare_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_prepare_eth() argument
389 if (ice_fltr_add_eth_to_list(vsi, &tmp_list, ethertype, flag, action)) in ice_fltr_prepare_eth()
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
410 * ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
424 * ice_fltr_remove_mac - remove MAC filter
436 * ice_fltr_add_vlan - add single VLAN filter
446 * ice_fltr_remove_vlan - remove VLAN filter
456 * ice_fltr_add_eth - add specyfic ethertype filter
459 * @flag: direction of packet to be filtered, Tx or Rx
462 int ice_fltr_add_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_add_eth() argument
465 return ice_fltr_prepare_eth(vsi, ethertype, flag, action, in ice_fltr_add_eth()
470 * ice_fltr_remove_eth - remove ethertype filter
473 * @flag: direction of filter
476 int ice_fltr_remove_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_remove_eth() argument
479 return ice_fltr_prepare_eth(vsi, ethertype, flag, action, in ice_fltr_remove_eth()