item, "Not supported by ntuple filter");
return -rte_errno;
}
+
return 0;
}
* END
* other members in mask and spec should set to 0x00.
* item->last should be NULL.
- * Please aware there's an asumption for all the parsers.
+ * Please be aware there's an assumption for all the parsers.
* rte_flow_item is using big endian, rte_flow_attr and
* rte_flow_action are using CPU order.
* Because the pattern is used to describe the packets,
/**
* Check if the flow rule is supported by nic.
- * It only checkes the format. Don't guarantee the rule can be programmed into
+ * It only checks the format. Don't guarantee the rule can be programmed into
* the HW. Because there can be no enough room for the rule.
*/
static int hinic_flow_validate(struct rte_eth_dev *dev,
rc = hinic_set_fdir_tcam_rule_filter(nic_dev->hwdev, true);
if (rc && rc != HINIC_MGMT_CMD_UNSUPPORTED) {
- (void)hinic_set_fdir_filter(nic_dev->hwdev, 0, 0, 0,
- false);
+ /*
+ * hinic supports two methods: linear table and tcam
+ * table, if tcam filter enables failed but linear table
+ * is ok, which also needs to enable filter, so for this
+ * scene, driver should not close fdir switch.
+ */
(void)hinic_del_tcam_rule(nic_dev->hwdev,
fdir_tcam_rule->index);
return rc;
sizeof(struct hinic_ntuple_filter_ele), 0);
if (ntuple_filter_ptr == NULL) {
PMD_DRV_LOG(ERR, "Failed to allocate ntuple_filter_ptr");
+ (void)hinic_add_del_ntuple_filter(dev,
+ &ntuple_filter, FALSE);
goto out;
}
rte_memcpy(&ntuple_filter_ptr->filter_info,
sizeof(struct hinic_ethertype_filter_ele), 0);
if (ethertype_filter_ptr == NULL) {
PMD_DRV_LOG(ERR, "Failed to allocate ethertype_filter_ptr");
+ (void)hinic_add_del_ethertype_filter(dev,
+ ðertype_filter, FALSE);
goto out;
}
rte_memcpy(ðertype_filter_ptr->filter_info,
actions, &fdir_rule, error);
if (!ret) {
if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL) {
- ret = hinic_add_del_fdir_filter(dev,
- &fdir_rule, TRUE);
+ ret = hinic_add_del_fdir_filter(dev, &fdir_rule, TRUE);
} else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM) {
- ret = hinic_add_del_tcam_fdir_filter(dev,
- &fdir_rule, TRUE);
+ ret = hinic_add_del_tcam_fdir_filter(dev, &fdir_rule,
+ TRUE);
} else {
PMD_DRV_LOG(INFO, "flow fdir rule create failed, rule mode wrong");
goto out;
sizeof(struct hinic_fdir_rule_ele), 0);
if (fdir_rule_ptr == NULL) {
PMD_DRV_LOG(ERR, "Failed to allocate fdir_rule_ptr");
+ if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL)
+ hinic_add_del_fdir_filter(dev,
+ &fdir_rule, FALSE);
+ else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM)
+ hinic_add_del_tcam_fdir_filter(dev,
+ &fdir_rule, FALSE);
+
goto out;
}
rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,