DPDK usage discussions
 help / color / mirror / Atom feed
From: Pavel Vazharov <freakpv@gmail.com>
To: users <users@dpdk.org>
Subject: Re: Question about rte_flow_validate and DPDK igb driver
Date: Fri, 29 Jul 2022 15:08:59 +0300	[thread overview]
Message-ID: <CAK9EM1_RNT0nM77f49KiEdSFN=D36i=1+som+J8cxbWa=EoTLA@mail.gmail.com> (raw)
In-Reply-To: <CAK9EM19o660-EHWyr3oVmsm92+sz5U=78UYXxQpGwRnzxnO4NA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2837 bytes --]

I should have checked the driver code more thoroughly before asking
questions here.
From drivers/net/e1000/igb_ethdev.c (ntuple_filter_to_2tuple) seems that
only filtering by the dst_port and the proto is supported by this driver.
And so the check from the previous question is perfectly correct.

    switch (filter->dst_port_mask) {

    case UINT16_MAX:

        filter_info->dst_port_mask = 0;

        filter_info->dst_port = filter->dst_port;

        break;

    case 0:

        filter_info->dst_port_mask = 1;

        break;

    default:

        PMD_DRV_LOG(ERR, "invalid dst_port mask.");

        return -EINVAL;

    }



    switch (filter->proto_mask) {

    case UINT8_MAX:

        filter_info->proto_mask = 0;

        filter_info->proto = filter->proto;

        break;

    case 0:

        filter_info->proto_mask = 1;

        break;

    default:

        PMD_DRV_LOG(ERR, "invalid protocol mask.");

        return -EINVAL;

    }

On Fri, Jul 29, 2022 at 1:59 PM Pavel Vazharov <freakpv@gmail.com> wrote:

> Hi there,
>
> I'm trying to distribute among the Rx queues flows of TCP packets based on
> their destination IPv4 address and source TCP port. I'm using the rte_flow
> DPDK API for this purpose. I'm using DPDK 20.11.0. The setup is successful
> when the application is started on a server with i40e driver but fails when
> the application is started on a server using igb driver.
> In the failure case the validation function returns EINVAL and the error
> message is "only two tuple are supported by this filter".
> I checked the source code of this DPDK driver in
> drivers/net/e1000/igb_flow.c and I saw the following related code there,
> starting at line 449:
>
>         if (filter->src_ip_mask || filter->dst_ip_mask ||
>
>             filter->src_port_mask) {
>
>             memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
>
>             rte_flow_error_set(error, EINVAL,
>
>                 RTE_FLOW_ERROR_TYPE_ITEM,
>
>                 NULL, "only two tuple are "
>
>                 "supported by this filter");
>
>             return -rte_errno;
>
>         }
>
> The condition looks odd to me because it seems to ensure that only
> filtering by destination port is supported while the error message hints
> for something else. Why would filtering only by the destination port be
> allowed!?
> I've provided dst_ip_mask = 0xFFFFFFFF and src_port_mask 0xFFFF because I
> just want to match exact ips and ports and in my understanding this should
> classify, in my understanding, as filtering by "two tuple" - destination ip
> and source port.
>
> So, my questions are:
> 1. Am I missing something about this condition and thus it's the way it
> should be?
> 2. If the question is not appropriate for this user group where should I
> post it - dev@dpdk.org?
>
> Thanks,
> Pavel.
>

[-- Attachment #2: Type: text/html, Size: 5981 bytes --]

      reply	other threads:[~2022-07-29 12:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 10:59 Pavel Vazharov
2022-07-29 12:08 ` Pavel Vazharov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK9EM1_RNT0nM77f49KiEdSFN=D36i=1+som+J8cxbWa=EoTLA@mail.gmail.com' \
    --to=freakpv@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).