* [dpdk-test-report] |WARNING| pw98863 [PATCH] pipeline: improve handling of learner table action arguments
@ 2021-09-14 19:28 dpdklab
0 siblings, 0 replies; only message in thread
From: dpdklab @ 2021-09-14 19:28 UTC (permalink / raw)
To: test-report; +Cc: dpdk-test-reports
[-- Attachment #1: Type: text/plain, Size: 15639 bytes --]
Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/98863
_apply patch failure_
Submitter: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Date: Tuesday, September 14 2021 19:00:05
Applied on: CommitID:af167bcf174b59fa4776297e628a94143cf6a330
Apply patch set 98863 failed:
Checking patch examples/pipeline/examples/learner.spec...
error: examples/pipeline/examples/learner.spec: does not exist in index
Checking patch lib/pipeline/rte_swx_pipeline.c...
error: while searching for:
static int
action_has_nbo_args(struct action *a);
static int
instr_learn_translate(struct rte_swx_pipeline *p,
struct action *action,
error: patch failed: lib/pipeline/rte_swx_pipeline.c:2359
error: while searching for:
struct instruction_data *data __rte_unused)
{
struct action *a;
CHECK(action, EINVAL);
CHECK(n_tokens == 2, EINVAL);
a = action_find(p, tokens[1]);
CHECK(a, EINVAL);
CHECK(!action_has_nbo_args(a), EINVAL);
instr->type = INSTR_LEARNER_LEARN;
instr->learn.action_id = a->id;
return 0;
}
error: patch failed: lib/pipeline/rte_swx_pipeline.c:2368
error: while searching for:
CHECK(params->action_names, EINVAL);
for (i = 0; i < params->n_actions; i++) {
const char *action_name = params->action_names[i];
const char *action_field_name = params->action_field_names[i];
struct action *a;
uint32_t action_data_size;
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8165
error: while searching for:
a = action_find(p, action_name);
CHECK(a, EINVAL);
status = learner_action_args_check(p, a, action_field_name);
if (status)
return status;
status = learner_action_learning_check(p,
a,
params->action_names,
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8174
error: while searching for:
if (!l->actions)
goto nomem;
l->action_arg = calloc(params->n_actions, sizeof(struct field *));
if (!l->action_arg)
goto nomem;
if (action_data_size_max) {
l->default_action_data = calloc(1, action_data_size_max);
if (!l->default_action_data)
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8218
error: while searching for:
l->header = header;
for (i = 0; i < params->n_actions; i++) {
const char *mf_name = params->action_field_names[i];
l->actions[i] = action_find(p, params->action_names[i]);
l->action_arg[i] = mf_name ? metadata_field_parse(p, mf_name) : NULL;
}
l->default_action = default_action;
if (default_action->st)
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8243
error: while searching for:
if (!l)
return -ENOMEM;
free(l->action_arg);
free(l->actions);
free(l->fields);
free(l);
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8280
error: while searching for:
struct learner_runtime *r = &t->learners[j];
free(r->mailbox);
free(r->action_data);
}
free(t->learners);
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8375
error: while searching for:
TAILQ_FOREACH(l, &p->learners, node) {
struct learner_runtime *r = &t->learners[l->id];
uint64_t size;
uint32_t j;
/* r->mailbox. */
size = rte_swx_table_learner_mailbox_size_get();
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8419
error: while searching for:
r->key = l->header ?
&t->structs[l->header->struct_id] :
&t->structs[p->metadata_struct_id];
/* r->action_data. */
r->action_data = calloc(p->n_actions, sizeof(uint8_t *));
if (!r->action_data) {
status = -ENOMEM;
goto error;
}
for (j = 0; j < l->n_actions; j++) {
struct action *a = l->actions[j];
struct field *mf = l->action_arg[j];
uint8_t *m = t->structs[p->metadata_struct_id];
r->action_data[a->id] = mf ? &m[mf->offset / 8] : NULL;
}
}
}
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8435
error: while searching for:
TAILQ_REMOVE(&p->learners, l, node);
free(l->fields);
free(l->actions);
free(l->action_arg);
free(l->default_action_data);
free(l);
}
error: patch failed: lib/pipeline/rte_swx_pipeline.c:8476
Checking patch lib/pipeline/rte_swx_pipeline.h...
error: while searching for:
*/
uint32_t n_actions;
/** This table type allows adding the latest lookup key (typically done
* only in the case of lookup miss) to the table with a given action.
* The action arguments are picked up from the packet meta-data: for
* each action, a set of successive meta-data fields (with the name of
* the first such field provided here) is 1:1 mapped to the action
* arguments. These meta-data fields must be set with the actual values
* of the action arguments before the key add operation.
*/
const char **action_field_names;
/** The default table action that gets executed on lookup miss. Must be
* one of the table actions included in the *action_names*.
*/
error: patch failed: lib/pipeline/rte_swx_pipeline.h:696
Checking patch lib/pipeline/rte_swx_pipeline_internal.h...
error: lib/pipeline/rte_swx_pipeline_internal.h: does not exist in index
Checking patch lib/pipeline/rte_swx_pipeline_spec.c...
error: while searching for:
* ...
* }
* actions {
* ACTION_NAME args METADATA_FIELD_NAME
* ...
* }
* default_action ACTION_NAME args none | ARGS_BYTE_ARRAY [ const ]
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1293
error: while searching for:
free(s->params.action_names);
s->params.action_names = NULL;
for (i = 0; i < s->params.n_actions; i++) {
uintptr_t name = (uintptr_t)s->params.action_field_names[i];
free((void *)name);
}
free(s->params.action_field_names);
s->params.action_field_names = NULL;
s->params.n_actions = 0;
default_action_name = (uintptr_t)s->params.default_action_name;
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1340
error: while searching for:
const char **err_msg)
{
const char **new_action_names = NULL;
const char **new_action_field_names = NULL;
char *action_name = NULL, *action_field_name = NULL;
int has_args = 1;
/* Handle end of block. */
if ((n_tokens == 1) && !strcmp(tokens[0], "}")) {
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1468
error: while searching for:
}
/* Check input arguments. */
if ((n_tokens != 3) || strcmp(tokens[1], "args")) {
if (err_line)
*err_line = n_lines;
if (err_msg)
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1479
error: while searching for:
return -EINVAL;
}
if (!strcmp(tokens[2], "none"))
has_args = 0;
action_name = strdup(tokens[0]);
if (has_args)
action_field_name = strdup(tokens[2]);
new_action_names = realloc(s->params.action_names,
(s->params.n_actions + 1) * sizeof(char *));
new_action_field_names = realloc(s->params.action_field_names,
(s->params.n_actions + 1) * sizeof(char *));
if (!action_name ||
(has_args && !action_field_name) ||
!new_action_names ||
!new_action_field_names) {
free(action_name);
free(action_field_name);
free(new_action_names);
free(new_action_field_names);
if (err_line)
*err_line = n_lines;
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1487
error: while searching for:
s->params.action_names = new_action_names;
s->params.action_names[s->params.n_actions] = action_name;
s->params.action_field_names = new_action_field_names;
s->params.action_field_names[s->params.n_actions] = action_field_name;
s->params.n_actions++;
return 0;
error: patch failed: lib/pipeline/rte_swx_pipeline_spec.c:1519
Applying patch lib/pipeline/rte_swx_pipeline.c with 11 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Rejected hunk #5.
Rejected hunk #6.
Rejected hunk #7.
Rejected hunk #8.
Rejected hunk #9.
Rejected hunk #10.
Rejected hunk #11.
Applying patch lib/pipeline/rte_swx_pipeline.h with 1 reject...
Rejected hunk #1.
Applying patch lib/pipeline/rte_swx_pipeline_spec.c with 6 rejects...
Rejected hunk #1.
Rejected hunk #2.
Rejected hunk #3.
Rejected hunk #4.
Rejected hunk #5.
Rejected hunk #6.
diff a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c (rejected hunks)
@@ -2359,6 +2359,9 @@ action_find(struct rte_swx_pipeline *p, const char *name);
static int
action_has_nbo_args(struct action *a);
+static int
+learner_action_args_check(struct rte_swx_pipeline *p, struct action *a, const char *mf_name);
+
static int
instr_learn_translate(struct rte_swx_pipeline *p,
struct action *action,
@@ -2368,16 +2371,31 @@ instr_learn_translate(struct rte_swx_pipeline *p,
struct instruction_data *data __rte_unused)
{
struct action *a;
+ const char *mf_name;
+ uint32_t mf_offset = 0;
CHECK(action, EINVAL);
- CHECK(n_tokens == 2, EINVAL);
+ CHECK((n_tokens == 2) || (n_tokens == 3), EINVAL);
a = action_find(p, tokens[1]);
CHECK(a, EINVAL);
CHECK(!action_has_nbo_args(a), EINVAL);
+ mf_name = (n_tokens > 2) ? tokens[2] : NULL;
+ CHECK(!learner_action_args_check(p, a, mf_name), EINVAL);
+
+ if (mf_name) {
+ struct field *mf;
+
+ mf = metadata_field_parse(p, mf_name);
+ CHECK(mf, EINVAL);
+
+ mf_offset = mf->offset / 8;
+ }
+
instr->type = INSTR_LEARNER_LEARN;
instr->learn.action_id = a->id;
+ instr->learn.mf_offset = mf_offset;
return 0;
}
@@ -8165,7 +8183,6 @@ rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p,
CHECK(params->action_names, EINVAL);
for (i = 0; i < params->n_actions; i++) {
const char *action_name = params->action_names[i];
- const char *action_field_name = params->action_field_names[i];
struct action *a;
uint32_t action_data_size;
@@ -8174,10 +8191,6 @@ rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p,
a = action_find(p, action_name);
CHECK(a, EINVAL);
- status = learner_action_args_check(p, a, action_field_name);
- if (status)
- return status;
-
status = learner_action_learning_check(p,
a,
params->action_names,
@@ -8218,10 +8231,6 @@ rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p,
if (!l->actions)
goto nomem;
- l->action_arg = calloc(params->n_actions, sizeof(struct field *));
- if (!l->action_arg)
- goto nomem;
-
if (action_data_size_max) {
l->default_action_data = calloc(1, action_data_size_max);
if (!l->default_action_data)
@@ -8243,14 +8252,9 @@ rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p,
l->header = header;
- for (i = 0; i < params->n_actions; i++) {
- const char *mf_name = params->action_field_names[i];
-
+ for (i = 0; i < params->n_actions; i++)
l->actions[i] = action_find(p, params->action_names[i]);
- l->action_arg[i] = mf_name ? metadata_field_parse(p, mf_name) : NULL;
- }
-
l->default_action = default_action;
if (default_action->st)
@@ -8280,7 +8284,6 @@ rte_swx_pipeline_learner_config(struct rte_swx_pipeline *p,
if (!l)
return -ENOMEM;
- free(l->action_arg);
free(l->actions);
free(l->fields);
free(l);
@@ -8375,7 +8378,6 @@ learner_build_free(struct rte_swx_pipeline *p)
struct learner_runtime *r = &t->learners[j];
free(r->mailbox);
- free(r->action_data);
}
free(t->learners);
@@ -8419,7 +8421,6 @@ learner_build(struct rte_swx_pipeline *p)
TAILQ_FOREACH(l, &p->learners, node) {
struct learner_runtime *r = &t->learners[l->id];
uint64_t size;
- uint32_t j;
/* r->mailbox. */
size = rte_swx_table_learner_mailbox_size_get();
@@ -8435,21 +8436,6 @@ learner_build(struct rte_swx_pipeline *p)
r->key = l->header ?
&t->structs[l->header->struct_id] :
&t->structs[p->metadata_struct_id];
-
- /* r->action_data. */
- r->action_data = calloc(p->n_actions, sizeof(uint8_t *));
- if (!r->action_data) {
- status = -ENOMEM;
- goto error;
- }
-
- for (j = 0; j < l->n_actions; j++) {
- struct action *a = l->actions[j];
- struct field *mf = l->action_arg[j];
- uint8_t *m = t->structs[p->metadata_struct_id];
-
- r->action_data[a->id] = mf ? &m[mf->offset / 8] : NULL;
- }
}
}
@@ -8476,7 +8462,6 @@ learner_free(struct rte_swx_pipeline *p)
TAILQ_REMOVE(&p->learners, l, node);
free(l->fields);
free(l->actions);
- free(l->action_arg);
free(l->default_action_data);
free(l);
}
diff a/lib/pipeline/rte_swx_pipeline.h b/lib/pipeline/rte_swx_pipeline.h (rejected hunks)
@@ -696,16 +696,6 @@ struct rte_swx_pipeline_learner_params {
*/
uint32_t n_actions;
- /** This table type allows adding the latest lookup key (typically done
- * only in the case of lookup miss) to the table with a given action.
- * The action arguments are picked up from the packet meta-data: for
- * each action, a set of successive meta-data fields (with the name of
- * the first such field provided here) is 1:1 mapped to the action
- * arguments. These meta-data fields must be set with the actual values
- * of the action arguments before the key add operation.
- */
- const char **action_field_names;
-
/** The default table action that gets executed on lookup miss. Must be
* one of the table actions included in the *action_names*.
*/
diff a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c (rejected hunks)
@@ -1293,7 +1293,7 @@ selector_block_parse(struct selector_spec *s,
* ...
* }
* actions {
- * ACTION_NAME args METADATA_FIELD_NAME
+ * ACTION_NAME
* ...
* }
* default_action ACTION_NAME args none | ARGS_BYTE_ARRAY [ const ]
@@ -1340,15 +1340,6 @@ learner_spec_free(struct learner_spec *s)
free(s->params.action_names);
s->params.action_names = NULL;
- for (i = 0; i < s->params.n_actions; i++) {
- uintptr_t name = (uintptr_t)s->params.action_field_names[i];
-
- free((void *)name);
- }
-
- free(s->params.action_field_names);
- s->params.action_field_names = NULL;
-
s->params.n_actions = 0;
default_action_name = (uintptr_t)s->params.default_action_name;
@@ -1468,9 +1459,7 @@ learner_actions_block_parse(struct learner_spec *s,
const char **err_msg)
{
const char **new_action_names = NULL;
- const char **new_action_field_names = NULL;
- char *action_name = NULL, *action_field_name = NULL;
- int has_args = 1;
+ char *action_name = NULL;
/* Handle end of block. */
if ((n_tokens == 1) && !strcmp(tokens[0], "}")) {
@@ -1479,7 +1468,7 @@ learner_actions_block_parse(struct learner_spec *s,
}
/* Check input arguments. */
- if ((n_tokens != 3) || strcmp(tokens[1], "args")) {
+ if (n_tokens != 1) {
if (err_line)
*err_line = n_lines;
if (err_msg)
@@ -1487,28 +1476,14 @@ learner_actions_block_parse(struct learner_spec *s,
return -EINVAL;
}
- if (!strcmp(tokens[2], "none"))
- has_args = 0;
-
action_name = strdup(tokens[0]);
- if (has_args)
- action_field_name = strdup(tokens[2]);
-
new_action_names = realloc(s->params.action_names,
(s->params.n_actions + 1) * sizeof(char *));
- new_action_field_names = realloc(s->params.action_field_names,
- (s->params.n_actions + 1) * sizeof(char *));
-
- if (!action_name ||
- (has_args && !action_field_name) ||
- !new_action_names ||
- !new_action_field_names) {
+ if (!action_name || !new_action_names) {
free(action_name);
- free(action_field_name);
free(new_action_names);
- free(new_action_field_names);
if (err_line)
*err_line = n_lines;
@@ -1519,8 +1494,6 @@ learner_actions_block_parse(struct learner_spec *s,
s->params.action_names = new_action_names;
s->params.action_names[s->params.n_actions] = action_name;
- s->params.action_field_names = new_action_field_names;
- s->params.action_field_names[s->params.n_actions] = action_field_name;
s->params.n_actions++;
return 0;
https://lab.dpdk.org/results/dashboard/patchsets/18739/
UNH-IOL DPDK Community Lab
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-14 19:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 19:28 [dpdk-test-report] |WARNING| pw98863 [PATCH] pipeline: improve handling of learner table action arguments dpdklab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).