Skip to content

Commit

Permalink
sparse: Re-allow sparse builds with dpdk.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya committed Jun 6, 2019
1 parent 346c653 commit 50f48c2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .travis/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions include/sparse/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
55 changes: 45 additions & 10 deletions include/sparse/rte_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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. */
};

/**
Expand Down
23 changes: 0 additions & 23 deletions include/sparse/rte_lcore.h

This file was deleted.

23 changes: 0 additions & 23 deletions include/sparse/rte_vect.h

This file was deleted.

0 comments on commit 50f48c2

Please sign in to comment.