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/ark: refactor Rx buffer recovery
[dpdk.git]
/
drivers
/
net
/
bnxt
/
bnxt_flow.c
diff --git
a/drivers/net/bnxt/bnxt_flow.c
b/drivers/net/bnxt/bnxt_flow.c
index
19bc66a
..
a8f5d91
100644
(file)
--- a/
drivers/net/bnxt/bnxt_flow.c
+++ b/
drivers/net/bnxt/bnxt_flow.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.
*/
@@
-554,7
+554,7
@@
bnxt_validate_and_parse_flow_type(struct bnxt *bp,
}
/* Check if VNI is masked. */
}
/* Check if VNI is masked. */
- if (vxlan_
spec && vxlan_mask
) {
+ if (vxlan_
mask != NULL
) {
vni_masked =
!!memcmp(vxlan_mask->vni, vni_mask,
RTE_DIM(vni_mask));
vni_masked =
!!memcmp(vxlan_mask->vni, vni_mask,
RTE_DIM(vni_mask));
@@
-1056,6
+1056,13
@@
start:
}
PMD_DRV_LOG(DEBUG, "Queue index %d\n", act_q->index);
}
PMD_DRV_LOG(DEBUG, "Queue index %d\n", act_q->index);
+ if (use_ntuple && !BNXT_RFS_NEEDS_VNIC(bp)) {
+ filter->flags =
+ HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX;
+ filter->dst_id = act_q->index;
+ goto skip_vnic_alloc;
+ }
+
vnic_id = attr->group;
if (!vnic_id) {
PMD_DRV_LOG(DEBUG, "Group id is 0\n");
vnic_id = attr->group;
if (!vnic_id) {
PMD_DRV_LOG(DEBUG, "Group id is 0\n");
@@
-1127,7
+1134,7
@@
use_vnic:
PMD_DRV_LOG(DEBUG,
"Setting vnic ff_idx %d\n", vnic->ff_pool_idx);
filter->dst_id = vnic->fw_vnic_id;
PMD_DRV_LOG(DEBUG,
"Setting vnic ff_idx %d\n", vnic->ff_pool_idx);
filter->dst_id = vnic->fw_vnic_id;
-
+skip_vnic_alloc:
/* For ntuple filter, create the L2 filter with default VNIC.
* The user specified redirect queue will be set while creating
* the ntuple filter in hardware.
/* For ntuple filter, create the L2 filter with default VNIC.
* The user specified redirect queue will be set while creating
* the ntuple filter in hardware.
@@
-1365,6
+1372,8
@@
use_vnic:
if (vnic->rx_queue_cnt > 1) {
vnic->hash_type =
bnxt_rte_to_hwrm_hash_types(rss->types);
if (vnic->rx_queue_cnt > 1) {
vnic->hash_type =
bnxt_rte_to_hwrm_hash_types(rss->types);
+ vnic->hash_mode =
+ bnxt_rte_to_hwrm_hash_level(bp, rss->types, rss->level);
if (!rss->key_len) {
/* If hash key has not been specified,
if (!rss->key_len) {
/* If hash key has not been specified,
@@
-1786,15
+1795,30
@@
bnxt_flow_create(struct rte_eth_dev *dev,
filter->enables |=
HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
ret = bnxt_hwrm_set_em_filter(bp, filter->dst_id, filter);
filter->enables |=
HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
ret = bnxt_hwrm_set_em_filter(bp, filter->dst_id, filter);
+ if (ret != 0) {
+ rte_flow_error_set(error, -ret,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Failed to create EM filter");
+ goto free_filter;
+ }
}
if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER) {
filter->enables |=
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
ret = bnxt_hwrm_set_ntuple_filter(bp, filter->dst_id, filter);
}
if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER) {
filter->enables |=
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID;
ret = bnxt_hwrm_set_ntuple_filter(bp, filter->dst_id, filter);
+ if (ret != 0) {
+ rte_flow_error_set(error, -ret,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "Failed to create ntuple filter");
+ goto free_filter;
+ }
}
}
- vnic = find_matching_vnic(bp, filter);
+ if (BNXT_RFS_NEEDS_VNIC(bp))
+ vnic = find_matching_vnic(bp, filter);
+ else
+ vnic = BNXT_GET_DEFAULT_VNIC(bp);
done:
if (!ret || update_flow) {
flow->filter = filter;
done:
if (!ret || update_flow) {
flow->filter = filter;
@@
-1804,9
+1828,6
@@
done:
goto free_flow;
}
goto free_flow;
}
- STAILQ_INSERT_TAIL(&vnic->filter, filter, next);
- PMD_DRV_LOG(DEBUG, "Successfully created flow.\n");
- STAILQ_INSERT_TAIL(&vnic->flow_list, flow, next);
if (filter->valid_flags & BNXT_FLOW_MARK_FLAG) {
PMD_DRV_LOG(DEBUG,
"Mark action: mark id 0x%x, flow id 0x%x\n",
if (filter->valid_flags & BNXT_FLOW_MARK_FLAG) {
PMD_DRV_LOG(DEBUG,
"Mark action: mark id 0x%x, flow id 0x%x\n",
@@
-1817,19
+1838,25
@@
done:
*/
flow_id = filter->flow_id & BNXT_FLOW_ID_MASK;
if (bp->mark_table[flow_id].valid) {
*/
flow_id = filter->flow_id & BNXT_FLOW_ID_MASK;
if (bp->mark_table[flow_id].valid) {
- PMD_DRV_LOG(ERR,
- "Entry for Mark id 0x%x occupied"
- " flow id 0x%x\n",
- filter->mark, filter->flow_id);
+ rte_flow_error_set(error, EEXIST,
+ RTE_FLOW_ERROR_TYPE_HANDLE,
+ NULL,
+ "Flow with mark id exists");
+ bnxt_clear_one_vnic_filter(bp, filter);
goto free_filter;
}
bp->mark_table[flow_id].valid = true;
bp->mark_table[flow_id].mark_id = filter->mark;
}
goto free_filter;
}
bp->mark_table[flow_id].valid = true;
bp->mark_table[flow_id].mark_id = filter->mark;
}
+
+ STAILQ_INSERT_TAIL(&vnic->filter, filter, next);
+ STAILQ_INSERT_TAIL(&vnic->flow_list, flow, next);
+
if (BNXT_FLOW_XSTATS_EN(bp))
bp->flow_stat->flow_count++;
bnxt_release_flow_lock(bp);
bnxt_setup_flow_counter(bp);
if (BNXT_FLOW_XSTATS_EN(bp))
bp->flow_stat->flow_count++;
bnxt_release_flow_lock(bp);
bnxt_setup_flow_counter(bp);
+ PMD_DRV_LOG(DEBUG, "Successfully created flow.\n");
return flow;
}
return flow;
}
@@
-1928,11
+1955,7
@@
_bnxt_flow_destroy(struct bnxt *bp,
filter->flow_id = 0;
}
filter->flow_id = 0;
}
- if (filter->filter_type == HWRM_CFA_EM_FILTER)
- ret = bnxt_hwrm_clear_em_filter(bp, filter);
- if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
- ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
- ret = bnxt_hwrm_clear_l2_filter(bp, filter);
+ ret = bnxt_clear_one_vnic_filter(bp, filter);
done:
if (!ret) {
done:
if (!ret) {