netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Travis Stratman <tstratman@emacinc.com>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: netdev@vger.kernel.org
Subject: Re: data received but not detected
Date: Fri, 20 Jun 2008 12:10:59 -0500	[thread overview]
Message-ID: <1213981859.9245.133.camel@localhost.localdomain> (raw)
In-Reply-To: <20080620060219.GA22784@2ka.mipt.ru>

On Fri, 2008-06-20 at 10:02 +0400, Evgeniy Polyakov wrote:
> On Thu, Jun 19, 2008 at 06:10:29PM -0500, Travis Stratman (tstratman@emacinc.com) wrote:
> > Initially, I had run wireshark on my PC and connected it to one of the
> > embedded boards (the issue still shows up in this case). I did some more
> > testing today where I ran tcpdump on both of the boards connected with a
> > cross-over cable until the application froze. What I was able to find
> > was that the first 1 or 2 hangups are corrected after 4 or 5 seconds
> > because the boards send an ARP request when data communication stops.
> > This causes communication to start up again. No packets are ever lost or
> > corrupted, they just don't appear to the application until something
> > else happens on the network.

Also note that it just needs to be data that the board receives, it does
not have to come in on the same port (ARPs, ICMP pings, broadcast
packets all force the data to be recognized).

> This looks like wakeup missing/not accounted (probalby by application).
> Does your application use poll()? If no, can you add it into the
> receiving loop and check its output? Or even add a signal handler for
> harmless signal like usr1 and put poll() call with 0 timeout there, so
> when system will freeze you could check what poll() returns by that
> signal.
Thanks. 

Initially the application was just using a blocking recvfrom() call. I
changed to poll() and non-blocking recvfrom (MSG_DONTWAIT) today, and
poll() always times out when the lockup occurs. I also tried using an
FIONREAD ioctl on the socket and actually saw fairly decent results
using code like this:
--function--
static inline int is_data(int socket)
{
	int num_bytes;
	ioctl(socket, FIONREAD, &num_bytes);
	return num_bytes;
}
-- then before each recvfrom --
while (!is_data(recv_socket)) {usleep(1);}

It ran for about an hour before it froze. I'm not sure why this would
give me better results than poll(), that is something that I'm looking
into.

I also noticed that when I run iperf between the two ARM boards on a
xover cable, I _always_ see at least one dropped packet reported by
iperf. For bandwidths that are below 50m it is almost always 1, but
never 0 dropped. When I run it between my PC and an ARM board, I don't
(generally) see any dropped packets until I exceed 50m for the bandwidth
setting. This probably doesn't mean anything, but it is interesting.


Thanks,

Travis



  parent reply	other threads:[~2008-06-20 17:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-17 22:08 data received but not detected Travis Stratman
2008-06-17 22:27 ` Stephen Hemminger
2008-06-17 22:40   ` Travis Stratman
2008-06-17 22:31 ` Ben Greear
2008-06-17 22:58   ` Travis Stratman
2008-06-17 23:45     ` Ben Greear
2008-06-19 22:53       ` Travis Stratman
2008-06-19 23:08         ` Ben Greear
2008-06-22  9:16         ` James Chapman
2008-07-07 21:56           ` Travis Stratman
2008-07-08  9:37             ` James Chapman
2008-07-15 20:46               ` Travis Stratman
2008-06-18  6:28     ` Evgeniy Polyakov
2008-06-19 23:10       ` Travis Stratman
     [not found]         ` <20080620060219.GA22784@2ka.mipt.ru>
2008-06-20 17:10           ` Travis Stratman [this message]
2008-06-20 17:25             ` Evgeniy Polyakov
2008-06-20 17:41               ` Travis Stratman
2008-06-20 17:54                 ` Evgeniy Polyakov
2008-06-20 18:17                   ` Travis Stratman
2008-06-20 18:23                     ` Evgeniy Polyakov
2008-06-20 21:06                       ` Travis Stratman
2008-06-21  7:12                         ` Evgeniy Polyakov
2008-07-07 21:10                           ` Travis Stratman
2008-07-07 21:25                             ` Evgeniy Polyakov
2008-07-15 20:43                               ` Travis Stratman

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=1213981859.9245.133.camel@localhost.localdomain \
    --to=tstratman@emacinc.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.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).