summaryrefslogtreecommitdiffstats
path: root/lib/librte_table/rte_table_acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_table/rte_table_acl.c')
-rw-r--r--lib/librte_table/rte_table_acl.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/librte_table/rte_table_acl.c b/lib/librte_table/rte_table_acl.c
index 8f1f8ceb..3c05e4a8 100644
--- a/lib/librte_table/rte_table_acl.c
+++ b/lib/librte_table/rte_table_acl.c
@@ -87,7 +87,7 @@ rte_table_acl_create(
int socket_id,
uint32_t entry_size)
{
- struct rte_table_acl_params *p = (struct rte_table_acl_params *) params;
+ struct rte_table_acl_params *p = params;
struct rte_table_acl *acl;
uint32_t action_table_size, acl_rule_list_size, acl_rule_memory_size;
uint32_t total_size;
@@ -168,7 +168,7 @@ rte_table_acl_create(
static int
rte_table_acl_free(void *table)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
/* Check input parameters */
if (table == NULL) {
@@ -248,9 +248,9 @@ rte_table_acl_entry_add(
int *key_found,
void **entry_ptr)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
struct rte_table_acl_rule_add_params *rule =
- (struct rte_table_acl_rule_add_params *) key;
+ key;
struct rte_pipeline_acl_rule acl_rule;
struct rte_acl_rule *rule_location;
struct rte_acl_ctx *ctx;
@@ -366,9 +366,9 @@ rte_table_acl_entry_delete(
int *key_found,
void *entry)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
struct rte_table_acl_rule_delete_params *rule =
- (struct rte_table_acl_rule_delete_params *) key;
+ key;
struct rte_acl_rule *deleted_rule = NULL;
struct rte_acl_ctx *ctx;
uint32_t pos, pos_valid, i;
@@ -450,7 +450,7 @@ rte_table_acl_entry_add_bulk(
int *key_found,
void **entries_ptr)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
struct rte_acl_ctx *ctx;
uint32_t rule_pos[n_keys];
uint32_t i;
@@ -507,7 +507,7 @@ rte_table_acl_entry_add_bulk(
return -EINVAL;
}
- rule = (struct rte_table_acl_rule_add_params *) keys[i];
+ rule = keys[i];
if (rule->priority > RTE_ACL_MAX_PRIORITY) {
RTE_LOG(ERR, TABLE, "%s: Priority is too high\n", __func__);
return -EINVAL;
@@ -518,7 +518,7 @@ rte_table_acl_entry_add_bulk(
memset(key_found, 0, n_keys * sizeof(int));
for (i = 0; i < n_keys; i++) {
struct rte_table_acl_rule_add_params *rule =
- (struct rte_table_acl_rule_add_params *) keys[i];
+ keys[i];
struct rte_pipeline_acl_rule acl_rule;
struct rte_acl_rule *rule_location;
uint32_t free_pos, free_pos_valid, j;
@@ -636,7 +636,7 @@ rte_table_acl_entry_delete_bulk(
int *key_found,
void **entries)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
struct rte_acl_rule *deleted_rules[n_keys];
uint32_t rule_pos[n_keys];
struct rte_acl_ctx *ctx;
@@ -675,7 +675,7 @@ rte_table_acl_entry_delete_bulk(
memset(rule_pos, 0, n_keys * sizeof(uint32_t));
for (i = 0; i < n_keys; i++) {
struct rte_table_acl_rule_delete_params *rule =
- (struct rte_table_acl_rule_delete_params *) keys[i];
+ keys[i];
uint32_t pos_valid, j;
/* Look for the rule in the table */
@@ -792,7 +792,7 @@ rte_table_acl_lookup(
pkts_mask &= ~pkt_mask;
- if (action_table_pos != RTE_ACL_INVALID_USERDATA) {
+ if (action_table_pos != 0) {
pkts_out_mask |= pkt_mask;
entries[pkt_pos] = (void *)
&acl->memory[action_table_pos *
@@ -810,7 +810,7 @@ rte_table_acl_lookup(
static int
rte_table_acl_stats_read(void *table, struct rte_table_stats *stats, int clear)
{
- struct rte_table_acl *acl = (struct rte_table_acl *) table;
+ struct rte_table_acl *acl = table;
if (stats != NULL)
memcpy(stats, &acl->stats, sizeof(acl->stats));