]> git.proxmox.com Git - mirror_ovs.git/commitdiff
sparse: Re-allow sparse builds with dpdk.
authorIlya Maximets <i.maximets@samsung.com>
Fri, 26 Apr 2019 08:08:49 +0000 (11:08 +0300)
committerIlya Maximets <i.maximets@samsung.com>
Thu, 6 Jun 2019 15:54:57 +0000 (18:54 +0300)
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>
.travis/linux-build.sh
include/sparse/automake.mk
include/sparse/rte_flow.h
include/sparse/rte_lcore.h [deleted file]
include/sparse/rte_vect.h [deleted file]

index 62344689e973d657cae19ac07c8a5fc3a6608b89..c6d9ae12000363d15a756107610549288df1870e 100755 (executable)
@@ -99,8 +99,8 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
         CFLAGS="$CFLAGS -Wno-cast-align"
     fi
     EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build"
-elif [ "$CC" != "clang" ]; then
-    # DPDK headers currently trigger sparse errors
+fi
+if [ "$CC" != "clang" ]; then
     SPARSE_FLAGS="$SPARSE_FLAGS -Wsparse-error"
 fi
 
index 274d52577b0e4dd0522c18f397518e2b9dec0a98..f65c2725509cf6dd6bf4c6d7af692388938503f2 100644 (file)
@@ -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 \
index a36ab45e7ca2f697b37110d4c2fe2e26e18346d6..02fa523b4fefb9d82a8148494b79575123fdbfb6 100644 (file)
@@ -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 (file)
index 584bfe1..0000000
+++ /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 (file)
index 6f6625b..0000000
+++ /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>