From: Jussi Kivilinna <hidden> Date: 2012-08-20 14:57:09
Hello,
Is setting skb->truesize in smsc75xx and smsc95xx correct?
In smsc75xx/smsc95xx_rx_fixup(), input skb containing multiple packets
is cloned and truesize for each clone is set to packet-size +
sizeof(struct sk_buff), but input skb has minimum allocation size of
9000 bytes (MAX_SINGLE_PACKET_SIZE) and maximum of 18944 bytes
(DEFAULT_HS_BURST_CAP_SIZE) (+ NET_IP_ALIGN). Doesn't this cause
truesize to be underestimated?
-Jussi
From: Eric Dumazet <hidden> Date: 2012-08-21 09:46:46
On Mon, 2012-08-20 at 17:57 +0300, Jussi Kivilinna wrote:
Hello,
Is setting skb->truesize in smsc75xx and smsc95xx correct?
In smsc75xx/smsc95xx_rx_fixup(), input skb containing multiple packets
is cloned and truesize for each clone is set to packet-size +
sizeof(struct sk_buff), but input skb has minimum allocation size of
9000 bytes (MAX_SINGLE_PACKET_SIZE) and maximum of 18944 bytes
(DEFAULT_HS_BURST_CAP_SIZE) (+ NET_IP_ALIGN). Doesn't this cause
truesize to be underestimated?
This has been discussed in a "TCP transmit performance regression"
thread some weeks ago.
More generally, skb_clone() is not a good idea in rx path.
I dont have the hardware so cannot send a formal patch.
From: Jussi Kivilinna <hidden> Date: 2012-08-22 05:35:52
Quoting Eric Dumazet [off-list ref]:
On Mon, 2012-08-20 at 17:57 +0300, Jussi Kivilinna wrote:
quoted
Hello,
Is setting skb->truesize in smsc75xx and smsc95xx correct?
In smsc75xx/smsc95xx_rx_fixup(), input skb containing multiple packets
is cloned and truesize for each clone is set to packet-size +
sizeof(struct sk_buff), but input skb has minimum allocation size of
9000 bytes (MAX_SINGLE_PACKET_SIZE) and maximum of 18944 bytes
(DEFAULT_HS_BURST_CAP_SIZE) (+ NET_IP_ALIGN). Doesn't this cause
truesize to be underestimated?
This has been discussed in a "TCP transmit performance regression"
thread some weeks ago.
More generally, skb_clone() is not a good idea in rx path.
So all skb_clone use in drivers/net/usb/ should be removed/replaced
with following?
I dont have the hardware so cannot send a formal patch.
Neither do I, was looking for gigabit-usb dongle to buy and ended up
checking various drivers.
I guess I could do and test this for rndis_host/rndis_wlan and add
rx-skb recycling to usbnet core for drivers that do copy-break in
rx_fixup.
-Jussi
From: Eric Dumazet <hidden> Date: 2012-08-22 06:34:53
On Wed, 2012-08-22 at 08:35 +0300, Jussi Kivilinna wrote:
Quoting Eric Dumazet [off-list ref]:
quoted
On Mon, 2012-08-20 at 17:57 +0300, Jussi Kivilinna wrote:
quoted
Hello,
Is setting skb->truesize in smsc75xx and smsc95xx correct?
In smsc75xx/smsc95xx_rx_fixup(), input skb containing multiple packets
is cloned and truesize for each clone is set to packet-size +
sizeof(struct sk_buff), but input skb has minimum allocation size of
9000 bytes (MAX_SINGLE_PACKET_SIZE) and maximum of 18944 bytes
(DEFAULT_HS_BURST_CAP_SIZE) (+ NET_IP_ALIGN). Doesn't this cause
truesize to be underestimated?
This has been discussed in a "TCP transmit performance regression"
thread some weeks ago.
More generally, skb_clone() is not a good idea in rx path.
So all skb_clone use in drivers/net/usb/ should be removed/replaced
with following?
Doing a copy might be expensive on some low end hardware, so I can
understand why this skb_clone() idea was deployed years ago.
Gigabit r8169 has to perform the copy because of security issue, and so
far nobody complained of performance impact.
Best thing would be to not use large buffers from the beginning,
and switch to a frag idea.
(A large frame would needs 2 or 3 medium buffers, as done in ath9k)
Check https://gerrit.chromium.org/gerrit/#/c/18412/
and commit 0d95521ea74735826cb2e28bebf6a07392c75bfa (ath9k: use split rx
buffers to get rid of order-1 skb allocations)