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-next>] [day] [month] [year] [list]
Message-ID: <20070828224718.GA3512@google.com>
Date:	Tue, 28 Aug 2007 15:47:18 -0700
From:	Mandeep Singh Baines <msb@...gle.com>
To:	netdev@...r.kernel.org
Cc:	grundler@...gle.com, hadi@...erus.ca, robert.olsson@....uu.se,
	venza@...wnhat.org
Subject: pktgen terminating condition

Hi,

I am having some trouble using pktgen with certain NICs. When running
pktgen on some NICs, the test stalls because the worker thread is
waiting for the driver to free the last skb. If a send a few pings out
the interface, the worker thread will eventually unblock.

Below is the snippet of code from  pktgen_xmit():

while (atomic_read(&(pkt_dev->skb->users)) != 1) {
	if (signal_pending(current)) {
		break;
	}	
	schedule();
}

It seems that some drivers do not immediately free skbs on transmit complete. 
They will hold the skb until there are more packets to free. One example
is the sis900 driver which uses TX_IDLE (tx state-machine idle) instead of 
TX_OK (tx completed) as a way of coalescing interrupts. I've also seen
another driver which does something similar. Not sure how prevalent this
technique is.

So is this a bug in the drivers or a bug in pktgen?

If deferring skb cleanup is OK, then a potential way to fix pktgen
would be to not wait and just live with a little inaccuracy bounded
by the size of the Tx ring. So for a 1K ring and a 10E6 packet test
an error of 0.1%. Another approach would be to send a configurable
amount of extra packets to force a kfree_skb() of the last packet
you want to measure.

Thoughts?

Regards,
Mandeep
-
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