Lines Matching +full:mac +full:- +full:mode
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()
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
222 * @mac: MAC address to add
227 const u8 *mac, enum ice_sw_fwd_act_type action) in ice_fltr_add_mac_to_list() argument
235 info.vsi_handle = vsi->idx; in ice_fltr_add_mac_to_list()
237 ether_addr_copy(info.l_data.mac.mac_addr, mac); 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
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
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
301 * @mac: MAC address to add
303 * @mac_action: pointer to add or remove MAC function
306 ice_fltr_prepare_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_prepare_mac() argument
313 if (ice_fltr_add_mac_to_list(vsi, &tmp_list, mac, action)) { in ice_fltr_prepare_mac()
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
326 * @mac: MAC address to add
328 * @mac_action: pointer to add or remove MAC function
331 ice_fltr_prepare_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_prepare_mac_and_broadcast() argument
341 if (ice_fltr_add_mac_to_list(vsi, &tmp_list, mac, action) || 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()
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
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
400 * @mac: MAC to add
403 int ice_fltr_add_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_add_mac() argument
406 return ice_fltr_prepare_mac(vsi, mac, action, ice_fltr_add_mac_list); in ice_fltr_add_mac()
410 * ice_fltr_add_mac_and_broadcast - add single MAC and broadcast
412 * @mac: MAC to add
416 ice_fltr_add_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_add_mac_and_broadcast() argument
419 return ice_fltr_prepare_mac_and_broadcast(vsi, mac, action, in ice_fltr_add_mac_and_broadcast()
424 * ice_fltr_remove_mac - remove MAC filter
426 * @mac: filter MAC to remove
429 int ice_fltr_remove_mac(struct ice_vsi *vsi, const u8 *mac, in ice_fltr_remove_mac() argument
432 return ice_fltr_prepare_mac(vsi, mac, action, ice_fltr_remove_mac_list); in ice_fltr_remove_mac()
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
470 * ice_fltr_remove_eth - remove ethertype filter