git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/dpaa2: support Rx buffer size
[dpdk.git]
/
drivers
/
net
/
bnxt
/
bnxt_filter.c
diff --git
a/drivers/net/bnxt/bnxt_filter.c
b/drivers/net/bnxt/bnxt_filter.c
index
0c410f8
..
1d08e03
100644
(file)
--- a/
drivers/net/bnxt/bnxt_filter.c
+++ b/
drivers/net/bnxt/bnxt_filter.c
@@
-1,5
+1,5
@@
/* SPDX-License-Identifier: BSD-3-Clause
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2014-20
18
Broadcom
+ * Copyright(c) 2014-20
21
Broadcom
* All rights reserved.
*/
* All rights reserved.
*/
@@
-26,22
+26,20
@@
struct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp)
{
struct bnxt_filter_info *filter;
{
struct bnxt_filter_info *filter;
- /* Find the 1st unused filter from the free_filter_list pool*/
- filter = STAILQ_FIRST(&bp->free_filter_list);
+ filter = bnxt_get_unused_filter(bp);
if (!filter) {
PMD_DRV_LOG(ERR, "No more free filter resources\n");
return NULL;
}
if (!filter) {
PMD_DRV_LOG(ERR, "No more free filter resources\n");
return NULL;
}
- STAILQ_REMOVE_HEAD(&bp->free_filter_list, next);
filter->mac_index = INVALID_MAC_INDEX;
/* Default to L2 MAC Addr filter */
filter->flags = HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX;
filter->enables = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |
HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK;
filter->mac_index = INVALID_MAC_INDEX;
/* Default to L2 MAC Addr filter */
filter->flags = HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX;
filter->enables = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |
HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK;
- memcpy(filter->l2_addr, bp->eth_dev->data->mac_addrs->addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(filter->l2_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
memset(filter->l2_addr_mask, 0xff, RTE_ETHER_ADDR_LEN);
memset(filter->l2_addr_mask, 0xff, RTE_ETHER_ADDR_LEN);
+
return filter;
}
return filter;
}
@@
-57,7
+55,7
@@
struct bnxt_filter_info *bnxt_alloc_vf_filter(struct bnxt *bp, uint16_t vf)
}
filter->fw_l2_filter_id = UINT64_MAX;
}
filter->fw_l2_filter_id = UINT64_MAX;
- STAILQ_INSERT_TAIL(&bp->pf
.
vf_info[vf].filter, filter, next);
+ STAILQ_INSERT_TAIL(&bp->pf
->
vf_info[vf].filter, filter, next);
return filter;
}
return filter;
}
@@
-83,6
+81,15
@@
void bnxt_free_all_filters(struct bnxt *bp)
struct bnxt_filter_info *filter, *temp_filter;
unsigned int i;
struct bnxt_filter_info *filter, *temp_filter;
unsigned int i;
+ for (i = 0; i < bp->pf->max_vfs; i++) {
+ STAILQ_FOREACH(filter, &bp->pf->vf_info[i].filter, next) {
+ bnxt_hwrm_clear_l2_filter(bp, filter);
+ }
+ }
+
+ if (bp->vnic_info == NULL)
+ return;
+
for (i = 0; i < bp->nr_vnics; i++) {
vnic = &bp->vnic_info[i];
filter = STAILQ_FIRST(&vnic->filter);
for (i = 0; i < bp->nr_vnics; i++) {
vnic = &bp->vnic_info[i];
filter = STAILQ_FIRST(&vnic->filter);
@@
-97,11
+104,6
@@
void bnxt_free_all_filters(struct bnxt *bp)
STAILQ_INIT(&vnic->filter);
}
STAILQ_INIT(&vnic->filter);
}
- for (i = 0; i < bp->pf.max_vfs; i++) {
- STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) {
- bnxt_hwrm_clear_l2_filter(bp, filter);
- }
- }
}
void bnxt_free_filter_mem(struct bnxt *bp)
}
void bnxt_free_filter_mem(struct bnxt *bp)
@@
-146,10
+148,10
@@
void bnxt_free_filter_mem(struct bnxt *bp)
rte_free(bp->filter_info);
bp->filter_info = NULL;
rte_free(bp->filter_info);
bp->filter_info = NULL;
- for (i = 0; i < bp->pf
.
max_vfs; i++) {
- STAILQ_FOREACH(filter, &bp->pf
.
vf_info[i].filter, next) {
+ for (i = 0; i < bp->pf
->
max_vfs; i++) {
+ STAILQ_FOREACH(filter, &bp->pf
->
vf_info[i].filter, next) {
rte_free(filter);
rte_free(filter);
- STAILQ_REMOVE(&bp->pf
.
vf_info[i].filter, filter,
+ STAILQ_REMOVE(&bp->pf
->
vf_info[i].filter, filter,
bnxt_filter_info, next);
}
}
bnxt_filter_info, next);
}
}