DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] mlx5 flow MARK action does not work with RSS
@ 2019-01-30 17:47 Tom Barbette
  2019-01-31  6:42 ` Shahaf Shuler
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Barbette @ 2019-01-30 17:47 UTC (permalink / raw)
  To: users; +Cc: Shahaf Shuler

Hi all,

It seems that when using the RTE_FLOW_ACTION_TYPE_RSS action, the  RTE_FLOW_ACTION_TYPE_MARK does not work anymore with mlx5. The flag RX_PKT_ID is not set, and the value in .hi is not good either. If I use RTE_FLOW_ACTION_TYPE_QUEUE it works fine.

Actually, I do not want specifically to use the RSS action. I would just like the packet to be marked but continue its normal path (that is the global RSS). However I get the "no fate action" error in that case.

Any way to use RSS but keep the "mark" ?

Thanks,

Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-30 17:47 [dpdk-users] mlx5 flow MARK action does not work with RSS Tom Barbette
@ 2019-01-31  6:42 ` Shahaf Shuler
  2019-01-31  8:30   ` Tom Barbette
  0 siblings, 1 reply; 7+ messages in thread
From: Shahaf Shuler @ 2019-01-31  6:42 UTC (permalink / raw)
  To: Tom Barbette, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

++

Hi Tom,


Wednesday, January 30, 2019 7:47 PM, Tom Barbette:
> Subject: mlx5 flow MARK action does not work with RSS
> 
> Hi all,
> 
> It seems that when using the RTE_FLOW_ACTION_TYPE_RSS action, the
> RTE_FLOW_ACTION_TYPE_MARK does not work anymore with mlx5. The
> flag RX_PKT_ID is not set, and the value in .hi is not good either. If I use
> RTE_FLOW_ACTION_TYPE_QUEUE it works fine.

It is not expected, Mark action can set along w/ RSS.

Can you provide a way to reproduce? maybe w/ testpmd? so we can have a look.
We are not familiar w/ such issue from our testing. 

> 
> Actually, I do not want specifically to use the RSS action. I would just like the
> packet to be marked but continue its normal path (that is the global RSS).
> However I get the "no fate action" error in that case.
> 
> Any way to use RSS but keep the "mark" ?
> 
> Thanks,
> 
> Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-31  6:42 ` Shahaf Shuler
@ 2019-01-31  8:30   ` Tom Barbette
  2019-01-31 12:54     ` Tom Barbette
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Barbette @ 2019-01-31  8:30 UTC (permalink / raw)
  To: Shahaf Shuler, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

On 2019-01-31 07:42, Shahaf Shuler wrote:
> 
> It is not expected, Mark action can set along w/ RSS.

I therefore tried different things and found that the problem was a 
misconfiguration of the RSS action. Thanks!

For future relevance, here is a working piece of code for RSS + MARK 
(+END) action :

     struct rte_flow_action action[3]; 

     struct rte_flow_action_mark mark; 

     struct rte_flow_action_rss rss; 


     memset(action, 0, sizeof(action)); 

     memset(&rss, 0, sizeof(rss)); 

 

     action[0].type = RTE_FLOW_ACTION_TYPE_MARK; 

     mark.id = _matches.size(); 

     action[0].conf = &mark;
 

     action[1].type = RTE_FLOW_ACTION_TYPE_RSS; 

     uint16_t queue[RTE_MAX_QUEUES_PER_PORT]; 

     queue[0] = 0;
     //TODO : enable all the queues of interest 

     uint8_t rss_key[40];
     struct rte_eth_rss_conf rss_conf;
     rss_conf.rss_key = rss_key; 

     rss_conf.rss_key_len = 40; 

     rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf); 

     rss.types = rss_conf.rss_hf; 

     rss.key_len = rss_conf.rss_key_len; 

     rss.queue_num = 1;
     rss.key = rss_key; 

     rss.queue = queue; 

     rss.level = 0; 

     rss.func = RTE_ETH_HASH_FUNCTION_DEFAULT; 

     action[1].conf = &rss; 


     action[2].type = RTE_FLOW_ACTION_TYPE_END;

Thanks!

Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-31  8:30   ` Tom Barbette
@ 2019-01-31 12:54     ` Tom Barbette
  2019-01-31 14:04       ` Shahaf Shuler
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Barbette @ 2019-01-31 12:54 UTC (permalink / raw)
  To: Shahaf Shuler, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

On 2019-01-31 09:30, Tom Barbette wrote:
> I therefore tried different things and found that the problem was a 
> misconfiguration of the RSS action. Thanks!
> 

Actually, it was because the rule installation fails when the flow is 
not classifying on "ipv4", because of the RSS parameter.

testpmd> flow create 0 ingress pattern eth type is 0x0800 / end actions 
mark id 1 / rss / end
Caught error type 1 (cause unspecified): hardware refuses to create 
flow: Invalid argument

testpmd> flow create 0 ingress pattern eth type is 0x0800 / ipv4 / end 
actions mark id 1 / rss / end
Flow rule #0 created

Isn't it technically possible to have a "default" action? Mark the flow 
then let the packet be as usual? That would be so much better than 
tracking which rules classify which protocol and change the action 
according to that... The NIC does it by itself already...

Thanks,
Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-31 12:54     ` Tom Barbette
@ 2019-01-31 14:04       ` Shahaf Shuler
  2019-01-31 16:40         ` Tom Barbette
  0 siblings, 1 reply; 7+ messages in thread
