X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_flow_classify%2Frte_flow_classify.c;h=5ff585803b5e51d45688ff848570f61e5de1cc0d;hb=141c86f55f734c4f8b9ad3129b6e58807b5c4577;hp=7edb2f15fff2515b5df94b2c8b757604a9f35b18;hpb=77b7b81e32e94e79d2a65b259769ae11725be8bf;p=dpdk.git diff --git a/lib/librte_flow_classify/rte_flow_classify.c b/lib/librte_flow_classify/rte_flow_classify.c index 7edb2f15ff..5ff585803b 100644 --- a/lib/librte_flow_classify/rte_flow_classify.c +++ b/lib/librte_flow_classify/rte_flow_classify.c @@ -2,6 +2,7 @@ * Copyright(c) 2017 Intel Corporation */ +#include #include #include #include "rte_flow_classify_parse.h" @@ -88,7 +89,7 @@ struct rte_flow_classify_rule { void *entry_ptr; /* handle to the table entry for rule meta data */ }; -int __rte_experimental +int rte_flow_classify_validate( struct rte_flow_classifier *cls, const struct rte_flow_attr *attr, @@ -247,8 +248,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params) } /* socket */ - if ((params->socket_id < 0) || - (params->socket_id >= RTE_MAX_NUMA_NODES)) { + if (params->socket_id < 0) { RTE_FLOW_CLASSIFY_LOG(ERR, "%s: Incorrect value for parameter socket_id\n", __func__); @@ -258,7 +258,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params) return 0; } -struct rte_flow_classifier * __rte_experimental +struct rte_flow_classifier * rte_flow_classifier_create(struct rte_flow_classifier_params *params) { struct rte_flow_classifier *cls; @@ -286,8 +286,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params) } /* Save input parameters */ - snprintf(cls->name, RTE_FLOW_CLASSIFIER_MAX_NAME_SZ, "%s", - params->name); + strlcpy(cls->name, params->name, RTE_FLOW_CLASSIFIER_MAX_NAME_SZ); cls->socket_id = params->socket_id; @@ -301,7 +300,7 @@ rte_flow_classify_table_free(struct rte_cls_table *table) table->ops.f_free(table->h_table); } -int __rte_experimental +int rte_flow_classifier_free(struct rte_flow_classifier *cls) { uint32_t i; @@ -373,7 +372,7 @@ rte_table_check_params(struct rte_flow_classifier *cls, return 0; } -int __rte_experimental +int rte_flow_classify_table_create(struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params) { @@ -483,7 +482,7 @@ allocate_acl_ipv4_5tuple_rule(struct rte_flow_classifier *cls) return rule; } -struct rte_flow_classify_rule * __rte_experimental +struct rte_flow_classify_rule * rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], @@ -565,7 +564,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls, return NULL; } -int __rte_experimental +int rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls, struct rte_flow_classify_rule *rule) { @@ -635,9 +634,7 @@ action_apply(struct rte_flow_classifier *cls, } if (count) { ret = 0; - ntuple_stats = - (struct rte_flow_classify_ipv4_5tuple_stats *) - stats->stats; + ntuple_stats = stats->stats; ntuple_stats->counter1 = count; ntuple_stats->ipv4_5tuple = rule->rules.u.ipv4_5tuple; } @@ -645,7 +642,7 @@ action_apply(struct rte_flow_classifier *cls, return ret; } -int __rte_experimental +int rte_flow_classifier_query(struct rte_flow_classifier *cls, struct rte_mbuf **pkts, const uint16_t nb_pkts, @@ -675,10 +672,7 @@ rte_flow_classifier_query(struct rte_flow_classifier *cls, return ret; } -RTE_INIT(librte_flow_classify_init_log); - -static void -librte_flow_classify_init_log(void) +RTE_INIT(librte_flow_classify_init_log) { librte_flow_classify_logtype = rte_log_register("lib.flow_classify");