[dpdk-dev] [PATCH v2] kni: Fix request overwritten
Eric Christian
erclists at gmail.com
Mon Oct 4 16:14:00 CEST 2021
Adding Sahithi.
I believe adding the -EAGAIN method puts the responsibility on the
application/caller. If we take the change MAC address as an example. Most
application code just does this kind of check:
ret = ioctl(sockfd, SIOCSIFHWADDR, &ifr);
if (ret < 0) {
PMD_LOG_ERRNO(ERR, "ioctl(SIOCSIFHWADDR) failed");
return -EINVAL;
}
So the existing application code will treat the -EAGAIN as a failure and
not retry. Unless it is expected that the IOCTL can return -EAGAIN and the
application decides to keep retrying?
We can try this, but we have temporarily patched out the async changes in
our code as it was blocking QA due to
https://bugs.dpdk.org/show_bug.cgi?id=816
Eric
On Mon, Oct 4, 2021 at 9:05 AM Ferruh Yigit <ferruh.yigit at intel.com> wrote:
> On 9/24/2021 11:54 AM, Elad Nachman wrote:
> > Fix lack of multiple KNI requests handling support by introducing a
> > request in progress flag which will fail additional requests with
> > EAGAIN return code if the original request has not been processed
> > by user-space.
> >
> > Bugzilla ID: 809
>
> Hi Eric,
>
> Can you please test this patch, if it solves the issue you reported?
>
> >
> > Signed-off-by: Elad Nachman <eladv6 at gmail.com>
> > ---
> > kernel/linux/kni/kni_net.c | 9 +++++++++
> > lib/kni/rte_kni.c | 2 ++
> > lib/kni/rte_kni_common.h | 1 +
> > 3 files changed, 12 insertions(+)
> >
>
> <...>
>
> > @@ -123,7 +124,15 @@ kni_net_process_request(struct net_device *dev,
> struct rte_kni_request *req)
> >
> > mutex_lock(&kni->sync_lock);
> >
> > + /* Check that existing request has been processed: */
> > + cur_req = (struct rte_kni_request *)kni->sync_kva;
> > + if (cur_req->req_in_progress) {
> > + ret = -EAGAIN;
>
> Overall logic in the KNI looks good to me, this helps to serialize the
> requests
> even for async ones.
>
> But can you please clarify how it behaves in the kernel side with '-EAGAIN'
> return type? Will linux call the ndo again, or will it just fail.
>
> If it just fails should we handle the re-try on '-EAGAIN' within the kni
> module?
>
>
More information about the dev
mailing list