Date: Sun, 1 Jan 2017 19:16:57 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311022 - stable/11/sys/dev/sfxge/common Message-ID: <201701011916.v01JGvUZ048944@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Sun Jan 1 19:16:57 2017 New Revision: 311022 URL: https://svnweb.freebsd.org/changeset/base/311022 Log: MFC r310755 sfxge(4): do not use enum for filter flags It is not 100% correct to assign non-enum values to enum type variables. Found by ICC build (DPDK PMD upstreaming). Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c stable/11/sys/dev/sfxge/common/efx.h stable/11/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/11/sys/dev/sfxge/common/ef10_filter.c Sun Jan 1 19:15:08 2017 (r311021) +++ stable/11/sys/dev/sfxge/common/ef10_filter.c Sun Jan 1 19:16:57 2017 (r311022) @@ -985,7 +985,7 @@ static __checkReturn efx_rc_t ef10_filter_insert_unicast( __in efx_nic_t *enp, __in_ecount(6) uint8_t const *addr, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -1016,7 +1016,7 @@ fail1: static __checkReturn efx_rc_t ef10_filter_insert_all_unicast( __in efx_nic_t *enp, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -1050,7 +1050,7 @@ ef10_filter_insert_multicast_list( __in boolean_t brdcst, __in_ecount(6*count) uint8_t const *addrs, __in uint32_t count, - __in efx_filter_flag_t filter_flags, + __in efx_filter_flags_t filter_flags, __in boolean_t rollback) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; @@ -1143,7 +1143,7 @@ fail1: static __checkReturn efx_rc_t ef10_filter_insert_all_multicast( __in efx_nic_t *enp, - __in efx_filter_flag_t filter_flags) + __in efx_filter_flags_t filter_flags) { ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t spec; @@ -1245,7 +1245,7 @@ ef10_filter_reconfigure( { efx_nic_cfg_t *encp = &enp->en_nic_cfg; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; - efx_filter_flag_t filter_flags; + efx_filter_flags_t filter_flags; unsigned int i; efx_rc_t all_unicst_rc = 0; efx_rc_t all_mulcst_rc = 0; Modified: stable/11/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/11/sys/dev/sfxge/common/efx.h Sun Jan 1 19:15:08 2017 (r311021) +++ stable/11/sys/dev/sfxge/common/efx.h Sun Jan 1 19:16:57 2017 (r311022) @@ -2180,20 +2180,22 @@ efx_tx_qdestroy( #define EFX_IPPROTO_TCP 6 #define EFX_IPPROTO_UDP 17 -typedef enum efx_filter_flag_e { - EFX_FILTER_FLAG_RX_RSS = 0x01, /* use RSS to spread across - * multiple queues */ - EFX_FILTER_FLAG_RX_SCATTER = 0x02, /* enable RX scatter */ - EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04, /* Override an automatic filter - * (priority EFX_FILTER_PRI_AUTO). - * May only be set by the filter - * implementation for each type. - * A removal request will - * restore the automatic filter - * in its place. */ - EFX_FILTER_FLAG_RX = 0x08, /* Filter is for RX */ - EFX_FILTER_FLAG_TX = 0x10, /* Filter is for TX */ -} efx_filter_flag_t; +/* Use RSS to spread across multiple queues */ +#define EFX_FILTER_FLAG_RX_RSS 0x01 +/* Enable RX scatter */ +#define EFX_FILTER_FLAG_RX_SCATTER 0x02 +/* + * Override an automatic filter (priority EFX_FILTER_PRI_AUTO). + * May only be set by the filter implementation for each type. + * A removal request will restore the automatic filter in its place. + */ +#define EFX_FILTER_FLAG_RX_OVER_AUTO 0x04 +/* Filter is for RX */ +#define EFX_FILTER_FLAG_RX 0x08 +/* Filter is for TX */ +#define EFX_FILTER_FLAG_TX 0x10 + +typedef unsigned int efx_filter_flags_t; typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host @@ -2289,7 +2291,7 @@ extern void efx_filter_spec_init_rx( __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, - __in efx_filter_flag_t flags, + __in efx_filter_flags_t flags, __in efx_rxq_t *erp); extern void Modified: stable/11/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/11/sys/dev/sfxge/common/efx_filter.c Sun Jan 1 19:15:08 2017 (r311021) +++ stable/11/sys/dev/sfxge/common/efx_filter.c Sun Jan 1 19:16:57 2017 (r311022) @@ -276,7 +276,7 @@ fail1: efx_filter_spec_init_rx( __out efx_filter_spec_t *spec, __in efx_filter_priority_t priority, - __in efx_filter_flag_t flags, + __in efx_filter_flags_t flags, __in efx_rxq_t *erp) { EFSYS_ASSERT3P(spec, !=, NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701011916.v01JGvUZ048944>