diff mbox series

net/qede: fix Tx tunnel offload notsup mask

Message ID 1542046761-2895-1-git-send-email-rasesh.mody@cavium.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series net/qede: fix Tx tunnel offload notsup mask | expand

Checks

Context Check Description
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Mody, Rasesh Nov. 12, 2018, 6:19 p.m. UTC
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(-)

Comments

Ferruh Yigit Nov. 13, 2018, 12:01 p.m. UTC | #1
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.
diff mbox series

Patch

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)