DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx4: fix restriction on TCP/UDP flow rules
@ 2017-10-20 12:39 Adrien Mazarguil
  2017-10-20 12:45 ` Nélio Laranjeiro
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2017-10-20 12:39 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

The code as currently written requires TCP/UDP source and destination ports
to be always specified.

No such restriction is enforced by hardware; all TCP and UDP traffic can be
matched by providing an empty mask for these fields.

Fixes: 680d5280c20b ("net/mlx4: refactor flow item validation code")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 5af6efb..a0f431b 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -404,7 +404,7 @@ mlx4_flow_merge_udp(struct rte_flow *flow,
 	struct ibv_flow_spec_tcp_udp *udp;
 	const char *msg;
 
-	if (!mask ||
+	if (mask &&
 	    ((uint16_t)(mask->hdr.src_port + 1) > UINT16_C(1) ||
 	     (uint16_t)(mask->hdr.dst_port + 1) > UINT16_C(1))) {
 		msg = "mlx4 does not support matching partial UDP fields";
@@ -464,7 +464,7 @@ mlx4_flow_merge_tcp(struct rte_flow *flow,
 	struct ibv_flow_spec_tcp_udp *tcp;
 	const char *msg;
 
-	if (!mask ||
+	if (mask &&
 	    ((uint16_t)(mask->hdr.src_port + 1) > UINT16_C(1) ||
 	     (uint16_t)(mask->hdr.dst_port + 1) > UINT16_C(1))) {
 		msg = "mlx4 does not support matching partial TCP fields";
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH] net/mlx4: fix restriction on TCP/UDP flow rules
  2017-10-20 12:39 [dpdk-dev] [PATCH] net/mlx4: fix restriction on TCP/UDP flow rules Adrien Mazarguil
@ 2017-10-20 12:45 ` Nélio Laranjeiro
  2017-10-23 20:32   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Nélio Laranjeiro @ 2017-10-20 12:45 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: Ferruh Yigit, dev

On Fri, Oct 20, 2017 at 02:39:58PM +0200, Adrien Mazarguil wrote:
> The code as currently written requires TCP/UDP source and destination ports
> to be always specified.
> 
> No such restriction is enforced by hardware; all TCP and UDP traffic can be
> matched by providing an empty mask for these fields.
> 
> Fixes: 680d5280c20b ("net/mlx4: refactor flow item validation code")
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

-- 
Nélio Laranjeiro
6WIND

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

* Re: [dpdk-dev] [PATCH] net/mlx4: fix restriction on TCP/UDP flow rules
  2017-10-20 12:45 ` Nélio Laranjeiro
@ 2017-10-23 20:32   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-23 20:32 UTC (permalink / raw)
  To: Nélio Laranjeiro, Adrien Mazarguil; +Cc: dev

On 10/20/2017 5:45 AM, Nélio Laranjeiro wrote:
> On Fri, Oct 20, 2017 at 02:39:58PM +0200, Adrien Mazarguil wrote:
>> The code as currently written requires TCP/UDP source and destination ports
>> to be always specified.
>>
>> No such restriction is enforced by hardware; all TCP and UDP traffic can be
>> matched by providing an empty mask for these fields.
>>
>> Fixes: 680d5280c20b ("net/mlx4: refactor flow item validation code")
>>
>> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> 
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

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

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

end of thread, other threads:[~2017-10-23 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 12:39 [dpdk-dev] [PATCH] net/mlx4: fix restriction on TCP/UDP flow rules Adrien Mazarguil
2017-10-20 12:45 ` Nélio Laranjeiro
2017-10-23 20:32   ` 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).