DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/qede: fix Tx tunnel offload notsup mask
@ 2018-11-12 18:19 Mody, Rasesh
  2018-11-13 12:01 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Mody, Rasesh @ 2018-11-12 18:19 UTC (permalink / raw)
  To: dev; +Cc: Shaikh, Shahed, ferruh.yigit, Dept-Eng DPDK Dev, stable

From: Shahed Shaikh <shahed.shaikh@cavium.com>

Tunneling offloads are represented by multi-bit values. So, feature
wise tunneling offload can only be entirely supported/unsupported
using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of
the tunneling offload types are supported by respective PMD.
Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs
unsupported offloads can lead to undesired result.

Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent
value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark
supported tunnel offloads.

Fixes: 44346c24b790 ("net/qede: fix VXLAN tunnel Tx offload flag setting")
Cc: stable@dpdk.org

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Reviewed-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/qede_rxtx.c |   12 ++++++++++++
 drivers/net/qede/qede_rxtx.h |    5 +----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 8a4772f..7d24742 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1759,6 +1759,18 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 			}
 		}
 		if (ol_flags & QEDE_TX_OFFLOAD_NOTSUP_MASK) {
+			/* We support only limited tunnel protocols */
+			if (ol_flags & PKT_TX_TUNNEL_MASK) {
+				uint64_t temp;
+
+				temp = ol_flags & PKT_TX_TUNNEL_MASK;
+				if (temp == PKT_TX_TUNNEL_VXLAN ||
+				    temp == PKT_TX_TUNNEL_GENEVE ||
+				    temp == PKT_TX_TUNNEL_MPLSINUDP ||
+				    temp == PKT_TX_TUNNEL_GRE)
+					break;
+			}
+
 			rte_errno = -ENOTSUP;
 			break;
 		}
diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h
index d3a41e9..0afadd8 100644
--- a/drivers/net/qede/qede_rxtx.h
+++ b/drivers/net/qede/qede_rxtx.h
@@ -153,10 +153,7 @@
 
 #define QEDE_TX_OFFLOAD_MASK (QEDE_TX_CSUM_OFFLOAD_MASK | \
 			      PKT_TX_VLAN_PKT		| \
-			      PKT_TX_TUNNEL_VXLAN	| \
-			      PKT_TX_TUNNEL_GENEVE	| \
-			      PKT_TX_TUNNEL_MPLSINUDP   | \
-			      PKT_TX_TUNNEL_GRE)
+			      PKT_TX_TUNNEL_MASK)
 
 #define QEDE_TX_OFFLOAD_NOTSUP_MASK \
 	(PKT_TX_OFFLOAD_MASK ^ QEDE_TX_OFFLOAD_MASK)
-- 
1.7.10.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/qede: fix Tx tunnel offload notsup mask
  2018-11-12 18:19 [dpdk-dev] [PATCH] net/qede: fix Tx tunnel offload notsup mask Mody, Rasesh
@ 2018-11-13 12:01 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-11-13 12:01 UTC (permalink / raw)
  To: Mody, Rasesh, dev; +Cc: Shaikh, Shahed, Dept-Eng DPDK Dev, stable

On 11/12/2018 6:19 PM, Mody, Rasesh wrote:
> From: Shahed Shaikh <shahed.shaikh@cavium.com>
> 
> Tunneling offloads are represented by multi-bit values. So, feature
> wise tunneling offload can only be entirely supported/unsupported
> using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of
> the tunneling offload types are supported by respective PMD.
> Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs
> unsupported offloads can lead to undesired result.
> 
> Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent
> value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark
> supported tunnel offloads.
> 
> Fixes: 44346c24b790 ("net/qede: fix VXLAN tunnel Tx offload flag setting")
> Cc: stable@dpdk.org
> 
> Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
> Reviewed-by: Rasesh Mody <rasesh.mody@cavium.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-13 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 18:19 [dpdk-dev] [PATCH] net/qede: fix Tx tunnel offload notsup mask Mody, Rasesh
2018-11-13 12:01 ` Ferruh Yigit

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).