if (f->fs.mask.macidx)
cxgbe_mpstcam_remove(pi, f->fs.val.macidx);
+ if (f->smt)
+ cxgbe_smt_release(f->smt);
+
/* The zeroing of the filter rule below clears the filter valid,
* pending, locked flags etc. so it's all we need for
* this operation.
unsigned int port_id = ethdev2pinfo(dev)->port_id;
int ret;
- /* If the new filter requires Source MAC rewriting then we need to
- * allocate a SMT entry for the filter
- */
- if (f->fs.newsmac) {
- f->smt = cxgbe_smt_alloc_switching(f->dev, f->fs.smac);
- if (!f->smt) {
- if (f->l2t) {
- cxgbe_l2t_release(f->l2t);
- f->l2t = NULL;
- }
- return -ENOMEM;
- }
- }
-
ctrlq = &adapter->sge.ctrlq[port_id];
mbuf = rte_pktmbuf_alloc(ctrlq->mb_pool);
if (!mbuf) {
}
}
+ /* If the new filter requires Source MAC rewriting then we need to
+ * allocate a SMT entry for the filter
+ */
+ if (f->fs.newsmac) {
+ f->smt = cxgbe_smt_alloc_switching(f->dev, f->fs.smac);
+ if (!f->smt) {
+ ret = -ENOMEM;
+ goto free_tid;
+ }
+ }
+
iconf = adapter->params.tp.ingress_config;
/* Either PFVF or OVLAN can be active, but not both
return t4_smt_alloc_switching(dev, 0x0, smac);
}
+void cxgbe_smt_release(struct smt_entry *e)
+{
+ if (rte_atomic32_read(&e->refcnt))
+ rte_atomic32_dec(&e->refcnt);
+}
+
/**
* Initialize Source MAC Table
*/
void cxgbe_do_smt_write_rpl(struct adapter *adap,
const struct cpl_smt_write_rpl *rpl);
struct smt_entry *cxgbe_smt_alloc_switching(struct rte_eth_dev *dev, u8 *smac);
+void cxgbe_smt_release(struct smt_entry *e);
#endif /* __CXGBE_SMT_H_ */