From: Shahaf Shuler @ 2019-01-31 14:04 UTC (permalink / raw)
  To: Tom Barbette, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

Thursday, January 31, 2019 2:55 PM, Tom Barbette:
> Subject: Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
> 
> On 2019-01-31 09:30, Tom Barbette wrote:
> > I therefore tried different things and found that the problem was a
> > misconfiguration of the RSS action. Thanks!
> >
> 
> Actually, it was because the rule installation fails when the flow is not
> classifying on "ipv4", because of the RSS parameter.
> 
> testpmd> flow create 0 ingress pattern eth type is 0x0800 / end actions
> mark id 1 / rss / end
> Caught error type 1 (cause unspecified): hardware refuses to create
> flow: Invalid argument
> 
> testpmd> flow create 0 ingress pattern eth type is 0x0800 / ipv4 / end
> actions mark id 1 / rss / end
> Flow rule #0 created
> 
> Isn't it technically possible to have a "default" action? Mark the flow then let
> the packet be as usual?

Not sure what you mean here by packet be as usual? 

 That would be so much better than tracking which
> rules classify which protocol and change the action according to that... The
> NIC does it by itself already...

What is the functionally you seek? It will much help to propose a solution. 

> 
> Thanks,
> Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-31 14:04       ` Shahaf Shuler
@ 2019-01-31 16:40         ` Tom Barbette
  2019-02-03 12:44           ` Shahaf Shuler
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Barbette @ 2019-01-31 16:40 UTC (permalink / raw)
  To: Shahaf Shuler, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

Le 31/01/2019 à 15:04, Shahaf Shuler a écrit :
> What is the functionally you seek? It will much help to propose a solution.


What I'd like is to mark some packets. Eg ARP packets with 1, ICMP PING 
with 2, IP dst port 80 with 3, etc.

But I'd like the packets to follow the normal behavior except from that. 
My default behavior would be to use RSS to dispatch packets among a set 
of queues.

In the current scheme, I must set a specific "fate" action for each 
flow, like QUEUE or RSS.
Of course the list of flows is dynamically generated, and it is 
complicated to change QUEUE/RSS according to the flow type. I would like 
to say "mark packets, then do as the NIC would normally do". That's why 
I imagine a "default" action.


Thanks,
Tom

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

* Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
  2019-01-31 16:40         ` Tom Barbette
@ 2019-02-03 12:44           ` Shahaf Shuler
  0 siblings, 0 replies; 7+ messages in thread
From: Shahaf Shuler @ 2019-02-03 12:44 UTC (permalink / raw)
  To: Tom Barbette, users, Raslan Darawsheh; +Cc: Olga Shern, Yongseok Koh

Thursday, January 31, 2019 6:41 PM, Tom Barbette:
> Subject: Re: [dpdk-users] mlx5 flow MARK action does not work with RSS
> 
> Le 31/01/2019 à 15:04, Shahaf Shuler a écrit :
> > What is the functionally you seek? It will much help to propose a solution.
> 
> 
> What I'd like is to mark some packets. Eg ARP packets with 1, ICMP PING with
> 2, IP dst port 80 with 3, etc.
> 
> But I'd like the packets to follow the normal behavior except from that.
> My default behavior would be to use RSS to dispatch packets among a set of
> queues.
> 
> In the current scheme, I must set a specific "fate" action for each flow, like
> QUEUE or RSS.
> Of course the list of flows is dynamically generated, and it is complicated to
> change QUEUE/RSS according to the flow type. I would like to say "mark
> packets, then do as the NIC would normally do". That's why I imagine a
> "default" action.

There is a default RSS hashing. For example, for IP dst port 80 w/ mark 3 and 4 rxqs do:
testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 80 / end actions mark id 3 / rss queues 0 1 2 3 end / end

This will tell the PMD to do RSS action to all queues and it will use the default RSS defined on the port. Which means you will get the exact same behavior like the default action.
You can append this RSS action to every rule you create.

There is one issue w/ ARP. Mellanox devices cannot do RSS on the ether only packets. As such, RSS action on ARP packet will fail. 
So for Ether only packet you will have to use the queue action. The "default" behavior will be go to queue index 0. 

> 
> 
> Thanks,
> Tom

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

end of thread, other threads:[~2019-02-03 12:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 17:47 [dpdk-users] mlx5 flow MARK action does not work with RSS Tom Barbette
2019-01-31  6:42 ` Shahaf Shuler
2019-01-31  8:30   ` Tom Barbette
2019-01-31 12:54     ` Tom Barbette
2019-01-31 14:04       ` Shahaf Shuler
2019-01-31 16:40         ` Tom Barbette
2019-02-03 12:44           ` Shahaf Shuler

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