From dd3d209cb12090b7cda31323fec61951087febac Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Tue, 28 Apr 2020 14:37:25 +0100 Subject: [PATCH] net/sfc/base: use simpler EF10 family run-time checks Fixes: 4625c4f5277d ("net/sfc/base: factor out upstream port vAdaptor allocation") Fixes: 4f12e20c85dc ("net/sfc/base: introduce EVB module for SR-IOV") Fixes: 18c8e84d7726 ("net/sfc/base: support proxy auth operations for SR-IOV") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/ef10_evb.c | 8 ++------ drivers/net/sfc/base/ef10_nic.c | 4 +--- drivers/net/sfc/base/ef10_proxy.c | 8 ++------ 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/net/sfc/base/ef10_evb.c b/drivers/net/sfc/base/ef10_evb.c index f290339f2f..d541db4980 100644 --- a/drivers/net/sfc/base/ef10_evb.c +++ b/drivers/net/sfc/base/ef10_evb.c @@ -15,9 +15,7 @@ ef10_evb_init( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD || - enp->en_family == EFX_FAMILY_MEDFORD2); + EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); return (0); } @@ -26,9 +24,7 @@ ef10_evb_init( ef10_evb_fini( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD || - enp->en_family == EFX_FAMILY_MEDFORD2); + EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); } __checkReturn efx_rc_t diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c index d1802da0bd..34fa45e8c1 100644 --- a/drivers/net/sfc/base/ef10_nic.c +++ b/drivers/net/sfc/base/ef10_nic.c @@ -2288,9 +2288,7 @@ ef10_nic_init( efx_rc_t rc; boolean_t alloc_vadaptor = B_TRUE; - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD || - enp->en_family == EFX_FAMILY_MEDFORD2); + EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); /* Enable reporting of some events (e.g. link change) */ if ((rc = efx_mcdi_log_ctrl(enp)) != 0) diff --git a/drivers/net/sfc/base/ef10_proxy.c b/drivers/net/sfc/base/ef10_proxy.c index 9be9e221d5..19c11c6ebc 100644 --- a/drivers/net/sfc/base/ef10_proxy.c +++ b/drivers/net/sfc/base/ef10_proxy.c @@ -13,9 +13,7 @@ ef10_proxy_auth_init( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD || - enp->en_family == EFX_FAMILY_MEDFORD2); + EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); return (0); } @@ -24,9 +22,7 @@ ef10_proxy_auth_init( ef10_proxy_auth_fini( __in efx_nic_t *enp) { - EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || - enp->en_family == EFX_FAMILY_MEDFORD || - enp->en_family == EFX_FAMILY_MEDFORD2); + EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); } static __checkReturn efx_rc_t -- 2.20.1