dpaa2_flow_qos_entry_log("Before update", curr, qos_index);
- ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
- priv->token, &curr->qos_rule);
- if (ret) {
- DPAA2_PMD_ERR("Qos entry remove failed.");
- return -1;
+ if (priv->num_rx_tc > 1) {
+ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
+ priv->token, &curr->qos_rule);
+ if (ret) {
+ DPAA2_PMD_ERR("Qos entry remove failed.");
+ return -1;
+ }
}
extend = -1;
dpaa2_flow_qos_entry_log("Start update", curr, qos_index);
- ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,
- priv->token, &curr->qos_rule,
- curr->tc_id, qos_index,
- 0, 0);
- if (ret) {
- DPAA2_PMD_ERR("Qos entry update failed.");
- return -1;
+ if (priv->num_rx_tc > 1) {
+ ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,
+ priv->token, &curr->qos_rule,
+ curr->tc_id, qos_index,
+ 0, 0);
+ if (ret) {
+ DPAA2_PMD_ERR("Qos entry update failed.");
+ return -1;
+ }
}
if (curr->action != RTE_FLOW_ACTION_TYPE_QUEUE) {
flow->action = RTE_FLOW_ACTION_TYPE_QUEUE;
memset(&action, 0, sizeof(struct dpni_fs_action_cfg));
action.flow_id = rxq->flow_id;
- if (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) {
- dpaa2_flow_qos_table_extracts_log(priv);
- if (dpkg_prepare_key_cfg(
- &priv->extract.qos_key_extract.dpkg,
- (uint8_t *)(size_t)priv->extract.qos_extract_param)
- < 0) {
- DPAA2_PMD_ERR(
- "Unable to prepare extract parameters");
- return -1;
- }
- memset(&qos_cfg, 0, sizeof(struct dpni_qos_tbl_cfg));
- qos_cfg.discard_on_miss = true;
- qos_cfg.keep_entries = true;
- qos_cfg.key_cfg_iova =
- (size_t)priv->extract.qos_extract_param;
- ret = dpni_set_qos_table(dpni, CMD_PRI_LOW,
- priv->token, &qos_cfg);
- if (ret < 0) {
- DPAA2_PMD_ERR(
- "Distribution cannot be configured.(%d)"
- , ret);
- return -1;
- }
- }
+ /* Configure FS table first*/
if (is_keycfg_configured & DPAA2_FS_TABLE_RECONFIGURE) {
dpaa2_flow_fs_table_extracts_log(priv, flow->tc_id);
if (dpkg_prepare_key_cfg(
return -1;
}
}
- /* Configure QoS table first */
- qos_index = flow->tc_id * priv->fs_entries +
- flow->tc_index;
+ /* Configure QoS table then.*/
+ if (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) {
+ dpaa2_flow_qos_table_extracts_log(priv);
+ if (dpkg_prepare_key_cfg(
+ &priv->extract.qos_key_extract.dpkg,
+ (uint8_t *)(size_t)priv->extract.qos_extract_param) < 0) {
+ DPAA2_PMD_ERR(
+ "Unable to prepare extract parameters");
+ return -1;
+ }
- if (qos_index >= priv->qos_entries) {
- DPAA2_PMD_ERR("QoS table with %d entries full",
- priv->qos_entries);
- return -1;
+ memset(&qos_cfg, 0, sizeof(struct dpni_qos_tbl_cfg));
+ qos_cfg.discard_on_miss = false;
+ qos_cfg.default_tc = 0;
+ qos_cfg.keep_entries = true;
+ qos_cfg.key_cfg_iova =
+ (size_t)priv->extract.qos_extract_param;
+ /* QoS table is effecitive for multiple TCs.*/
+ if (priv->num_rx_tc > 1) {
+ ret = dpni_set_qos_table(dpni, CMD_PRI_LOW,
+ priv->token, &qos_cfg);
+ if (ret < 0) {
+ DPAA2_PMD_ERR(
+ "RSS QoS table can not be configured(%d)\n",
+ ret);
+ return -1;
+ }
+ }
}
- flow->qos_rule.key_size = FIXED_ENTRY_SIZE;
+
+ flow->qos_real_key_size = priv->extract
+ .qos_key_extract.key_info.key_total_size;
if (flow->ipaddr_rule.ipaddr_type == FLOW_IPV4_ADDR) {
if (flow->ipaddr_rule.qos_ipdst_offset >=
flow->ipaddr_rule.qos_ipsrc_offset) {
}
}
- flow->qos_rule.key_size = FIXED_ENTRY_SIZE;
+ /* QoS entry added is only effective for multiple TCs.*/
+ if (priv->num_rx_tc > 1) {
+ qos_index = flow->tc_id * priv->fs_entries +
+ flow->tc_index;
+ if (qos_index >= priv->qos_entries) {
+ DPAA2_PMD_ERR("QoS table with %d entries full",
+ priv->qos_entries);
+ return -1;
+ }
+ flow->qos_rule.key_size = FIXED_ENTRY_SIZE;
- dpaa2_flow_qos_entry_log("Start add", flow, qos_index);
+ dpaa2_flow_qos_entry_log("Start add", flow, qos_index);
- ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,
+ ret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,
priv->token, &flow->qos_rule,
flow->tc_id, qos_index,
0, 0);
- if (ret < 0) {
- DPAA2_PMD_ERR(
- "Error in addnig entry to QoS table(%d)", ret);
- return ret;
+ if (ret < 0) {
+ DPAA2_PMD_ERR(
+ "Error in addnig entry to QoS table(%d)", ret);
+ return ret;
+ }
}
- /* Then Configure FS table */
if (flow->tc_index >= priv->fs_entries) {
DPAA2_PMD_ERR("FS table with %d entries full",
priv->fs_entries);
&tc_cfg);
if (ret < 0) {
DPAA2_PMD_ERR(
- "Distribution cannot be configured: %d\n", ret);
+ "RSS FS table cannot be configured: %d\n",
+ ret);
rte_free((void *)param);
return -1;
}
switch (flow->action) {
case RTE_FLOW_ACTION_TYPE_QUEUE:
- /* Remove entry from QoS table first */
- ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,
- &flow->qos_rule);
- if (ret < 0) {
- DPAA2_PMD_ERR(
- "Error in adding entry to QoS table(%d)", ret);
- goto error;
+ if (priv->num_rx_tc > 1) {
+ /* Remove entry from QoS table first */
+ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,
+ &flow->qos_rule);
+ if (ret < 0) {
+ DPAA2_PMD_ERR(
+ "Error in removing entry from QoS table(%d)", ret);
+ goto error;
+ }
}
/* Then remove entry from FS table */
flow->tc_id, &flow->fs_rule);
if (ret < 0) {
DPAA2_PMD_ERR(
- "Error in entry addition in FS table(%d)", ret);
+ "Error in removing entry from FS table(%d)", ret);
goto error;
}
break;
case RTE_FLOW_ACTION_TYPE_RSS:
- ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,
- &flow->qos_rule);
- if (ret < 0) {
- DPAA2_PMD_ERR(
- "Error in entry addition in QoS table(%d)", ret);
- goto error;
+ if (priv->num_rx_tc > 1) {
+ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,
+ &flow->qos_rule);
+ if (ret < 0) {
+ DPAA2_PMD_ERR(
+ "Error in entry addition in QoS table(%d)", ret);
+ goto error;
+ }
}
break;
default: