Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_flow.c
/* SPDX-License-Identifier: BSD-3-Clause */ | /* SPDX-License-Identifier: BSD-3-Clause */ | ||||
/* Copyright (c) 2022, Intel Corporation | /* Copyright (c) 2023, Intel Corporation | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions are met: | * modification, are permitted provided that the following conditions are met: | ||||
* | * | ||||
* 1. Redistributions of source code must retain the above copyright notice, | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* this list of conditions and the following disclaimer. | * this list of conditions and the following disclaimer. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,352 Lines • ▼ Show 20 Lines | |||||
* the VSI from that profile. If the flow profile has no VSIs it will | * the VSI from that profile. If the flow profile has no VSIs it will | ||||
* be removed. | * be removed. | ||||
*/ | */ | ||||
enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) | enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) | ||||
{ | { | ||||
const enum ice_block blk = ICE_BLK_RSS; | const enum ice_block blk = ICE_BLK_RSS; | ||||
struct ice_flow_prof *p, *t; | struct ice_flow_prof *p, *t; | ||||
enum ice_status status = ICE_SUCCESS; | enum ice_status status = ICE_SUCCESS; | ||||
u16 vsig; | |||||
if (!ice_is_vsi_valid(hw, vsi_handle)) | if (!ice_is_vsi_valid(hw, vsi_handle)) | ||||
return ICE_ERR_PARAM; | return ICE_ERR_PARAM; | ||||
if (LIST_EMPTY(&hw->fl_profs[blk])) | if (LIST_EMPTY(&hw->fl_profs[blk])) | ||||
return ICE_SUCCESS; | return ICE_SUCCESS; | ||||
ice_acquire_lock(&hw->rss_locks); | ice_acquire_lock(&hw->rss_locks); | ||||
LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof, | LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof, | ||||
l_entry) | l_entry) { | ||||
int ret; | |||||
/* check if vsig is already removed */ | |||||
ret = ice_vsig_find_vsi(hw, blk, | |||||
ice_get_hw_vsi_num(hw, vsi_handle), | |||||
&vsig); | |||||
if (!ret && !vsig) | |||||
break; | |||||
if (ice_is_bit_set(p->vsis, vsi_handle)) { | if (ice_is_bit_set(p->vsis, vsi_handle)) { | ||||
status = ice_flow_disassoc_prof(hw, blk, p, vsi_handle); | status = ice_flow_disassoc_prof(hw, blk, p, vsi_handle); | ||||
if (status) | if (status) | ||||
break; | break; | ||||
if (!ice_is_any_bit_set(p->vsis, ICE_MAX_VSI)) { | if (!ice_is_any_bit_set(p->vsis, ICE_MAX_VSI)) { | ||||
status = ice_flow_rem_prof(hw, blk, p->id); | status = ice_flow_rem_prof(hw, blk, p->id); | ||||
if (status) | if (status) | ||||
break; | break; | ||||
} | |||||
} | } | ||||
} | } | ||||
ice_release_lock(&hw->rss_locks); | ice_release_lock(&hw->rss_locks); | ||||
return status; | return status; | ||||
} | } | ||||
/** | /** | ||||
* ice_get_rss_hdr_type - get a RSS profile's header type | * ice_get_rss_hdr_type - get a RSS profile's header type | ||||
* @prof: RSS flow profile | * @prof: RSS flow profile | ||||
▲ Show 20 Lines • Show All 549 Lines • Show Last 20 Lines |