DPDK: Create multiple RSS flows with unique set of queues for different patterns
Stephen Hemminger
stephen at networkplumber.org
Thu Aug 8 20:55:12 CEST 2024
On Thu, 8 Aug 2024 11:19:13 +0000
Raghavan V <Raghavan.V2 at tatacommunications.com> wrote:
> Hi Team,
>
> Is there any possible way to create multiple RSS flows to distribute packets to set of queues when a particular Ip pattern matches.
> For e.g.,
> I have 40 RX queues setup,
> Flow 1: Match a particular IP pattern and distribute it to specified RX queues set (0 - 29)
> Flow 2: Match a particular IP pattern and distribute it to specified RX queues set (30 - 39)
You need to address what to with packets that do match either of the patterns.
Usually best to reserve one queue (0) for those.
>
> Is the below code snippet possible? Also is it possible to use symmetric toeplitz hash and ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY and let me know any other config should be included.
That is HW dependent I suspect most hardware doesn't support it. Probably only mlx5.
You are best to read the driver source to find out if you want to do special case like this.
>
> uint16_t queue_indices[] = {0,...29};
> uint16_t queue_indices2[] = {30,..39};
>
> action_rss1 = (struct rte_flow_action_rss){
> .types = rss_conf.rss_hf,
> .key_len = rss_conf.rss_key_len,
Usually best to go with default rss_key and leave key_len and key as default of 0.
> .queue_num = 30,
> .key = rss_key,
> .queue = queue_indices,
> };
>
> action_rss2 = (struct rte_flow_action_rss){
> .types = rss_conf.rss_hf,
> .key_len = rss_conf.rss_key_len,
> .queue_num = 10,
> .key = rss_key,
> .queue = queue_indices2,
> };
>
> struct rte_flow_item pattern[] = {
> [0]={
> .type = RTE_FLOW_ITEM_TYPE_ETH,
>
> },
> [1]={
> .type = RTE_FLOW_ITEM_TYPE_IPV4,
> .spec = &ipv4_spec,
> .mask = &ipv4_mask,
>
>
> },
> [2]={
> .type = RTE_FLOW_ITEM_TYPE_UDP,
> },
>
> [3]={
> .type = RTE_FLOW_ITEM_TYPE_END,
> }
> };
> struct rte_flow_item pattern2[] = {
> [0]={
> .type = RTE_FLOW_ITEM_TYPE_ETH,
>
> },
>
> [1]={
> .type = RTE_FLOW_ITEM_TYPE_IPV4,
> .spec = &ipv4_spec2,
> .mask = &ipv4_mask2,
>
>
> },
> [2]={
> .type = RTE_FLOW_ITEM_TYPE_UDP,
> },
>
> [3]={
> .type = RTE_FLOW_ITEM_TYPE_END,
> }
> };
> rte_flow_validate(bond_port, &attr, pattern, action_rss1, &error);
> rte_flow_create(bond_port, &attr, pattern, action_rss1, &error);
>
> rte_flow_validate(bond_port, &attr, pattern2, action_rss2, &error);
> rte_flow_create(bond_port, &attr, pattern2, action_rss2, &error);
>
>
> Pls let me know any other approach will match my requirement.
>
> Thanks,
> Raghavan V
>
More information about the dev
mailing list