DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 07/14] net/sfc/base: allow to request inner classes for Rx packets
Date: Sun, 24 Dec 2017 10:46:37 +0000	[thread overview]
Message-ID: <1514112404-13398-8-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1514112404-13398-1-git-send-email-arybchenko@solarflare.com>

If HW/FW supports tunnel encapsulations, Rx event may contain
either inner or outer packet classes. By default outer classes
are requested. Make it possible to request inner classes to
have more information about packet type and allow to interpret
inner frame checksum validation results correctly.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Mark Spender <mspender@solarflare.com>
---
 drivers/net/sfc/base/ef10_rx.c | 13 +++++++++++--
 drivers/net/sfc/base/efx.h     |  9 +++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c
index 17b1652..80f779e 100644
--- a/drivers/net/sfc/base/ef10_rx.c
+++ b/drivers/net/sfc/base/ef10_rx.c
@@ -44,6 +44,7 @@ efx_mcdi_init_rxq(
 	__in		uint32_t instance,
 	__in		efsys_mem_t *esmp,
 	__in		boolean_t disable_scatter,
+	__in		boolean_t want_inner_classes,
 	__in		uint32_t ps_bufsize)
 {
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
@@ -65,7 +66,8 @@ efx_mcdi_init_rxq(
 	else
 		dma_mode = MC_CMD_INIT_RXQ_EXT_IN_SINGLE_PACKET;
 
-	if (encp->enc_tunnel_encapsulations_supported != 0) {
+	if (encp->enc_tunnel_encapsulations_supported != 0 &&
+	    !want_inner_classes) {
 		/*
 		 * WANT_OUTER_CLASSES can only be specified on hardware which
 		 * supports tunnel encapsulation offloads, even though it is
@@ -959,6 +961,7 @@ ef10_rx_qcreate(
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_rc_t rc;
 	boolean_t disable_scatter;
+	boolean_t want_inner_classes;
 	unsigned int ps_buf_size;
 
 	_NOTE(ARGUNUSED(id, erp))
@@ -1037,8 +1040,14 @@ ef10_rx_qcreate(
 	else
 		disable_scatter = encp->enc_rx_disable_scatter_supported;
 
+	if (flags & EFX_RXQ_FLAG_INNER_CLASSES)
+		want_inner_classes = B_TRUE;
+	else
+		want_inner_classes = B_FALSE;
+
 	if ((rc = efx_mcdi_init_rxq(enp, ndescs, eep->ee_index, label, index,
-		    esmp, disable_scatter, ps_buf_size)) != 0)
+		    esmp, disable_scatter, want_inner_classes,
+		    ps_buf_size)) != 0)
 		goto fail7;
 
 	erp->er_eep = eep;
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index d4e0bc5..ec65dcf 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -2012,6 +2012,15 @@ typedef enum efx_rxq_type_e {
  */
 #define	EFX_RXQ_FLAG_NONE		0x0
 #define	EFX_RXQ_FLAG_SCATTER		0x1
+/*
+ * If tunnels are supported and Rx event can provide information about
+ * either outer or inner packet classes (e.g. SFN8xxx adapters with
+ * full-feature firmware variant running), outer classes are requested by
+ * default. However, if the driver supports tunnels, the flag allows to
+ * request inner classes which are required to be able to interpret inner
+ * Rx checksum offload results.
+ */
+#define	EFX_RXQ_FLAG_INNER_CLASSES	0x2
 
 extern	__checkReturn	efx_rc_t
 efx_rx_qcreate(
-- 
2.7.4

  parent reply	other threads:[~2017-12-24 10:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-24 10:46 [dpdk-dev] [PATCH 00/14] net/sfc: support NVGRE, VXLAN and GENEVE tunnels Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 01/14] net/sfc: fix label name to be consistent Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 02/14] net/sfc: do not hold management event queue lock while MCDI Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 03/14] net/sfc: handle MC reboot event Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 04/14] net/sfc: retry port start to handle MC reboot in the middle Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 05/14] net/sfc/base: control RxQ scatter using flag instead of type Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 06/14] net/sfc/base: add function to create packed stream RxQ Andrew Rybchenko
2017-12-24 10:46 ` Andrew Rybchenko [this message]
2017-12-24 10:46 ` [dpdk-dev] [PATCH 08/14] net/sfc/base: add API to control UDP tunnel ports Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 09/14] net/sfc: support UDP tunnel ports configuration Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 10/14] net/sfc: fix incorrect bitwise ORing of L3/L4 packet types Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 11/14] net/sfc: support VXLAN and NVGRE packet types classification Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 12/14] net/sfc: correct Rx checksum offloads for tunnel packets Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 13/14] net/sfc: support inner checksum offload on transmit Andrew Rybchenko
2017-12-24 10:46 ` [dpdk-dev] [PATCH 14/14] doc: add net/sfc tunnels support to release features Andrew Rybchenko
2018-01-09 17:31 ` [dpdk-dev] [PATCH 00/14] net/sfc: support NVGRE, VXLAN and GENEVE tunnels 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=1514112404-13398-8-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).