mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
cxgb4: Add MPS TCAM refcounting for raw mac filters
This patch adds TCAM reference counting support for raw mac filters. Signed-off-by: Raju Rangoju <rajur@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
28b3870578
commit
5fab51581f
2 changed files with 62 additions and 0 deletions
|
@ -1919,5 +1919,21 @@ int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
|
||||||
u8 dip_hit, u8 lookup_type, bool sleep_ok);
|
u8 dip_hit, u8 lookup_type, bool sleep_ok);
|
||||||
int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
|
int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
|
||||||
int idx, bool sleep_ok);
|
int idx, bool sleep_ok);
|
||||||
|
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);
|
||||||
|
|
||||||
#endif /* __CXGB4_H__ */
|
#endif /* __CXGB4_H__ */
|
||||||
|
|
|
@ -54,6 +54,52 @@ unlock:
|
||||||
return ret;
|
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_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
|
int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
|
||||||
int idx, bool sleep_ok)
|
int idx, bool sleep_ok)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue