Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152510227
D2551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D2551.diff
View Options
Index: head/sys/dev/sfxge/sfxge_tx.c
===================================================================
--- head/sys/dev/sfxge/sfxge_tx.c
+++ head/sys/dev/sfxge/sfxge_tx.c
@@ -602,7 +602,6 @@
int
sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m)
{
- int locked;
int rc;
if (!SFXGE_LINK_UP(txq->sc)) {
@@ -616,9 +615,7 @@
* the packet will be appended to the "get list" of the deferred
* packet list. Otherwise, it will be pushed on the "put list".
*/
- locked = SFXGE_TXQ_TRYLOCK(txq);
-
- if (locked) {
+ if (SFXGE_TXQ_TRYLOCK(txq)) {
/* First swizzle put-list to get-list to keep order */
sfxge_tx_qdpl_swizzle(txq);
@@ -627,6 +624,10 @@
SFXGE_TXQ_UNLOCK(txq);
goto fail;
}
+
+ /* Try to service the list. */
+ sfxge_tx_qdpl_service(txq);
+ /* Lock has been dropped. */
} else {
rc = sfxge_tx_qdpl_put_unlocked(txq, m);
if (rc != 0)
@@ -639,14 +640,13 @@
* the deferred packet list. If we are not able to get
* the lock, another thread is processing the list.
*/
- locked = SFXGE_TXQ_TRYLOCK(txq);
+ if (SFXGE_TXQ_TRYLOCK(txq)) {
+ sfxge_tx_qdpl_service(txq);
+ /* Lock has been dropped. */
+ }
}
- if (locked) {
- /* Try to service the list. */
- sfxge_tx_qdpl_service(txq);
- /* Lock has been dropped. */
- }
+ SFXGE_TXQ_LOCK_ASSERT_NOTOWNED(txq);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 10:17 AM (2 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31595498
Default Alt Text
D2551.diff (1 KB)
Attached To
Mode
D2551: sfxge: get rid of locked variable in sfxge_tx_packet_add()
Attached
Detach File
Event Timeline
Log In to Comment