mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 10:11:52 -04:00
cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
cxgb4_alloc_raw_mac_filt() and cxgb4_free_raw_mac_filt() have been
unused since they were added in 2019 commit
5fab51581f ("cxgb4: Add MPS TCAM refcounting for raw mac filters")
Remove them.
This was also the last use of cxgb4_mps_ref_dec().
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/20241013203831.88051-3-linux@treblig.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
65950f275f
commit
b4701c6359
@@ -2141,22 +2141,6 @@ int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid,
|
||||
unsigned int naddr, const u8 **addr, bool sleep_ok);
|
||||
int cxgb4_init_mps_ref_entries(struct adapter *adap);
|
||||
void cxgb4_free_mps_ref_entries(struct adapter *adap);
|
||||
int cxgb4_free_raw_mac_filt(struct adapter *adap,
|
||||
unsigned int viid,
|
||||
const u8 *addr,
|
||||
const u8 *mask,
|
||||
unsigned int idx,
|
||||
u8 lookup_type,
|
||||
u8 port_id,
|
||||
bool sleep_ok);
|
||||
int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
|
||||
unsigned int viid,
|
||||
const u8 *addr,
|
||||
const u8 *mask,
|
||||
unsigned int idx,
|
||||
u8 lookup_type,
|
||||
u8 port_id,
|
||||
bool sleep_ok);
|
||||
int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
|
||||
int *tcam_idx, const u8 *addr,
|
||||
bool persistent, u8 *smt_idx);
|
||||
|
||||
@@ -28,28 +28,6 @@ static int cxgb4_mps_ref_dec_by_mac(struct adapter *adap,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cxgb4_mps_ref_dec(struct adapter *adap, u16 idx)
|
||||
{
|
||||
struct mps_entries_ref *mps_entry, *tmp;
|
||||
int ret = -EINVAL;
|
||||
|
||||
spin_lock(&adap->mps_ref_lock);
|
||||
list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) {
|
||||
if (mps_entry->idx == idx) {
|
||||
if (!refcount_dec_and_test(&mps_entry->refcnt)) {
|
||||
spin_unlock(&adap->mps_ref_lock);
|
||||
return -EBUSY;
|
||||
}
|
||||
list_del(&mps_entry->list);
|
||||
kfree(mps_entry);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock(&adap->mps_ref_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cxgb4_mps_ref_inc(struct adapter *adap, const u8 *mac_addr,
|
||||
u16 idx, const u8 *mask)
|
||||
{
|
||||
@@ -141,52 +119,6 @@ int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cxgb4_free_raw_mac_filt(struct adapter *adap,
|
||||
unsigned int viid,
|
||||
const u8 *addr,
|
||||
const u8 *mask,
|
||||
unsigned int idx,
|
||||
u8 lookup_type,
|
||||
u8 port_id,
|
||||
bool sleep_ok)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!cxgb4_mps_ref_dec(adap, idx))
|
||||
ret = t4_free_raw_mac_filt(adap, viid, addr,
|
||||
mask, idx, lookup_type,
|
||||
port_id, sleep_ok);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
|
||||
unsigned int viid,
|
||||
const u8 *addr,
|
||||
const u8 *mask,
|
||||
unsigned int idx,
|
||||
u8 lookup_type,
|
||||
u8 port_id,
|
||||
bool sleep_ok)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = t4_alloc_raw_mac_filt(adap, viid, addr,
|
||||
mask, idx, lookup_type,
|
||||
port_id, sleep_ok);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) {
|
||||
ret = -ENOMEM;
|
||||
t4_free_raw_mac_filt(adap, viid, addr,
|
||||
mask, idx, lookup_type,
|
||||
port_id, sleep_ok);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cxgb4_init_mps_ref_entries(struct adapter *adap)
|
||||
{
|
||||
spin_lock_init(&adap->mps_ref_lock);
|
||||
|
||||
Reference in New Issue
Block a user