From: Andrew Rybchenko Date: Wed, 4 Apr 2018 14:23:54 +0000 (+0100) Subject: net/sfc/base: add firmware subvariant aware driver option X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c857ca7abf8c1af444bc319a5b141cf2e4e01c56;p=dpdk.git net/sfc/base: add firmware subvariant aware driver option FW subvariants allow to tweak NIC global features. For example, if no drivers require checksumming on transmit, it may be disabled in FW to increase packet rate. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Andrew Lee --- diff --git a/drivers/net/sfc/base/efx_check.h b/drivers/net/sfc/base/efx_check.h index 5512e29feb..52b0c7979a 100644 --- a/drivers/net/sfc/base/efx_check.h +++ b/drivers/net/sfc/base/efx_check.h @@ -350,4 +350,11 @@ # endif #endif /* EFSYS_OPT_TUNNEL */ +#if EFSYS_OPT_FW_SUBVARIANT_AWARE +/* Advertise that the driver is firmware subvariant aware */ +# if !(EFSYS_OPT_MEDFORD2) +# error "FW_SUBVARIANT_AWARE requires MEDFORD2" +# endif +#endif + #endif /* _SYS_EFX_CHECK_H */ diff --git a/drivers/net/sfc/base/efx_mcdi.c b/drivers/net/sfc/base/efx_mcdi.c index d8b4598ff1..d4ebcf2650 100644 --- a/drivers/net/sfc/base/efx_mcdi.c +++ b/drivers/net/sfc/base/efx_mcdi.c @@ -1274,7 +1274,9 @@ efx_mcdi_drv_attach( * FULL_FEATURED datapath firmware type first and fall backs to * DONT_CARE datapath firmware type if MC_CMD_DRV_ATTACH fails. */ - MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_NEW_STATE, attach ? 1 : 0); + MCDI_IN_POPULATE_DWORD_2(req, DRV_ATTACH_IN_NEW_STATE, + DRV_ATTACH_IN_ATTACH, attach ? 1 : 0, + DRV_ATTACH_IN_SUBVARIANT_AWARE, EFSYS_OPT_FW_SUBVARIANT_AWARE); MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_UPDATE, 1); MCDI_IN_SET_DWORD(req, DRV_ATTACH_IN_FIRMWARE_ID, enp->efv); diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h index b3dae6e3c8..ac7121dd63 100644 --- a/drivers/net/sfc/efsys.h +++ b/drivers/net/sfc/efsys.h @@ -200,6 +200,8 @@ prefetch_read_once(const volatile void *addr) #define EFSYS_OPT_TUNNEL 1 +#define EFSYS_OPT_FW_SUBVARIANT_AWARE 0 + /* ID */ typedef struct __efsys_identifier_s efsys_identifier_t;