All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pintu Kumar <pintu.ping@gmail.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Kernel oops during rtnet loopback usage on x86_64 (e1000e)
Date: Mon, 25 Jun 2018 18:26:22 +0530	[thread overview]
Message-ID: <CAOuPNLhYPGrP5s0y6e9HFUVrg2aDochOxF_fMkbjTmYnEvPOQQ@mail.gmail.com> (raw)
In-Reply-To: <6da8a3e2-7a76-afb2-c46c-7c173a8e444c@siemens.com>

> As a workaround, run the kernel with nosmap.
OK, I guessed it correctly and tried with kernel commandline "nosmap".
Because it works normally on virtual box.

With "nosmap" I don't see any kernel oops, but there are no prints either.
I mean in my rtnet-server/client, I have given some print statement.
But I am not seeing those print statement coming on the console now.
The print statements are coming for normal "xeno_task" application.

Is there any clue for this ?


Thanks,
Pintu





On Thu, Jun 21, 2018 at 8:27 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 2018-06-21 15:41, Jan Kiszka wrote:
> > On 2018-06-21 13:55, Jan Kiszka wrote:
> >> On 2018-06-21 13:20, Pintu Kumar wrote:
> >>> Dear Jan, Greg,
> >>>
> >>> Is there any pointer about this issue?
> >>> This is blocking my next work..
> >>
> >> Does this solve the issue AND still generate valid UDP checksums (please
> >> check with wireshark or against a normal networking stack?
> >>
> >> diff --git a/kernel/drivers/net/stack/ipv4/udp/udp.c b/kernel/drivers/net/stack/ipv4/udp/udp.c
> >> index 8e80d3e0b..bb0b0fc12 100644
> >> --- a/kernel/drivers/net/stack/ipv4/udp/udp.c
> >> +++ b/kernel/drivers/net/stack/ipv4/udp/udp.c
> >> @@ -556,18 +556,17 @@ static int rt_udp_getfrag(const void *p, unsigned char *to,
> >>      if (offset)
> >>          return rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen, to, fraglen);
> >>
> >> -    /* Checksum of the complete data part of the UDP message: */
> >> -    for (i = 0; i < ufh->iovlen; i++) {
> >> -            ufh->wcheck = csum_partial(ufh->iov[i].iov_base, ufh->iov[i].iov_len,
> >> -                                       ufh->wcheck);
> >> -    }
> >> -
> >>      ret = rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen,
> >>                            to + sizeof(struct udphdr),
> >>                            fraglen - sizeof(struct udphdr));
> >>      if (ret)
> >>          return ret;
> >>
> >> +    /* Checksum of the complete data part of the UDP message: */
> >> +    ufh->wcheck = csum_partial(to + sizeof(struct udphdr),
> >> +                           fraglen - sizeof(struct udphdr),
> >> +                           ufh->wcheck);
> >> +
> >>      /* Checksum of the udp header: */
> >>      ufh->wcheck = csum_partial((unsigned char *)ufh,
> >>                             sizeof(struct udphdr), ufh->wcheck);
> >>
> >
> > This was definitely wrong. Here is another try:
> >
> > diff --git a/kernel/drivers/net/stack/ipv4/udp/udp.c b/kernel/drivers/net/stack/ipv4/udp/udp.c
> > index 8e80d3e0b..6cf1d369e 100644
> > --- a/kernel/drivers/net/stack/ipv4/udp/udp.c
> > +++ b/kernel/drivers/net/stack/ipv4/udp/udp.c
> > @@ -549,6 +549,7 @@ static int rt_udp_getfrag(const void *p, unsigned char *to,
> >                            unsigned int offset, unsigned int fraglen)
> >  {
> >      struct udpfakehdr *ufh = (struct udpfakehdr *)p;
> > +    unsigned int datalen = 0;
> >      int i, ret;
> >
> >
> > @@ -556,18 +557,18 @@ static int rt_udp_getfrag(const void *p, unsigned char *to,
> >      if (offset)
> >           return rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen, to, fraglen);
> >
> > -    /* Checksum of the complete data part of the UDP message: */
> > -    for (i = 0; i < ufh->iovlen; i++) {
> > -            ufh->wcheck = csum_partial(ufh->iov[i].iov_base, ufh->iov[i].iov_len,
> > -                                       ufh->wcheck);
> > -    }
> > -
> >      ret = rtnet_read_from_iov(ufh->fd, ufh->iov, ufh->iovlen,
> >                             to + sizeof(struct udphdr),
> >                             fraglen - sizeof(struct udphdr));
> >      if (ret)
> >           return ret;
> >
> > +    /* Checksum of the complete data part of the UDP message: */
> > +    for (i = 0; i < ufh->iovlen; i++)
> > +         datalen += ufh->iov[i].iov_len;
> > +    ufh->wcheck = csum_partial(to + sizeof(struct udphdr), datalen,
> > +                            ufh->wcheck);
> > +
> >      /* Checksum of the udp header: */
> >      ufh->wcheck = csum_partial((unsigned char *)ufh,
> >                              sizeof(struct udphdr), ufh->wcheck);
> >
>
> OK, this won't work either if fraglen < datalen. We have to rework this
> more fundamentally.
>
> As a workaround, run the kernel with nosmap.
>
> Jan


  reply	other threads:[~2018-06-25 12:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25  8:39 [Xenomai] Kernel oops during rtnet loopback usage on x86_64 (e1000e) Pintu Kumar
2018-04-25 10:05 ` Jan Kiszka
2018-04-25 11:36   ` Pintu Kumar
2018-04-26 16:23     ` Jan Kiszka
2018-06-19 13:48       ` Pintu Kumar
2018-06-20  7:54         ` Pintu Kumar
2018-06-21 11:20           ` Pintu Kumar
2018-06-21 11:55             ` Jan Kiszka
2018-06-21 12:27               ` [Xenomai] Kernel panic during kernel bootup on arm64 qemu (e1000e) gengdongjiu
2018-06-21 13:47                 ` Greg Gallagher
2018-06-21 13:56                   ` [Xenomai] Kernel panic during kernel bootup on arm64 qemu gengdongjiu
     [not found]                   ` <5b2baebc.1c69fb81.af598.ef46SMTPIN_ADDED_BROKEN@mx.google.com>
2018-06-21 14:04                     ` Greg Gallagher
2018-06-21 14:14                       ` gengdongjiu
2018-06-21 13:41               ` [Xenomai] Kernel oops during rtnet loopback usage on x86_64 (e1000e) Jan Kiszka
2018-06-21 14:57                 ` Jan Kiszka
2018-06-25 12:56                   ` Pintu Kumar [this message]
2018-06-26 11:08                     ` Pintu Kumar
2018-06-27 10:20                       ` Jan Kiszka
2018-06-27 10:56                         ` Pintu Kumar
2018-06-27 11:14                           ` Jan Kiszka
2018-06-27 14:12                             ` Pintu Kumar
2018-06-27 16:17                               ` Jan Kiszka
2018-06-27 17:13                                 ` Pintu Kumar
2018-06-27 17:17                                   ` Greg Gallagher
2018-06-27 17:29                                     ` Pintu Kumar
2018-06-27 18:10                                       ` Philippe Gerum
2018-06-28 10:40                                         ` Pintu Kumar
2018-06-28 13:07                                           ` Philippe Gerum
2018-06-27 18:04                                 ` Philippe Gerum
2018-11-04 16:17                   ` Philippe Gerum
2018-11-06 18:57                     ` Jan Kiszka
2018-11-07 10:04                       ` Philippe Gerum
2018-11-07 10:19                         ` Jan Kiszka
2018-11-07 10:31                           ` Philippe Gerum
2018-11-07 11:19                             ` Jan Kiszka
2018-11-07 11:29                               ` Philippe Gerum

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=CAOuPNLhYPGrP5s0y6e9HFUVrg2aDochOxF_fMkbjTmYnEvPOQQ@mail.gmail.com \
    --to=pintu.ping@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.