From 641fe3596f0283e41032350caf09c0c9b2001f70 Mon Sep 17 00:00:00 2001 From: arybchik Date: Mon, 10 Dec 2018 09:35:45 +0000 Subject: [PATCH] sfxge(4): report support for Tx checksum op descriptors FreeBSD driver needs a patch to provide a means for packets which do not need checksum offload but have flow ID set to avoid hitting only the first Tx queue (which has been used for packets not needing checksum offload). This should be possible on Huntington, Medford or Medford2 chips since these support toggling checksum offload on any given queue dynamically by means of pushing option descriptors. The patch for FreeBSD driver will then need a means to figure out whether the feature can be used, and testing adapter family might not be a good solution. This patch adds a feature bit specifically to indicate support for checksum option descriptors. The new feature bits may have more users in future, apart from the mentioned FreeBSD patch. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18388 --- sys/dev/sfxge/common/efx.h | 1 + sys/dev/sfxge/common/efx_nic.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h index 63f390a451d0..d9295b8070ed 100644 --- a/sys/dev/sfxge/common/efx.h +++ b/sys/dev/sfxge/common/efx.h @@ -1261,6 +1261,7 @@ efx_bist_stop( #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 #define EFX_FEATURE_PACKED_STREAM 0x00004000 +#define EFX_FEATURE_TXQ_CKSUM_OP_DESC 0x00008000 typedef enum efx_tunnel_protocol_e { EFX_TUNNEL_PROTOCOL_NONE = 0, diff --git a/sys/dev/sfxge/common/efx_nic.c b/sys/dev/sfxge/common/efx_nic.c index cd1efe5e8881..b2b411fc9ab1 100644 --- a/sys/dev/sfxge/common/efx_nic.c +++ b/sys/dev/sfxge/common/efx_nic.c @@ -257,7 +257,8 @@ efx_nic_create( EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO | EFX_FEATURE_FW_ASSISTED_TSO_V2 | - EFX_FEATURE_PACKED_STREAM; + EFX_FEATURE_PACKED_STREAM | + EFX_FEATURE_TXQ_CKSUM_OP_DESC; break; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -277,7 +278,8 @@ efx_nic_create( EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO_V2 | - EFX_FEATURE_PACKED_STREAM; + EFX_FEATURE_PACKED_STREAM | + EFX_FEATURE_TXQ_CKSUM_OP_DESC; break; #endif /* EFSYS_OPT_MEDFORD */ @@ -293,7 +295,8 @@ efx_nic_create( EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO_V2 | - EFX_FEATURE_PACKED_STREAM; + EFX_FEATURE_PACKED_STREAM | + EFX_FEATURE_TXQ_CKSUM_OP_DESC; break; #endif /* EFSYS_OPT_MEDFORD2 */