net: add rte prefix to ether functions
[dpdk.git] / drivers / net / softnic / rte_eth_softnic_flow.c
index 285af46..f05ff09 100644 (file)
@@ -56,7 +56,7 @@ flow_attr_map_set(struct pmd_internals *softnic,
 
        map = (ingress) ? &softnic->flow.ingress_map[group_id] :
                &softnic->flow.egress_map[group_id];
-       strcpy(map->pipeline_name, pipeline_name);
+       strlcpy(map->pipeline_name, pipeline_name, sizeof(map->pipeline_name));
        map->table_id = table_id;
        map->valid = 1;
 
@@ -1283,7 +1283,8 @@ flow_rule_action_get(struct pmd_internals *softnic,
                                        action,
                                        "QUEUE: Invalid RX queue ID");
 
-                       sprintf(name, "RXQ%u", (uint32_t)conf->index);
+                       snprintf(name, sizeof(name), "RXQ%u",
+                                       (uint32_t)conf->index);
 
                        status = softnic_pipeline_port_out_find(softnic,
                                pipeline->name,
@@ -1373,7 +1374,7 @@ flow_rule_action_get(struct pmd_internals *softnic,
                                                action,
                                                "RSS: Invalid RX queue ID");
 
-                               sprintf(name, "RXQ%u",
+                               snprintf(name, sizeof(name), "RXQ%u",
                                        (uint32_t)conf->queue[i]);
 
                                status = softnic_pipeline_port_out_find(softnic,
@@ -1623,12 +1624,12 @@ flow_rule_action_get(struct pmd_internals *softnic,
 
                        /* RTE_TABLE_ACTION_METER */
                        rule_action->mtr.mtr[0].meter_profile_id = meter_profile_id;
-                       rule_action->mtr.mtr[0].policer[e_RTE_METER_GREEN] =
-                               (enum rte_table_action_policer)m->params.action[RTE_MTR_GREEN];
-                       rule_action->mtr.mtr[0].policer[e_RTE_METER_YELLOW] =
-                               (enum rte_table_action_policer)m->params.action[RTE_MTR_YELLOW];
-                       rule_action->mtr.mtr[0].policer[e_RTE_METER_RED] =
-                               (enum rte_table_action_policer)m->params.action[RTE_MTR_RED];
+                       rule_action->mtr.mtr[0].policer[RTE_COLOR_GREEN] =
+                               softnic_table_action_policer(m->params.action[RTE_COLOR_GREEN]);
+                       rule_action->mtr.mtr[0].policer[RTE_COLOR_YELLOW] =
+                               softnic_table_action_policer(m->params.action[RTE_COLOR_YELLOW]);
+                       rule_action->mtr.mtr[0].policer[RTE_COLOR_RED] =
+                               softnic_table_action_policer(m->params.action[RTE_COLOR_RED]);
                        rule_action->mtr.tc_mask = 1;
                        rule_action->action_mask |= 1 << RTE_TABLE_ACTION_MTR;
                        break;
@@ -1680,9 +1681,9 @@ flow_rule_action_get(struct pmd_internals *softnic,
                                        item,
                                        "VXLAN ENCAP: first encap item should be ether");
                        }
-                       ether_addr_copy(&spec.eth.dst,
+                       rte_ether_addr_copy(&spec.eth.dst,
                                        &rule_action->encap.vxlan.ether.da);
-                       ether_addr_copy(&spec.eth.src,
+                       rte_ether_addr_copy(&spec.eth.src,
                                        &rule_action->encap.vxlan.ether.sa);
 
                        item++;