lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D5C1322C3E673F459512FB59E0DDC32902FFCE03@orsmsx414.amr.corp.intel.com>
Date:	Fri, 8 Jun 2007 12:55:50 -0700
From:	"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@...el.com>
To:	"Krishna Kumar2" <krkumar2@...ibm.com>,
	"Sridhar Samudrala" <sri@...ibm.com>
Cc:	"Kok, Auke-jan H" <auke-jan.h.kok@...el.com>,
	"David Miller" <davem@...emloft.net>, <hadi@...erus.ca>,
	<jeff@...zik.org>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
	<kaber@...sh.net>, <netdev@...r.kernel.org>
Subject: RE: [PATCH] NET: Multiqueue network device support.

> I thought the correct use is to get this lock on clean_tx 
> side which can get called on a different cpu on rx (which 
> also cleans up slots for skbs that have finished xmit). Both 
> TX and clean_tx uses the same tx_ring's head/tail ptrs and 
> should be exclusive. But I don't find clean tx using this 
> lock in the code, so I am confused :-)

>From e1000_main.c, e1000_clean():

        /* e1000_clean is called per-cpu.  This lock protects
         * tx_ring[0] from being cleaned by multiple cpus
         * simultaneously.  A failure obtaining the lock means
         * tx_ring[0] is currently being cleaned anyway. */
        if (spin_trylock(&adapter->tx_queue_lock)) {
                tx_cleaned = e1000_clean_tx_irq(adapter,
                                                &adapter->tx_ring[0]);
                spin_unlock(&adapter->tx_queue_lock);
        }

In a multi-ring implementation of the driver, this is wrapped with for
(i = 0; i < adapter->num_tx_queues; i++) and &adapter->tx_ring[i].  This
lock also prevents the clean routine from stomping on xmit_frame() when
transmitting.  Also in the multi-ring implementation, the tx_lock is
pushed down into the individual tx_ring struct, not at the adapter
level.

Cheers,

-PJ Waskiewicz
peter.p.waskiewicz.jr@...el.com
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