doc: update qede management firmware guide
[dpdk.git] / app / test-pmd / cmdline_flow.c
index 6e9fa5d..934cf7e 100644 (file)
@@ -91,6 +91,8 @@ enum index {
        ITEM_PHY_PORT_INDEX,
        ITEM_PORT_ID,
        ITEM_PORT_ID_ID,
+       ITEM_MARK,
+       ITEM_MARK_ID,
        ITEM_RAW,
        ITEM_RAW_RELATIVE,
        ITEM_RAW_SEARCH,
@@ -192,6 +194,8 @@ enum index {
        ACTION_QUEUE_INDEX,
        ACTION_DROP,
        ACTION_COUNT,
+       ACTION_COUNT_SHARED,
+       ACTION_COUNT_ID,
        ACTION_RSS,
        ACTION_RSS_FUNC,
        ACTION_RSS_LEVEL,
@@ -418,7 +422,7 @@ struct buffer {
                } destroy; /**< Destroy arguments. */
                struct {
                        uint32_t rule;
-                       enum rte_flow_action_type action;
+                       struct rte_flow_action action;
                } query; /**< Query arguments. */
                struct {
                        uint32_t *group;
@@ -494,6 +498,7 @@ static const enum index next_item[] = {
        ITEM_VF,
        ITEM_PHY_PORT,
        ITEM_PORT_ID,
+       ITEM_MARK,
        ITEM_RAW,
        ITEM_ETH,
        ITEM_VLAN,
@@ -555,6 +560,12 @@ static const enum index item_port_id[] = {
        ZERO,
 };
 
+static const enum index item_mark[] = {
+       ITEM_MARK_ID,
+       ITEM_NEXT,
+       ZERO,
+};
+
 static const enum index item_raw[] = {
        ITEM_RAW_RELATIVE,
        ITEM_RAW_SEARCH,
@@ -779,6 +790,13 @@ static const enum index action_queue[] = {
        ZERO,
 };
 
+static const enum index action_count[] = {
+       ACTION_COUNT_ID,
+       ACTION_COUNT_SHARED,
+       ACTION_NEXT,
+       ZERO,
+};
+
 static const enum index action_rss[] = {
        ACTION_RSS_FUNC,
        ACTION_RSS_LEVEL,
@@ -1092,7 +1110,7 @@ static const struct token token_list[] = {
                .next = NEXT(NEXT_ENTRY(QUERY_ACTION),
                             NEXT_ENTRY(RULE_ID),
                             NEXT_ENTRY(PORT_ID)),
-               .args = ARGS(ARGS_ENTRY(struct buffer, args.query.action),
+               .args = ARGS(ARGS_ENTRY(struct buffer, args.query.action.type),
                             ARGS_ENTRY(struct buffer, args.query.rule),
                             ARGS_ENTRY(struct buffer, port)),
                .call = parse_query,
@@ -1289,6 +1307,19 @@ static const struct token token_list[] = {
                .next = NEXT(item_port_id, NEXT_ENTRY(UNSIGNED), item_param),
                .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port_id, id)),
        },
+       [ITEM_MARK] = {
+               .name = "mark",
+               .help = "match traffic against value set in previously matched rule",
+               .priv = PRIV_ITEM(MARK, sizeof(struct rte_flow_item_mark)),
+               .next = NEXT(item_mark),
+               .call = parse_vc,
+       },
+       [ITEM_MARK_ID] = {
+               .name = "id",
+               .help = "Integer value to match against",
+               .next = NEXT(item_mark, NEXT_ENTRY(UNSIGNED), item_param),
+               .args = ARGS(ARGS_ENTRY(struct rte_flow_item_mark, id)),
+       },
        [ITEM_RAW] = {
                .name = "raw",
                .help = "match an arbitrary byte string",
@@ -2000,10 +2031,26 @@ static const struct token token_list[] = {
        [ACTION_COUNT] = {
                .name = "count",
                .help = "enable counters for this rule",
-               .priv = PRIV_ACTION(COUNT, 0),
-               .next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+               .priv = PRIV_ACTION(COUNT,
+                                   sizeof(struct rte_flow_action_count)),
+               .next = NEXT(action_count),
                .call = parse_vc,
        },
+       [ACTION_COUNT_ID] = {
+               .name = "identifier",
+               .help = "counter identifier to use",
+               .next = NEXT(action_count, NEXT_ENTRY(UNSIGNED)),
+               .args = ARGS(ARGS_ENTRY(struct rte_flow_action_count, id)),
+               .call = parse_vc_conf,
+       },
+       [ACTION_COUNT_SHARED] = {
+               .name = "shared",
+               .help = "shared counter",
+               .next = NEXT(action_count, NEXT_ENTRY(BOOLEAN)),
+               .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_action_count,
+                                          shared, 1)),
+               .call = parse_vc_conf,
+       },
        [ACTION_RSS] = {
                .name = "rss",
                .help = "spread packets among several queues",
@@ -2750,7 +2797,8 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
                        .key = action_rss_data->key,
                        .queue = action_rss_data->queue,
                },
-               .key = "testpmd's default RSS hash key",
+               .key = "testpmd's default RSS hash key, "
+                       "override it for better balancing",
                .queue = { 0 },
        };
        for (i = 0; i < action_rss_data->conf.queue_num; ++i)
@@ -2874,7 +2922,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
        i = ctx->objdata >> 16;
        if (!strcmp_partial("end", str, len)) {
                ctx->objdata &= 0xffff;
-               return len;
+               goto end;
        }
        if (i >= ACTION_RSS_QUEUE_NUM)
                return -1;
@@ -2894,6 +2942,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token,
        if (ctx->next_num == RTE_DIM(ctx->next))
                return -1;
        ctx->next[ctx->next_num++] = next;
+end:
        if (!ctx->object)
                return len;
        action_rss_data = ctx->object;
@@ -3820,7 +3869,7 @@ cmd_flow_parsed(const struct buffer *in)
                break;
        case QUERY:
                port_flow_query(in->port, in->args.query.rule,
-                               in->args.query.action);
+                               &in->args.query.action);
                break;
        case LIST:
                port_flow_list(in->port, in->args.list.group_n,