From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 4E8591B1A7 for ; Thu, 5 Oct 2017 11:49:26 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id z1so1625643wre.3 for ; Thu, 05 Oct 2017 02:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IkIAAHXWfg0PF8kV1MR3jUvnxlMeu/+yQ+f3sBR7oHU=; b=VkWIAIERmPOnm4tdAYmRuJpB2tONrkAvqxpe/RQwDdd9CRzZuSP2Rk65Ye+0bF6pom 0KIl1FC/EP4BmQXvK86Fib6zT/w2INeBD95vcTqB2sNF4fO4BQ7nRw0MbF9jfVUiN3ZP JDlY19YK3k3UlwC/b5lTzVGd8/WlglnbeHw9kE0qfRVDy3JP9btu6Saq6fPX2zkmt0at e+B/rbvq27Y4w0Ge51/8uvAMHzHnOS1JGLPTXcp34Qe8Gbc5tKHziWM9rWbcVnt735Xd WN9HNmfRGjizrCU7O80q0+3zCB706QA/d65RMyayg1piEGBkkuuYUFpUB3JKRanNshZr L44w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IkIAAHXWfg0PF8kV1MR3jUvnxlMeu/+yQ+f3sBR7oHU=; b=s6LoHKtZ+dHpumd9laqcXL/GgMtA8CTNQ1PP5tywymJj9tq+uC4kuWmKnJSUDMN1nw wzEvHIw4nq/QzacIF9+Z3Yih1wnn390oAjXsLCME4MDhUB27cpv0YVwbiDMAv7r2F1nf op+fxUDw94aG9/Q7i4AZ1aejSjtx1CDBee/y0+1WK96EUmz/21V5/dObXQOy54/MHsQ+ scVCLUrLvgmueI3ujx3El/H+aWMAYYIoLf+8eGCw+r2waHYa2813LHwQ+pha5NW0DWuj 8YZzTidWbT/7V0hHLJjDWnfqmvCpc5MpsU8AZUNMlmc8dB2zXix54QvjfsL3mBNYVPlB sABA== X-Gm-Message-State: AHPjjUipm0ppcGt2HatCBd8k+tAgKgFI1r0Io/U9LmjwPvTnBeTWEq4F UjaWO8s9ffGSfARJ5FZoUH25Qw== X-Google-Smtp-Source: AOwi7QBB+MIca8RME1ZMk+ELoM7He9naGeQDslTR6NbcWjK94kVmQ1zFFulYGMMrpKrA6wMzX9IVlA== X-Received: by 10.223.144.71 with SMTP id h65mr24014002wrh.41.1507196966554; Thu, 05 Oct 2017 02:49:26 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k9sm25765819wrk.27.2017.10.05.02.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 02:49:25 -0700 (PDT) From: Adrien Mazarguil To: Ferruh Yigit , Gaetan Rivet Cc: dev@dpdk.org Date: Thu, 5 Oct 2017 11:49:06 +0200 Message-Id: <1ff575184fb25a57ba30b0a2f703b566f1e4dfb2.1507193186.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 5/7] ethdev: enhance flow API item/action descriptions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2017 09:49:27 -0000 Enhance description structure with information about embedded flexible arrays in order to handle items and actions through a common function without any dedicated code for special cases. This commit also moves descriptions to a separate header file for clarity. Signed-off-by: Adrien Mazarguil --- lib/librte_ether/rte_flow.c | 183 ++++++------------- lib/librte_ether/rte_flow_conv.h | 333 ++++++++++++++++++++++++++++++++++ 2 files changed, 392 insertions(+), 124 deletions(-) diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index f4fb607..46f430e 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -37,75 +37,14 @@ #include #include +#include #include #include #include "rte_ethdev.h" +#include "rte_flow_conv.h" #include "rte_flow_driver.h" #include "rte_flow.h" -/** - * Flow elements description tables. - */ -struct rte_flow_desc_data { - const char *name; - size_t size; -}; - -/** Generate flow_item[] entry. */ -#define MK_FLOW_ITEM(t, s) \ - [RTE_FLOW_ITEM_TYPE_ ## t] = { \ - .name = # t, \ - .size = s, \ - } - -/** Information about known flow pattern items. */ -static const struct rte_flow_desc_data rte_flow_desc_item[] = { - MK_FLOW_ITEM(END, 0), - MK_FLOW_ITEM(VOID, 0), - MK_FLOW_ITEM(INVERT, 0), - MK_FLOW_ITEM(ANY, sizeof(struct rte_flow_item_any)), - MK_FLOW_ITEM(PF, 0), - MK_FLOW_ITEM(VF, sizeof(struct rte_flow_item_vf)), - MK_FLOW_ITEM(PORT, sizeof(struct rte_flow_item_port)), - MK_FLOW_ITEM(RAW, sizeof(struct rte_flow_item_raw)), /* +pattern[] */ - MK_FLOW_ITEM(ETH, sizeof(struct rte_flow_item_eth)), - MK_FLOW_ITEM(VLAN, sizeof(struct rte_flow_item_vlan)), - MK_FLOW_ITEM(IPV4, sizeof(struct rte_flow_item_ipv4)), - MK_FLOW_ITEM(IPV6, sizeof(struct rte_flow_item_ipv6)), - MK_FLOW_ITEM(ICMP, sizeof(struct rte_flow_item_icmp)), - MK_FLOW_ITEM(UDP, sizeof(struct rte_flow_item_udp)), - MK_FLOW_ITEM(TCP, sizeof(struct rte_flow_item_tcp)), - MK_FLOW_ITEM(SCTP, sizeof(struct rte_flow_item_sctp)), - MK_FLOW_ITEM(VXLAN, sizeof(struct rte_flow_item_vxlan)), - MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), - MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)), - MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)), - MK_FLOW_ITEM(NVGRE, sizeof(struct rte_flow_item_nvgre)), -}; - -/** Generate flow_action[] entry. */ -#define MK_FLOW_ACTION(t, s) \ - [RTE_FLOW_ACTION_TYPE_ ## t] = { \ - .name = # t, \ - .size = s, \ - } - -/** Information about known flow actions. */ -static const struct rte_flow_desc_data rte_flow_desc_action[] = { - MK_FLOW_ACTION(END, 0), - MK_FLOW_ACTION(VOID, 0), - MK_FLOW_ACTION(PASSTHRU, 0), - MK_FLOW_ACTION(MARK, sizeof(struct rte_flow_action_mark)), - MK_FLOW_ACTION(FLAG, 0), - MK_FLOW_ACTION(QUEUE, sizeof(struct rte_flow_action_queue)), - MK_FLOW_ACTION(DROP, 0), - MK_FLOW_ACTION(COUNT, 0), - MK_FLOW_ACTION(DUP, sizeof(struct rte_flow_action_dup)), - MK_FLOW_ACTION(RSS, sizeof(struct rte_flow_action_rss)), /* +queue[] */ - MK_FLOW_ACTION(PF, 0), - MK_FLOW_ACTION(VF, sizeof(struct rte_flow_action_vf)), -}; - /* Get generic flow operations structure from a port. */ const struct rte_flow_ops * rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error) @@ -243,59 +182,39 @@ rte_flow_isolate(uint8_t port_id, NULL, rte_strerror(ENOSYS)); } -/** Compute storage space needed by item specification. */ -static void -flow_item_spec_size(const struct rte_flow_item *item, - size_t *size, size_t *pad) -{ - if (!item->spec) { - *size = 0; - goto empty; - } - switch (item->type) { - union { - const struct rte_flow_item_raw *raw; - } spec; - - /* Not a fall-through */ - case RTE_FLOW_ITEM_TYPE_RAW: - spec.raw = item->spec; - *size = offsetof(struct rte_flow_item_raw, pattern) + - spec.raw->length * sizeof(*spec.raw->pattern); - break; - default: - *size = rte_flow_desc_item[item->type].size; - break; - } -empty: - *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size; -} - -/** Compute storage space needed by action configuration. */ +/** Compute storage space needed for item->spec or action->conf. */ static void -flow_action_conf_size(const struct rte_flow_action *action, - size_t *size, size_t *pad) +rte_flow_conv_res_size(const struct rte_flow_conv_res *res, const void *obj, + size_t *size, size_t *pad) { - if (!action->conf) { + if (!obj) { *size = 0; - goto empty; - } - switch (action->type) { - union { - const struct rte_flow_action_rss *rss; - } conf; - - /* Not a fall-through. */ - case RTE_FLOW_ACTION_TYPE_RSS: - conf.rss = action->conf; - *size = offsetof(struct rte_flow_action_rss, queue) + - conf.rss->num * sizeof(*conf.rss->queue); - break; - default: - *size = rte_flow_desc_action[action->type].size; - break; + } else if (res->flex_off) { + void *flex_len_ptr = + (void *)((uintptr_t)obj + res->flex_len_off); + uint64_t flex_len = 0; + + switch (res->flex_len_type) { + case sizeof(uint8_t): + flex_len = *(uint8_t *)flex_len_ptr; + break; + case sizeof(uint16_t): + flex_len = *(uint16_t *)flex_len_ptr; + break; + case sizeof(uint32_t): + flex_len = *(uint32_t *)flex_len_ptr; + break; + case sizeof(uint64_t): + flex_len = *(uint64_t *)flex_len_ptr; + break; + default: + RTE_ASSERT(!"unsupported flex_len_type in" + " struct rte_flow_conv_res"); + } + *size = res->flex_off + res->flex_elt_size * flex_len; + } else { + *size = res->size; } -empty: *pad = RTE_ALIGN_CEIL(*size, sizeof(double)) - *size; } @@ -315,15 +234,17 @@ rte_flow_conv_pattern(struct rte_flow_item *dst, store: for (off = 0, i = 0; !num || i != num; ++i, ++src, ++dst) { + const struct rte_flow_conv_res *res = + &rte_flow_conv_res_item[src->type]; size_t spec; size_t pad; - if ((size_t)src->type >= RTE_DIM(rte_flow_desc_item) || - !rte_flow_desc_item[src->type].name) + if ((size_t)src->type >= RTE_DIM(rte_flow_conv_res_item) || + !res->name) goto notsup; if (store) *dst = (struct rte_flow_item){ .type = src->type, }; - flow_item_spec_size(src, &spec, &pad); + rte_flow_conv_res_size(res, src->spec, &spec, &pad); if (spec) off = RTE_ALIGN_CEIL(off, sizeof(double)); if (src->spec) { @@ -380,15 +301,17 @@ rte_flow_conv_actions(struct rte_flow_action *dst, store: for (off = 0, i = 0; !num || i != num; ++i, ++src, ++dst) { + const struct rte_flow_conv_res *res = + &rte_flow_conv_res_action[src->type]; size_t conf; size_t pad; - if ((size_t)src->type >= RTE_DIM(rte_flow_desc_action) || - !rte_flow_desc_action[src->type].name) + if ((size_t)src->type >= RTE_DIM(rte_flow_conv_res_action) || + !res->name) goto notsup; if (store) *dst = (struct rte_flow_action){ .type = src->type, }; - flow_action_conf_size(src, &conf, &pad); + rte_flow_conv_res_size(res, src->conf, &conf, &pad); if (conf) off = RTE_ALIGN_CEIL(off, sizeof(double)); if (store && conf) @@ -474,11 +397,17 @@ rte_flow_conv_name(int is_action, struct rte_flow_error *error) { const struct { - const struct rte_flow_desc_data *data; + const struct rte_flow_conv_res *data; size_t num; } res_data[2] = { - { rte_flow_desc_item, RTE_DIM(rte_flow_desc_item), }, - { rte_flow_desc_action, RTE_DIM(rte_flow_desc_action), }, + { + rte_flow_conv_res_item, + RTE_DIM(rte_flow_conv_res_item), + }, + { + rte_flow_conv_res_action, + RTE_DIM(rte_flow_conv_res_action), + }, }, *const res = &res_data[!!is_action]; unsigned int obj_type = (uintptr_t)src; @@ -498,11 +427,17 @@ rte_flow_conv_name_ptr(int is_action, struct rte_flow_error *error) { const struct { - const struct rte_flow_desc_data *data; + const struct rte_flow_conv_res *data; size_t num; } res_data[2] = { - { rte_flow_desc_item, RTE_DIM(rte_flow_desc_item), }, - { rte_flow_desc_action, RTE_DIM(rte_flow_desc_action), }, + { + rte_flow_conv_res_item, + RTE_DIM(rte_flow_conv_res_item), + }, + { + rte_flow_conv_res_action, + RTE_DIM(rte_flow_conv_res_action), + }, }, *const res = &res_data[!!is_action]; unsigned int obj_type = (uintptr_t)src; diff --git a/lib/librte_ether/rte_flow_conv.h b/lib/librte_ether/rte_flow_conv.h new file mode 100644 index 0000000..2244970 --- /dev/null +++ b/lib/librte_ether/rte_flow_conv.h @@ -0,0 +1,333 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 6WIND S.A. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of 6WIND S.A. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * RTE generic flow API (internal) + * + * This file exports resources needed by rte_flow_conv(). + */ + +#ifndef RTE_FLOW_CONV_H_ +#define RTE_FLOW_CONV_H_ + +#include + +#include "rte_flow.h" + +/** + * This structure describes either a pattern item or an action as well as + * their associated specification or configuration structure. + */ +struct rte_flow_conv_res { + const char *name; /**< Object name. */ + const void *mask; /**< Default mask for structure if relevant. */ + size_t size; /**< Associated structure size. */ + size_t flex_len_type; /**< Length field type for flexible array. */ + size_t flex_len_off; /**< Length field offset for flexible array. */ + size_t flex_elt_size; /**< Flexible array element size. */ + size_t flex_off; /**< Flexible array field offset. */ +}; + +/** Pattern items description table. */ +static const struct rte_flow_conv_res rte_flow_conv_res_item[] = { + [RTE_FLOW_ITEM_TYPE_END] = { + .name = "end", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_VOID] = { + .name = "void", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_INVERT] = { + .name = "invert", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_ANY] = { + .name = "any", + .size = sizeof(struct rte_flow_item_any), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_PF] = { + .name = "pf", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_VF] = { + .name = "vf", + .size = sizeof(struct rte_flow_item_vf), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_PORT] = { + .name = "port", + .size = sizeof(struct rte_flow_item_port), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_RAW] = { + .name = "raw", + .size = sizeof(struct rte_flow_item_raw), + .flex_len_type = sizeof(((struct rte_flow_item_raw *)0)->length), + .flex_len_off = offsetof(struct rte_flow_item_raw, length), + .flex_elt_size = sizeof(((struct rte_flow_item_raw *)0)->pattern[0]), + .flex_off = offsetof(struct rte_flow_item_raw, pattern), + }, + [RTE_FLOW_ITEM_TYPE_ETH] = { + .name = "eth", + .size = sizeof(struct rte_flow_item_eth), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_VLAN] = { + .name = "vlan", + .size = sizeof(struct rte_flow_item_vlan), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_IPV4] = { + .name = "ipv4", + .size = sizeof(struct rte_flow_item_ipv4), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_IPV6] = { + .name = "ipv6", + .size = sizeof(struct rte_flow_item_ipv6), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_ICMP] = { + .name = "icmp", + .size = sizeof(struct rte_flow_item_icmp), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_UDP] = { + .name = "udp", + .size = sizeof(struct rte_flow_item_udp), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_TCP] = { + .name = "tcp", + .size = sizeof(struct rte_flow_item_tcp), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_SCTP] = { + .name = "sctp", + .size = sizeof(struct rte_flow_item_sctp), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_VXLAN] = { + .name = "vxlan", + .size = sizeof(struct rte_flow_item_vxlan), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_E_TAG] = { + .name = "e_tag", + .size = sizeof(struct rte_flow_item_e_tag), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_NVGRE] = { + .name = "nvgre", + .size = sizeof(struct rte_flow_item_nvgre), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_MPLS] = { + .name = "mpls", + .size = sizeof(struct rte_flow_item_mpls), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ITEM_TYPE_GRE] = { + .name = "gre", + .size = sizeof(struct rte_flow_item_gre), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, +}; + +/** Actions description table. */ +static const struct rte_flow_conv_res rte_flow_conv_res_action[] = { + [RTE_FLOW_ACTION_TYPE_END] = { + .name = "end", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_VOID] = { + .name = "void", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_PASSTHRU] = { + .name = "passthru", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_MARK] = { + .name = "mark", + .size = sizeof(struct rte_flow_action_mark), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_FLAG] = { + .name = "flag", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_QUEUE] = { + .name = "queue", + .size = sizeof(struct rte_flow_action_queue), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_DROP] = { + .name = "drop", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_COUNT] = { + .name = "count", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_DUP] = { + .name = "dup", + .size = sizeof(struct rte_flow_action_dup), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_RSS] = { + .name = "rss", + .size = sizeof(struct rte_flow_action_rss), + .flex_len_type = sizeof(((struct rte_flow_action_rss *)0)->num), + .flex_len_off = offsetof(struct rte_flow_action_rss, num), + .flex_elt_size = sizeof(((struct rte_flow_action_rss *)0)->queue[0]), + .flex_off = offsetof(struct rte_flow_action_rss, queue), + }, + [RTE_FLOW_ACTION_TYPE_PF] = { + .name = "pf", + .size = 0, + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, + [RTE_FLOW_ACTION_TYPE_VF] = { + .name = "vf", + .size = sizeof(struct rte_flow_action_vf), + .flex_len_type = 0, + .flex_len_off = 0, + .flex_elt_size = 0, + .flex_off = 0, + }, +}; + +#endif /* RTE_FLOW_CONV_H_ */ -- 2.1.4