}
/* Create a new EFD table management structure */
- table = (struct rte_efd_table *) rte_zmalloc_socket(NULL,
+ table = rte_zmalloc_socket(NULL,
sizeof(struct rte_efd_table),
RTE_CACHE_LINE_SIZE,
offline_cpu_socket);
table->key_len = key_len;
/* key_array */
- key_array = (uint8_t *) rte_zmalloc_socket(NULL,
+ key_array = rte_zmalloc_socket(NULL,
table->max_num_rules * table->key_len,
RTE_CACHE_LINE_SIZE,
offline_cpu_socket);
* as a continuous block
*/
table->chunks[socket_id] =
- (struct efd_online_chunk *) rte_zmalloc_socket(
+ rte_zmalloc_socket(
NULL,
online_table_size,
RTE_CACHE_LINE_SIZE,
*/
offline_table_size = num_chunks * sizeof(struct efd_offline_chunk_rules);
table->offline_chunks =
- (struct efd_offline_chunk_rules *) rte_zmalloc_socket(NULL,
+ rte_zmalloc_socket(NULL,
offline_table_size,
RTE_CACHE_LINE_SIZE,
offline_cpu_socket);
rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK);
TAILQ_FOREACH(te, lpm_list, next) {
- l = (struct rte_lpm_v20 *) te->data;
+ l = te->data;
if (strncmp(name, l->name, RTE_LPM_NAMESIZE) == 0)
break;
}
rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK);
TAILQ_FOREACH(te, lpm_list, next) {
- l = (struct rte_lpm *) te->data;
+ l = te->data;
if (strncmp(name, l->name, RTE_LPM_NAMESIZE) == 0)
break;
}
/* guarantee there's no existing */
TAILQ_FOREACH(te, lpm_list, next) {
- lpm = (struct rte_lpm_v20 *) te->data;
+ lpm = te->data;
if (strncmp(name, lpm->name, RTE_LPM_NAMESIZE) == 0)
break;
}
- lpm = NULL;
+
if (te != NULL) {
rte_errno = EEXIST;
goto exit;
}
/* Allocate memory to store the LPM data structures. */
- lpm = (struct rte_lpm_v20 *)rte_zmalloc_socket(mem_name, mem_size,
+ lpm = rte_zmalloc_socket(mem_name, mem_size,
RTE_CACHE_LINE_SIZE, socket_id);
if (lpm == NULL) {
RTE_LOG(ERR, LPM, "LPM memory allocation failed\n");
lpm->max_rules = max_rules;
snprintf(lpm->name, sizeof(lpm->name), "%s", name);
- te->data = (void *) lpm;
+ te->data = lpm;
TAILQ_INSERT_TAIL(lpm_list, te, next);
/* guarantee there's no existing */
TAILQ_FOREACH(te, lpm_list, next) {
- lpm = (struct rte_lpm *) te->data;
+ lpm = te->data;
if (strncmp(name, lpm->name, RTE_LPM_NAMESIZE) == 0)
break;
}
- lpm = NULL;
+
if (te != NULL) {
rte_errno = EEXIST;
goto exit;
}
/* Allocate memory to store the LPM data structures. */
- lpm = (struct rte_lpm *)rte_zmalloc_socket(mem_name, mem_size,
+ lpm = rte_zmalloc_socket(mem_name, mem_size,
RTE_CACHE_LINE_SIZE, socket_id);
if (lpm == NULL) {
RTE_LOG(ERR, LPM, "LPM memory allocation failed\n");
goto exit;
}
- lpm->rules_tbl = (struct rte_lpm_rule *)rte_zmalloc_socket(NULL,
+ lpm->rules_tbl = rte_zmalloc_socket(NULL,
(size_t)rules_size, RTE_CACHE_LINE_SIZE, socket_id);
if (lpm->rules_tbl == NULL) {
goto exit;
}
- lpm->tbl8 = (struct rte_lpm_tbl_entry *)rte_zmalloc_socket(NULL,
+ lpm->tbl8 = rte_zmalloc_socket(NULL,
(size_t)tbl8s_size, RTE_CACHE_LINE_SIZE, socket_id);
if (lpm->tbl8 == NULL) {
lpm->number_tbl8s = config->number_tbl8s;
snprintf(lpm->name, sizeof(lpm->name), "%s", name);
- te->data = (void *) lpm;
+ te->data = lpm;
TAILQ_INSERT_TAIL(lpm_list, te, next);
}
/* Allocate memory to store the LPM data structures. */
- lpm = (struct rte_lpm6 *)rte_zmalloc_socket(mem_name, (size_t)mem_size,
+ lpm = rte_zmalloc_socket(mem_name, (size_t)mem_size,
RTE_CACHE_LINE_SIZE, socket_id);
if (lpm == NULL) {
goto exit;
}
- lpm->rules_tbl = (struct rte_lpm6_rule *)rte_zmalloc_socket(NULL,
+ lpm->rules_tbl = rte_zmalloc_socket(NULL,
(size_t)rules_size, RTE_CACHE_LINE_SIZE, socket_id);
if (lpm->rules_tbl == NULL) {
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
TAILQ_FOREACH(te, member_list, next) {
- setsum = (struct rte_member_setsum *) te->data;
+ setsum = te->data;
if (strncmp(params->name, setsum->name,
RTE_MEMBER_NAMESIZE) == 0)
break;
}
/* Create a new setsum structure */
- setsum = (struct rte_member_setsum *) rte_zmalloc_socket(params->name,
+ setsum = rte_zmalloc_socket(params->name,
sizeof(struct rte_member_setsum), RTE_CACHE_LINE_SIZE,
params->socket_id);
if (setsum == NULL) {