DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "bugzilla@dpdk.org" <bugzilla@dpdk.org>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Rao, Nikhil" <nikhil.rao@intel.com>,
	"Jayatheerthan, Jay" <jay.jayatheerthan@intel.com>,
	"pbhagavatula@marvell.com" <pbhagavatula@marvell.com>,
	"heng.wang@ericsson.com" <heng.wang@ericsson.com>
Subject: Re: [dpdk-dev] [Bug 721] Wrong event pointer in rx adapter
Date: Wed, 26 May 2021 09:54:16 +0000	[thread overview]
Message-ID: <BYAPR11MB3143EA6F9C20520071FAAD8DD7249@BYAPR11MB3143.namprd11.prod.outlook.com> (raw)
In-Reply-To: <bug-721-3@http.bugs.dpdk.org/>

> From: dev <dev-bounces@dpdk.org> On Behalf Of bugzilla@dpdk.org
> Sent: Wednesday, May 26, 2021 9:24 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [Bug 721] Wrong event pointer in rx adapter
> 
> https://bugs.dpdk.org/show_bug.cgi?id=721
> 
>             Bug ID: 721
>            Summary: Wrong event pointer in rx adapter
>            Product: DPDK
>            Version: 20.11
>           Hardware: All
>                 OS: All
>             Status: UNCONFIRMED
>           Severity: major
>           Priority: Normal
>          Component: eventdev
>           Assignee: dev@dpdk.org
>           Reporter: heng.wang@ericsson.com
>   Target Milestone: ---
> 
> Problem:
> In the function rxa_buffer_mbufs the ev is not reset to the array's first
> element before passing to a user call back function.
> 
> Workaround:
> In the user callback, we must decrement ev by number of event before we can use
> it.
> 
> Fix:
> I think we should pass &buf->events[buf->count] to dev_info->cb_fn instead of
> ev.
> 
>  773         for (i = 0; i < num; i++) {
>  774                 m = mbufs[i];
>  775
>  776                 rss = do_rss ?
>  777                         rxa_do_softrss(m, rx_adapter->rss_key_be) :
>  778                         m->hash.rss;
>  779                 ev->event = event;
>  780                 ev->flow_id = (rss & ~flow_id_mask) |
>  781                                 (ev->flow_id & flow_id_mask);
>  782                 ev->mbuf = m;
>  783                 ev++;
>  784         }
>  785
>  786         if (dev_info->cb_fn) {
>  787
>  788                 dropped = 0;
>  789                 nb_cb = dev_info->cb_fn(eth_dev_id, rx_queue_id,
>  790                                         ETH_EVENT_BUFFER_SIZE, buf->count,
> ev,
>  791                                         num, dev_info->cb_arg, &dropped);
>  792                 if (unlikely(nb_cb > num))
>  793                         RTE_EDEV_LOG_ERR("Rx CB returned %d (> %d)
> events",
>  794                                 nb_cb, num);
>  795                 else
>  796                         num = nb_cb;
>  797                 if (dropped)
>  798                         rx_adapter->stats.rx_dropped += dropped;
>  799         }

+CC RX Adapter Maintainer, and Pavan as this code has been changed recently.

I've done a quick review of the above report, and believe it to be a genuine bug,
however this code has been refactored in commit d7c428e557b as part of series
to " eventdev: support Rx adapter event vector".

The relevant diff here for reference:
Note "ev" pointer replaced with "&buf->events[buf->count]"

                dropped = 0;
                nb_cb = dev_info->cb_fn(eth_dev_id, rx_queue_id,
-                                       ETH_EVENT_BUFFER_SIZE, buf->count, ev,
-                                       num, dev_info->cb_arg, &dropped);
+                                       ETH_EVENT_BUFFER_SIZE, buf->count,
+                                       &buf->events[buf->count], num,
+                                       dev_info->cb_arg, &dropped);
                if (unlikely(nb_cb > num)) 


Based on this investigation, although the code changed, the same bug seems present,
as really &buf->events[0] should be passed to the callback?

Regards, -Harry

  reply	other threads:[~2021-05-26  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  8:23 bugzilla
2021-05-26  9:54 ` Van Haaren, Harry [this message]
2021-05-26 13:02   ` Pavan Nikhilesh Bhagavatula
2021-05-27  8:18     ` Van Haaren, Harry
2021-06-01  6:23       ` Jayatheerthan, Jay
2021-06-21  9:20 ` bugzilla

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=BYAPR11MB3143EA6F9C20520071FAAD8DD7249@BYAPR11MB3143.namprd11.prod.outlook.com \
    --to=harry.van.haaren@intel.com \
    --cc=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=heng.wang@ericsson.com \
    --cc=jay.jayatheerthan@intel.com \
    --cc=nikhil.rao@intel.com \
    --cc=pbhagavatula@marvell.com \
    /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).