* [dpdk-dev] [PATCH] net/mlx5: fix mark id retrieval
@ 2017-03-30 12:45 Nelio Laranjeiro
2017-03-31 17:00 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2017-03-30 12:45 UTC (permalink / raw)
To: dev; +Cc: Adrien Mazarguil, stable
Mark ID in the completion queue entry is 24 bits, the remaining 8 bits are
reserved and may be nonzero. Do not take them into account when looking for
marked packets.
CC: stable@dpdk.org
Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action")
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx5/mlx5_prm.h | 7 +++++++
drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
index 155bdba..608072f 100644
--- a/drivers/net/mlx5/mlx5_prm.h
+++ b/drivers/net/mlx5/mlx5_prm.h
@@ -138,6 +138,13 @@
/* Inner L4 checksum offload (Tunneled packets only). */
#define MLX5_ETH_WQE_L4_INNER_CSUM (1u << 5)
+/* Is flow mark valid. */
+#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
+#define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff00)
+#else
+#define MLX5_FLOW_MARK_IS_VALID(val) ((val) & 0xffffff)
+#endif
+
/* INVALID is used by packets matching no flow rules. */
#define MLX5_FLOW_MARK_INVALID 0
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index a1dd84a..1c5311c 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1953,8 +1953,8 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
pkt->hash.rss = rss_hash_res;
pkt->ol_flags = PKT_RX_RSS_HASH;
}
- if (rxq->mark && (cqe->sop_drop_qpn !=
- htonl(MLX5_FLOW_MARK_INVALID))) {
+ if (rxq->mark &&
+ MLX5_FLOW_MARK_IS_VALID(cqe->sop_drop_qpn)) {
pkt->ol_flags |= PKT_RX_FDIR;
if (cqe->sop_drop_qpn !=
htonl(MLX5_FLOW_MARK_DEFAULT)) {
--
2.1.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/mlx5: fix mark id retrieval
2017-03-30 12:45 [dpdk-dev] [PATCH] net/mlx5: fix mark id retrieval Nelio Laranjeiro
@ 2017-03-31 17:00 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-03-31 17:00 UTC (permalink / raw)
To: Nelio Laranjeiro, dev; +Cc: Adrien Mazarguil, stable
On 3/30/2017 1:45 PM, Nelio Laranjeiro wrote:
> Mark ID in the completion queue entry is 24 bits, the remaining 8 bits are
> reserved and may be nonzero. Do not take them into account when looking for
> marked packets.
>
> CC: stable@dpdk.org
> Fixes: ea3bc3b1df94 ("net/mlx5: support mark flow action")
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-31 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 12:45 [dpdk-dev] [PATCH] net/mlx5: fix mark id retrieval Nelio Laranjeiro
2017-03-31 17:00 ` [dpdk-dev] [dpdk-stable] " 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).