public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: linux-kernel@vger.kernel.org
Subject: are ioctl calls supposed to take this long?
Date: Fri, 06 Jul 2001 09:34:36 -0400	[thread overview]
Message-ID: <3B45BE6C.5DBE4F35@nortelnetworks.com> (raw)


I am using the following snippet of code to find out some information about the
MII PHY interface of my ethernet device (which uses the tulip driver).  When I
did some timing measurements with gettimeofday() I found that the ioctl call
takes a bit over a millisecond to complete.  This seems to me to be an awfully
long time for what should be (as far as I can see) a very simple operation.

Is this the normal amount of time that this should take, and if so then why in
the world does it take so long?  If not, then does anyone have any idea why it's
taking so long?

Thanks,

Chris



// code follows //


int skfd;
struct ifreq ifr;
ifname = "eth1";
   
if ((skfd = socket(AF_INET, SOCK_DGRAM,0)) < 0)
{
   perror("socket");
   exit(-1);
}
   
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
   
if (ioctl(skfd, SIOCDEVPRIVATE, &ifr) < 0)
{
   fprintf(stderr, "SIOCDEVPRIVATE, on %s failed: %s\n", ifname,
strerror(errno));
   close(skfd);
   exit(-1);
}









-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com

             reply	other threads:[~2001-07-06 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-06 13:34 Chris Friesen [this message]
2001-07-06 14:41 ` are ioctl calls supposed to take this long? Richard B. Johnson
2001-07-06 15:14   ` Chris Friesen
2001-07-06 15:32     ` Richard B. Johnson
2001-07-06 15:40       ` Chris Friesen
2001-07-06 18:26       ` why this 1ms delay in mdio_read? (cont'd from "are ioctl calls supposed to take this long?") Chris Friesen
2001-07-06 18:48         ` Richard B. Johnson
2001-07-06 19:35           ` Chris Friesen
2001-07-06 21:41         ` Donald Becker

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=3B45BE6C.5DBE4F35@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@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