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()
214 * ice_fltr_add_mac_to_list - add MAC filter info to exsisting list
226 info.flag = ICE_FLTR_TX; in ice_fltr_add_mac_to_list()
230 info.vsi_handle = vsi->idx; 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
250 info.flag = ICE_FLTR_TX; in ice_fltr_add_vlan_to_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
268 * @flag: filter direction, Tx or Rx
273 u16 ethertype, u16 flag, in ice_fltr_add_eth_to_list() argument
278 info.flag = flag; in ice_fltr_add_eth_to_list()
281 info.vsi_handle = vsi->idx; in ice_fltr_add_eth_to_list()
284 if (flag == ICE_FLTR_TX) 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
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
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
372 * @flag: direction of packet, Tx or Rx
377 ice_fltr_prepare_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_prepare_eth() argument
384 if (ice_fltr_add_eth_to_list(vsi, &tmp_list, ethertype, flag, action)) in ice_fltr_prepare_eth()
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
405 * ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
419 * ice_fltr_remove_mac - remove MAC filter
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
454 * @flag: direction of packet to be filtered, Tx or Rx
457 int ice_fltr_add_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_add_eth() argument
460 return ice_fltr_prepare_eth(vsi, ethertype, flag, action, in ice_fltr_add_eth()
465 * ice_fltr_remove_eth - remove ethertype filter
468 * @flag: direction of filter
471 int ice_fltr_remove_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag, in ice_fltr_remove_eth() argument
474 return ice_fltr_prepare_eth(vsi, ethertype, flag, action, in ice_fltr_remove_eth()