DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v3 2/5] net/sfc/base: add firmware subvariant aware driver option
Date: Wed, 4 Apr 2018 15:23:54 +0100	[thread overview]
Message-ID: <1522851837-5806-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1522851837-5806-1-git-send-email-arybchenko@solarflare.com>

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 | 7 +++++++
 drivers/net/sfc/base/efx_mcdi.c  | 4 +++-
 drivers/net/sfc/efsys.h          | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_check.h b/drivers/net/sfc/base/efx_check.h
index 5512e29..52b0c79 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 d8b4598..d4ebcf2 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 b3dae6e..ac7121d 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;
-- 
2.7.4

  parent reply	other threads:[~2018-04-04 14:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 15:07 [dpdk-dev] [PATCH 0/5] net/sfc: support choice of FW subvariant without Tx checksum Andrew Rybchenko
2018-04-03 15:07 ` [dpdk-dev] [PATCH 1/5] net/sfc/base: update MCDI headers Andrew Rybchenko
2018-04-03 15:07 ` [dpdk-dev] [PATCH 2/5] net/sfc/base: add firmware subvariant aware driver option Andrew Rybchenko
2018-04-03 15:07 ` [dpdk-dev] [PATCH 3/5] net/sfc/base: report no Tx checksum FW subvariant support Andrew Rybchenko
2018-04-03 15:07 ` [dpdk-dev] [PATCH 4/5] net/sfc/base: support FW subvariant choice Andrew Rybchenko
2018-04-03 15:07 ` [dpdk-dev] [PATCH 5/5] net/sfc: support choice of FW subvariant without Tx checksum Andrew Rybchenko
2018-04-04 14:17 ` [dpdk-dev] [PATCH v2 0/5] " Andrew Rybchenko
2018-04-04 14:17   ` [dpdk-dev] [PATCH v2 1/5] net/sfc/base: update MCDI headers Andrew Rybchenko
2018-04-04 14:17   ` [dpdk-dev] [PATCH v2 2/5] net/sfc/base: add firmware subvariant aware driver option Andrew Rybchenko
2018-04-04 14:17   ` [dpdk-dev] [PATCH v2 3/5] net/sfc/base: report no Tx checksum FW subvariant support Andrew Rybchenko
2018-04-04 14:17   ` [dpdk-dev] [PATCH v2 4/5] net/sfc/base: support FW subvariant choice Andrew Rybchenko
2018-04-04 14:17   ` [dpdk-dev] [PATCH v2 5/5] net/sfc: support choice of FW subvariant without Tx checksum Andrew Rybchenko
2018-04-04 14:23 ` [dpdk-dev] [PATCH v3 0/5] " Andrew Rybchenko
2018-04-04 14:23   ` [dpdk-dev] [PATCH v3 1/5] net/sfc/base: update MCDI headers Andrew Rybchenko
2018-04-04 14:23   ` Andrew Rybchenko [this message]
2018-04-04 14:23   ` [dpdk-dev] [PATCH v3 3/5] net/sfc/base: report no Tx checksum FW subvariant support Andrew Rybchenko
2018-04-04 14:23   ` [dpdk-dev] [PATCH v3 4/5] net/sfc/base: support FW subvariant choice Andrew Rybchenko
2018-04-04 14:23   ` [dpdk-dev] [PATCH v3 5/5] net/sfc: support choice of FW subvariant without Tx checksum Andrew Rybchenko
2018-04-06 17:37   ` [dpdk-dev] [PATCH v3 0/5] " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522851837-5806-3-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).