summaryrefslogtreecommitdiff
path: root/include/sparse
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-04-26 11:08:49 +0300
committerIlya Maximets <i.maximets@samsung.com>2019-06-06 18:54:57 +0300
commit50f48c27e282db4fabdeb737d715d5bbedd1877a (patch)
tree885035963222f28db450629647cc458403c6e76b /include/sparse
parent346c653823d097a4a19fcf5298ec905e8bb5cacd (diff)
downloadopenvswitch-50f48c27e282db4fabdeb737d715d5bbedd1877a.tar.gz
sparse: Re-allow sparse builds with dpdk.
Few structures from rte_flow.h updated to the version from DPDK 18.11 to fix incorrect structure definitions. rte_lcore.h and rte_vect.h "sparse" headers removed because not needed and only produce type-mismatch issues. Enabled -Werror for sparse builds with DPDK to prevent regressions. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/sparse')
-rw-r--r--include/sparse/automake.mk2
-rw-r--r--include/sparse/rte_flow.h55
-rw-r--r--include/sparse/rte_lcore.h23
-rw-r--r--include/sparse/rte_vect.h23
4 files changed, 45 insertions, 58 deletions
diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk
index 274d52577..f65c27255 100644
--- a/include/sparse/automake.mk
+++ b/include/sparse/automake.mk
@@ -17,9 +17,7 @@ noinst_HEADERS += \
include/sparse/netpacket/packet.h \
include/sparse/pthread.h \
include/sparse/rte_atomic.h \
- include/sparse/rte_lcore.h \
include/sparse/rte_memcpy.h \
- include/sparse/rte_vect.h \
include/sparse/sys/socket.h \
include/sparse/sys/sysmacros.h \
include/sparse/sys/types.h \
diff --git a/include/sparse/rte_flow.h b/include/sparse/rte_flow.h
index a36ab45e7..02fa523b4 100644
--- a/include/sparse/rte_flow.h
+++ b/include/sparse/rte_flow.h
@@ -48,6 +48,7 @@
#include <rte_arp.h>
#include <rte_ether.h>
+#include <rte_eth_ctrl.h>
#include <rte_icmp.h>
#include <rte_ip.h>
#include <rte_sctp.h>
@@ -497,19 +498,20 @@ static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
*
* Matches an 802.1Q/ad VLAN tag.
*
- * This type normally follows either RTE_FLOW_ITEM_TYPE_ETH or
- * RTE_FLOW_ITEM_TYPE_VLAN.
+ * The corresponding standard outer EtherType (TPID) values are
+ * ETHER_TYPE_VLAN or ETHER_TYPE_QINQ. It can be overridden by the preceding
+ * pattern item.
*/
struct rte_flow_item_vlan {
- rte_be16_t tpid; /**< Tag protocol identifier. */
rte_be16_t tci; /**< Tag control information. */
+ rte_be16_t inner_type; /**< Inner EtherType or TPID. */
};
/** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
#ifndef __cplusplus
static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
- .tpid = RTE_BE16(0x0000),
- .tci = RTE_BE16(0xffff),
+ .tci = RTE_BE16(0x0fff),
+ .inner_type = RTE_BE16(0x0000),
};
#endif
@@ -1074,16 +1076,49 @@ struct rte_flow_action_dup {
* Similar to QUEUE, except RSS is additionally performed on packets to
* spread them among several queues according to the provided parameters.
*
+ * Unlike global RSS settings used by other DPDK APIs, unsetting the
+ * @p types field does not disable RSS in a flow rule. Doing so instead
+ * requests safe unspecified "best-effort" settings from the underlying PMD,
+ * which depending on the flow rule, may result in anything ranging from
+ * empty (single queue) to all-inclusive RSS.
+ *
* Note: RSS hash result is stored in the hash.rss mbuf field which overlaps
* hash.fdir.lo. Since the MARK action sets the hash.fdir.hi field only,
* both can be requested simultaneously.
- *
- * Terminating by default.
*/
struct rte_flow_action_rss {
- const struct rte_eth_rss_conf *rss_conf; /**< RSS parameters. */
- uint16_t num; /**< Number of entries in queue[]. */
- uint16_t queue[]; /**< Queues indices to use. */
+ enum rte_eth_hash_function func; /**< RSS hash function to apply. */
+ /**
+ * Packet encapsulation level RSS hash @p types apply to.
+ *
+ * - @p 0 requests the default behavior. Depending on the packet
+ * type, it can mean outermost, innermost, anything in between or
+ * even no RSS.
+ *
+ * It basically stands for the innermost encapsulation level RSS
+ * can be performed on according to PMD and device capabilities.
+ *
+ * - @p 1 requests RSS to be performed on the outermost packet
+ * encapsulation level.
+ *
+ * - @p 2 and subsequent values request RSS to be performed on the
+ * specified inner packet encapsulation level, from outermost to
+ * innermost (lower to higher values).
+ *
+ * Values other than @p 0 are not necessarily supported.
+ *
+ * Requesting a specific RSS level on unrecognized traffic results
+ * in undefined behavior. For predictable results, it is recommended
+ * to make the flow rule pattern match packet headers up to the
+ * requested encapsulation level so that only matching traffic goes
+ * through.
+ */
+ uint32_t level;
+ uint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */
+ uint32_t key_len; /**< Hash key length in bytes. */
+ uint32_t queue_num; /**< Number of entries in @p queue. */
+ const uint8_t *key; /**< Hash key. */
+ const uint16_t *queue; /**< Queue indices to use. */
};
/**
diff --git a/include/sparse/rte_lcore.h b/include/sparse/rte_lcore.h
deleted file mode 100644
index 584bfe12c..000000000
--- a/include/sparse/rte_lcore.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CHECKER__
-#error "Use this header only with sparse. It is not a correct implementation."
-#endif
-
-typedef int rte_cpuset_t;
-
-/* Get actual <rte_lcore.h> definitions for us to annotate and build on. */
-#include_next <rte_lcore.h>
diff --git a/include/sparse/rte_vect.h b/include/sparse/rte_vect.h
deleted file mode 100644
index 6f6625b7d..000000000
--- a/include/sparse/rte_vect.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CHECKER__
-#error "Use this header only with sparse. It is not a correct implementation."
-#endif
-
-typedef int __m128i;
-
-/* Get actual <rte_vect.h> definitions for us to annotate and build on. */
-#include_next <rte_vect.h>