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/ionic: log queue counters when tearing down
[dpdk.git]
/
drivers
/
net
/
hns3
/
hns3_flow.c
diff --git
a/drivers/net/hns3/hns3_flow.c
b/drivers/net/hns3/hns3_flow.c
index
e9d0a0b
..
a016857
100644
(file)
--- a/
drivers/net/hns3/hns3_flow.c
+++ b/
drivers/net/hns3/hns3_flow.c
@@
-44,8
+44,7
@@
static enum rte_flow_item_type first_items[] = {
RTE_FLOW_ITEM_TYPE_NVGRE,
RTE_FLOW_ITEM_TYPE_VXLAN,
RTE_FLOW_ITEM_TYPE_GENEVE,
RTE_FLOW_ITEM_TYPE_NVGRE,
RTE_FLOW_ITEM_TYPE_VXLAN,
RTE_FLOW_ITEM_TYPE_GENEVE,
- RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
- RTE_FLOW_ITEM_TYPE_MPLS
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE
};
static enum rte_flow_item_type L2_next_items[] = {
};
static enum rte_flow_item_type L2_next_items[] = {
@@
-65,8
+64,7
@@
static enum rte_flow_item_type L3_next_items[] = {
static enum rte_flow_item_type L4_next_items[] = {
RTE_FLOW_ITEM_TYPE_VXLAN,
RTE_FLOW_ITEM_TYPE_GENEVE,
static enum rte_flow_item_type L4_next_items[] = {
RTE_FLOW_ITEM_TYPE_VXLAN,
RTE_FLOW_ITEM_TYPE_GENEVE,
- RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
- RTE_FLOW_ITEM_TYPE_MPLS
+ RTE_FLOW_ITEM_TYPE_VXLAN_GPE
};
static enum rte_flow_item_type tunnel_next_items[] = {
};
static enum rte_flow_item_type tunnel_next_items[] = {
@@
-1118,8
+1116,7
@@
is_tunnel_packet(enum rte_flow_item_type type)
if (type == RTE_FLOW_ITEM_TYPE_VXLAN_GPE ||
type == RTE_FLOW_ITEM_TYPE_VXLAN ||
type == RTE_FLOW_ITEM_TYPE_NVGRE ||
if (type == RTE_FLOW_ITEM_TYPE_VXLAN_GPE ||
type == RTE_FLOW_ITEM_TYPE_VXLAN ||
type == RTE_FLOW_ITEM_TYPE_NVGRE ||
- type == RTE_FLOW_ITEM_TYPE_GENEVE ||
- type == RTE_FLOW_ITEM_TYPE_MPLS)
+ type == RTE_FLOW_ITEM_TYPE_GENEVE)
return true;
return false;
}
return true;
return false;
}
@@
-1447,7
+1444,7
@@
hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
*hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
break;
default:
*hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
break;
default:
- hns3_err(hw, "Invalid RSS algorithm configuration(%
u
)",
+ hns3_err(hw, "Invalid RSS algorithm configuration(%
d
)",
algo_func);
return -EINVAL;
}
algo_func);
return -EINVAL;
}
@@
-1489,14
+1486,14
@@
hns3_update_indir_table(struct rte_eth_dev *dev,
{
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
{
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
- uint16_t indir_tbl[HNS3_RSS_IND_TBL_SIZE];
+ uint16_t indir_tbl[HNS3_RSS_IND_TBL_SIZE
_MAX
];
uint16_t j;
uint32_t i;
/* Fill in redirection table */
memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
sizeof(hw->rss_info.rss_indirection_tbl));
uint16_t j;
uint32_t i;
/* Fill in redirection table */
memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
sizeof(hw->rss_info.rss_indirection_tbl));
- for (i = 0, j = 0; i <
HNS3_RSS_IND_TBL_SIZE
; i++, j++) {
+ for (i = 0, j = 0; i <
hw->rss_ind_tbl_size
; i++, j++) {
j %= num;
if (conf->queue[j] >= hw->alloc_rss_size) {
hns3_err(hw, "queue id(%u) set to redirection table "
j %= num;
if (conf->queue[j] >= hw->alloc_rss_size) {
hns3_err(hw, "queue id(%u) set to redirection table "
@@
-1507,7
+1504,7
@@
hns3_update_indir_table(struct rte_eth_dev *dev,
indir_tbl[i] = conf->queue[j];
}
indir_tbl[i] = conf->queue[j];
}
- return hns3_set_rss_indir_table(hw, indir_tbl,
HNS3_RSS_IND_TBL_SIZE
);
+ return hns3_set_rss_indir_table(hw, indir_tbl,
hw->rss_ind_tbl_size
);
}
static int
}
static int
@@
-1809,17
+1806,18
@@
hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
flow->counter_id = fdir_rule.act_cnt.id;
}
flow->counter_id = fdir_rule.act_cnt.id;
}
+
+ fdir_rule_ptr = rte_zmalloc("hns3 fdir rule",
+ sizeof(struct hns3_fdir_rule_ele),
+ 0);
+ if (fdir_rule_ptr == NULL) {
+ hns3_err(hw, "failed to allocate fdir_rule memory.");
+ ret = -ENOMEM;
+ goto err_fdir;
+ }
+
ret = hns3_fdir_filter_program(hns, &fdir_rule, false);
if (!ret) {
ret = hns3_fdir_filter_program(hns, &fdir_rule, false);
if (!ret) {
- fdir_rule_ptr = rte_zmalloc("hns3 fdir rule",
- sizeof(struct hns3_fdir_rule_ele),
- 0);
- if (fdir_rule_ptr == NULL) {
- hns3_err(hw, "Failed to allocate fdir_rule memory");
- ret = -ENOMEM;
- goto err_fdir;
- }
-
memcpy(&fdir_rule_ptr->fdir_conf, &fdir_rule,
sizeof(struct hns3_fdir_rule));
TAILQ_INSERT_TAIL(&process_list->fdir_list,
memcpy(&fdir_rule_ptr->fdir_conf, &fdir_rule,
sizeof(struct hns3_fdir_rule));
TAILQ_INSERT_TAIL(&process_list->fdir_list,
@@
-1830,10
+1828,10
@@
hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
return flow;
}
return flow;
}
+ rte_free(fdir_rule_ptr);
err_fdir:
if (fdir_rule.flags & HNS3_RULE_FLAG_COUNTER)
hns3_counter_release(dev, fdir_rule.act_cnt.id);
err_fdir:
if (fdir_rule.flags & HNS3_RULE_FLAG_COUNTER)
hns3_counter_release(dev, fdir_rule.act_cnt.id);
-
err:
rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
"Failed to create flow");
err:
rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
"Failed to create flow");