diff options
author | arybchik <arybchik@FreeBSD.org> | 2017-01-01 19:18:40 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2017-01-01 19:18:40 +0000 |
commit | a287e069d3e68dbca5ac3600b83cc2d568b42596 (patch) | |
tree | 2fbd4bdda7104a6e1891354ae270478702de4ad3 /sys/dev/sfxge | |
parent | 383532fe2345f3881b7d69d961b89c989a034c4c (diff) | |
download | FreeBSD-src-a287e069d3e68dbca5ac3600b83cc2d568b42596.zip FreeBSD-src-a287e069d3e68dbca5ac3600b83cc2d568b42596.tar.gz |
MFC r310756
sfxge(4): do not use enum type when values are bitmask
ICC complains that enumerated type mixed with another type.
Found by DPDK upstream build sanity check.
Sponsored by: Solarflare Communications, Inc.
Diffstat (limited to 'sys/dev/sfxge')
-rw-r--r-- | sys/dev/sfxge/common/ef10_rx.c | 8 | ||||
-rw-r--r-- | sys/dev/sfxge/common/efx.h | 12 | ||||
-rw-r--r-- | sys/dev/sfxge/common/efx_rx.c | 8 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_rx.c | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/sfxge/common/ef10_rx.c b/sys/dev/sfxge/common/ef10_rx.c index 7f18026..f6c26a4 100644 --- a/sys/dev/sfxge/common/ef10_rx.c +++ b/sys/dev/sfxge/common/ef10_rx.c @@ -297,13 +297,13 @@ efx_mcdi_rss_context_set_flags( MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN, - (type & (1U << EFX_RX_HASH_IPV4)) ? 1 : 0, + (type & EFX_RX_HASH_IPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN, - (type & (1U << EFX_RX_HASH_TCPIPV4)) ? 1 : 0, + (type & EFX_RX_HASH_TCPIPV4) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN, - (type & (1U << EFX_RX_HASH_IPV6)) ? 1 : 0, + (type & EFX_RX_HASH_IPV6) ? 1 : 0, RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN, - (type & (1U << EFX_RX_HASH_TCPIPV6)) ? 1 : 0); + (type & EFX_RX_HASH_TCPIPV6) ? 1 : 0); efx_mcdi_execute(enp, &req); diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h index 068fdda..c14b0d4 100644 --- a/sys/dev/sfxge/common/efx.h +++ b/sys/dev/sfxge/common/efx.h @@ -1867,12 +1867,12 @@ typedef enum efx_rx_hash_alg_e { EFX_RX_HASHALG_TOEPLITZ } efx_rx_hash_alg_t; -typedef enum efx_rx_hash_type_e { - EFX_RX_HASH_IPV4 = 0, - EFX_RX_HASH_TCPIPV4, - EFX_RX_HASH_IPV6, - EFX_RX_HASH_TCPIPV6, -} efx_rx_hash_type_t; +#define EFX_RX_HASH_IPV4 (1U << 0) +#define EFX_RX_HASH_TCPIPV4 (1U << 1) +#define EFX_RX_HASH_IPV6 (1U << 2) +#define EFX_RX_HASH_TCPIPV6 (1U << 3) + +typedef unsigned int efx_rx_hash_type_t; typedef enum efx_rx_hash_support_e { EFX_RX_HASH_UNAVAILABLE = 0, /* Hardware hash not inserted */ diff --git a/sys/dev/sfxge/common/efx_rx.c b/sys/dev/sfxge/common/efx_rx.c index cc43aef..8ae16e5 100644 --- a/sys/dev/sfxge/common/efx_rx.c +++ b/sys/dev/sfxge/common/efx_rx.c @@ -731,12 +731,12 @@ siena_rx_scale_mode_set( case EFX_RX_HASHALG_TOEPLITZ: EFX_RX_TOEPLITZ_IPV4_HASH(enp, insert, - type & (1 << EFX_RX_HASH_IPV4), - type & (1 << EFX_RX_HASH_TCPIPV4)); + type & EFX_RX_HASH_IPV4, + type & EFX_RX_HASH_TCPIPV4); EFX_RX_TOEPLITZ_IPV6_HASH(enp, - type & (1 << EFX_RX_HASH_IPV6), - type & (1 << EFX_RX_HASH_TCPIPV6), + type & EFX_RX_HASH_IPV6, + type & EFX_RX_HASH_TCPIPV6, rc); if (rc != 0) goto fail1; diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c index cd38281..d5278c8 100644 --- a/sys/dev/sfxge/sfxge_rx.c +++ b/sys/dev/sfxge/sfxge_rx.c @@ -1140,8 +1140,8 @@ sfxge_rx_start(struct sfxge_softc *sc) nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, - (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | - (1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE); + EFX_RX_HASH_IPV4 | EFX_RX_HASH_TCPIPV4 | + EFX_RX_HASH_IPV6 | EFX_RX_HASH_TCPIPV6, B_TRUE); #ifdef RSS rss_getkey(toep_key); |