From: Mithlesh Thukral <mithlesh@linsyssoft.com>
To: netdev@vger.kernel.org
Subject: Doubt about locking in ixgb driver
Date: Wed, 9 Aug 2006 18:54:14 +0530 [thread overview]
Message-ID: <200608091854.14584.mithlesh@linsyssoft.com> (raw)
hi all,
The transmit functions of ethernet drivers (dev->hard_start_xmit) are
protected to prevent multiple execution of transmits going in parallel. The
general scheme used by most of driver is :
1. Reset NETIF_F_LLTX flag in dev->features and then use kernel locking given
through HARD_TX_LOCK (net/core/dev.c:3417)
OR
2. Use a internal lock of driver generally kept in adapter to prevent multiple
accesses.
In ixgb driver (drivers/net/ixgb/), there is a lock in adapter of driver
(adapter->tx_lock). But this is left before the ixgb_xmit_frame() function
returns. The access to adapter->tx_ring.next_to_use which i suppose will be
the index of next element to use from tx_ring is accessed outside the area
where lock is held. What will prevent race condition during accessing
adapter->tx_ring.next_to_use ?
How does multiple instances of xmit not run or multiple instances of xmit
running is fine ?
Regards,
Mithlesh Thukral
reply other threads:[~2006-08-10 11:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200608091854.14584.mithlesh@linsyssoft.com \
--to=mithlesh@linsyssoft.com \
--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).