net/sfc/base: add firmware subvariant aware driver option
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 4 Apr 2018 14:23:54 +0000 (15:23 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Apr 2018 22:41:44 +0000 (00:41 +0200)
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 <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
drivers/net/sfc/base/efx_check.h
drivers/net/sfc/base/efx_mcdi.c
drivers/net/sfc/efsys.h

index 5512e29..52b0c79 100644 (file)
 # 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 */
index d8b4598..d4ebcf2 100644 (file)
@@ -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);
 
index b3dae6e..ac7121d 100644 (file)
@@ -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;