/**
* Initialize Hash Filters
*/
-int init_hash_filter(struct adapter *adap)
+int cxgbe_init_hash_filter(struct adapter *adap)
{
unsigned int n_user_filters;
unsigned int user_filter_perc;
* Validate if the requested filter specification can be set by checking
* if the requested features have been enabled
*/
-int validate_filter(struct adapter *adapter, struct ch_filter_specification *fs)
+int cxgbe_validate_filter(struct adapter *adapter,
+ struct ch_filter_specification *fs)
{
u32 fconf;
}
/* Return an error number if the indicated filter isn't writable ... */
-int writable_filter(struct filter_entry *f)
+static int writable_filter(struct filter_entry *f)
{
if (f->locked)
return -EPERM;
/**
* Check if entry already filled.
*/
-bool is_filter_set(struct tid_info *t, int fidx, int family)
+bool cxgbe_is_filter_set(struct tid_info *t, int fidx, int family)
{
bool result = FALSE;
int i, max;
int atid, size;
int ret = 0;
- ret = validate_filter(adapter, fs);
+ ret = cxgbe_validate_filter(adapter, fs);
if (ret)
return ret;
* Clear a filter and release any of its resources that we own. This also
* clears the filter's "pending" status.
*/
-void clear_filter(struct filter_entry *f)
+static void clear_filter(struct filter_entry *f)
{
if (f->clipt)
cxgbe_clip_release(f->dev, f->clipt);
return 0;
}
-int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
+static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
{
struct adapter *adapter = ethdev2adap(dev);
struct filter_entry *f = &adapter->tids.ftid_tab[fidx];
chip_ver = CHELSIO_CHIP_VERSION(adapter->params.chip);
- ret = is_filter_set(&adapter->tids, filter_id, fs->type);
+ ret = cxgbe_is_filter_set(&adapter->tids, filter_id, fs->type);
if (!ret) {
dev_warn(adap, "%s: could not find filter entry: %u\n",
__func__, filter_id);
chip_ver = CHELSIO_CHIP_VERSION(adapter->params.chip);
- ret = validate_filter(adapter, fs);
+ ret = cxgbe_validate_filter(adapter, fs);
if (ret)
return ret;
if (fs->type)
filter_id &= ~(0x3);
- ret = is_filter_set(&adapter->tids, filter_id, fs->type);
+ ret = cxgbe_is_filter_set(&adapter->tids, filter_id, fs->type);
if (ret)
return -EBUSY;
/**
* Handle a Hash filter write reply.
*/
-void hash_filter_rpl(struct adapter *adap, const struct cpl_act_open_rpl *rpl)
+void cxgbe_hash_filter_rpl(struct adapter *adap,
+ const struct cpl_act_open_rpl *rpl)
{
struct tid_info *t = &adap->tids;
struct filter_entry *f;
/**
* Handle a LE-TCAM filter write/deletion reply.
*/
-void filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl)
+void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl)
{
struct filter_entry *f = NULL;
unsigned int tid = GET_TID(rpl);
/**
* Handle a Hash filter delete reply.
*/
-void hash_del_filter_rpl(struct adapter *adap,
- const struct cpl_abort_rpl_rss *rpl)
+void cxgbe_hash_del_filter_rpl(struct adapter *adap,
+ const struct cpl_abort_rpl_rss *rpl)
{
struct tid_info *t = &adap->tids;
struct filter_entry *f;
return idx;
}
-bool is_filter_set(struct tid_info *, int fidx, int family);
-void filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl);
-void clear_filter(struct filter_entry *f);
-int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx);
-int writable_filter(struct filter_entry *f);
+bool cxgbe_is_filter_set(struct tid_info *, int fidx, int family);
+void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl);
int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
struct ch_filter_specification *fs,
struct filter_ctx *ctx);
struct ch_filter_specification *fs,
struct filter_ctx *ctx);
int cxgbe_alloc_ftid(struct adapter *adap, unsigned int family);
-int init_hash_filter(struct adapter *adap);
-void hash_filter_rpl(struct adapter *adap, const struct cpl_act_open_rpl *rpl);
-void hash_del_filter_rpl(struct adapter *adap,
- const struct cpl_abort_rpl_rss *rpl);
-int validate_filter(struct adapter *adap, struct ch_filter_specification *fs);
+int cxgbe_init_hash_filter(struct adapter *adap);
+void cxgbe_hash_filter_rpl(struct adapter *adap,
+ const struct cpl_act_open_rpl *rpl);
+void cxgbe_hash_del_filter_rpl(struct adapter *adap,
+ const struct cpl_abort_rpl_rss *rpl);
+int cxgbe_validate_filter(struct adapter *adap,
+ struct ch_filter_specification *fs);
int cxgbe_get_filter_count(struct adapter *adapter, unsigned int fidx,
u64 *c, int hash, bool get_byte);
int cxgbe_clear_filter_count(struct adapter *adapter, unsigned int fidx,
dev_err(adap, "invalid flow index %d.\n", fidx);
return -EINVAL;
}
- if (!is_filter_set(&adap->tids, fidx, fs.type)) {
+ if (!cxgbe_is_filter_set(&adap->tids, fidx, fs.type)) {
dev_err(adap, "Already free fidx:%d f:%p\n", fidx, f);
return -EINVAL;
}
cxgbe_validate_fidxonadd(struct ch_filter_specification *fs,
struct adapter *adap, unsigned int fidx)
{
- if (is_filter_set(&adap->tids, fidx, fs->type)) {
+ if (cxgbe_is_filter_set(&adap->tids, fidx, fs->type)) {
dev_err(adap, "filter index: %d is busy.\n", fidx);
return -EBUSY;
}
return ret;
}
- if (validate_filter(adap, &flow->fs)) {
+ if (cxgbe_validate_filter(adap, &flow->fs)) {
t4_os_free(flow);
return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE,
NULL,
} else if (opcode == CPL_ABORT_RPL_RSS) {
const struct cpl_abort_rpl_rss *p = (const void *)rsp;
- hash_del_filter_rpl(q->adapter, p);
+ cxgbe_hash_del_filter_rpl(q->adapter, p);
} else if (opcode == CPL_SET_TCB_RPL) {
const struct cpl_set_tcb_rpl *p = (const void *)rsp;
- filter_rpl(q->adapter, p);
+ cxgbe_filter_rpl(q->adapter, p);
} else if (opcode == CPL_ACT_OPEN_RPL) {
const struct cpl_act_open_rpl *p = (const void *)rsp;
- hash_filter_rpl(q->adapter, p);
+ cxgbe_hash_filter_rpl(q->adapter, p);
} else if (opcode == CPL_L2T_WRITE_RPL) {
const struct cpl_l2t_write_rpl *p = (const void *)rsp;
- do_l2t_write_rpl(q->adapter, p);
+ cxgbe_do_l2t_write_rpl(q->adapter, p);
} else {
dev_err(adapter, "unexpected CPL %#x on FW event queue\n",
opcode);
if ((caps_cmd.niccaps & cpu_to_be16(FW_CAPS_CONFIG_NIC_HASHFILTER)) &&
is_t6(adap->params.chip)) {
- if (init_hash_filter(adap) < 0)
+ if (cxgbe_init_hash_filter(adap) < 0)
goto bye;
}
* Process a CPL_L2T_WRITE_RPL. Note that the TID in the reply is really
* the L2T index it refers to.
*/
-void do_l2t_write_rpl(struct adapter *adap, const struct cpl_l2t_write_rpl *rpl)
+void cxgbe_do_l2t_write_rpl(struct adapter *adap,
+ const struct cpl_l2t_write_rpl *rpl)
{
struct l2t_data *d = adap->l2t;
unsigned int tid = GET_TID(rpl);
struct l2t_entry *cxgbe_l2t_alloc_switching(struct rte_eth_dev *dev, u16 vlan,
u8 port, u8 *dmac);
void cxgbe_l2t_release(struct l2t_entry *e);
-void do_l2t_write_rpl(struct adapter *p, const struct cpl_l2t_write_rpl *rpl);
+void cxgbe_do_l2t_write_rpl(struct adapter *p,
+ const struct cpl_l2t_write_rpl *rpl);
#endif /* _CXGBE_L2T_H_ */