* [PATCH] net: Take GSO into account when capturing packets
@ 2009-07-06 18:04 Benjamin Poirier
2009-07-07 1:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Poirier @ 2009-07-06 18:04 UTC (permalink / raw)
To: David S. Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
tcpdump-workers-YE1jQ5a0g24KACXWX4p+q9i2O/JbrIOy,
wireshark-dev-IZ8446WsY0/dtAWm4Da02A
move the point where the support routine for packet capture is called to
better reflect what is transmitted on the wire when GSO is active.
At the moment, packet capture (a la tcpdump) on the transmission side happens
before GSO takes place (if it does). Therefore, even if a packet gets
segmented by GSO, the capture shows that one big packet was sent when in fact
many small packets were sent on the wire. This behavior does not reflect the
"reality" of what is transmitted and could lead to confusion, especially since
a capture on the receiving side shows the segmented packets.
Signed-off-by: Benjamin Poirier <benjamin.poirier-scC8bbJcJLCw5LPnMra/2Q@public.gmane.org>
---
I've tested that the patch does what it intends to do by taking a capture on
the sending and receiving side of a network benchmark that sends incrementally
larger chunks of data. Without the patch, Wireshark shows that frames larger
than the MTU were sent as is and it shows that they were received as many
smaller frames. With the patch it shows that many small frames were sent and
received.
I would've liked to test the performance impact of the additional
list_empty() tests in the GSO loop but unfortunately I'm already limited by
the network speed, not the cpu. Fast Ethernet, blah
net/core/dev.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 70c27e0..e87bbaf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1686,9 +1686,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
int rc;
if (likely(!skb->next)) {
- if (!list_empty(&ptype_all))
- dev_queue_xmit_nit(skb, dev);
-
if (netif_needs_gso(dev, skb)) {
if (unlikely(dev_gso_segment(skb)))
goto out_kfree_skb;
@@ -1696,6 +1693,9 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
goto gso;
}
+ if (!list_empty(&ptype_all))
+ dev_queue_xmit_nit(skb, dev);
+
/*
* If device doesnt need skb->dst, release it right now while
* its hot in this cpu cache
@@ -1729,6 +1729,10 @@ gso:
skb->next = nskb->next;
nskb->next = NULL;
+
+ if (!list_empty(&ptype_all))
+ dev_queue_xmit_nit(nskb, dev);
+
rc = ops->ndo_start_xmit(nskb, dev);
if (unlikely(rc)) {
nskb->next = skb->next;
--
1.6.3.3
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev-IZ8446WsY0/dtAWm4Da02A@public.gmane.org>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request-IZ8446WsY0/dtAWm4Da02A@public.gmane.org?subject=unsubscribe
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: Take GSO into account when capturing packets
2009-07-06 18:04 [PATCH] net: Take GSO into account when capturing packets Benjamin Poirier
@ 2009-07-07 1:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-07-07 1:15 UTC (permalink / raw)
To: benjamin.poirier; +Cc: netdev, linux-kernel, tcpdump-workers, wireshark-dev
From: Benjamin Poirier <benjamin.poirier@polymtl.ca>
Date: Mon, 06 Jul 2009 14:04:32 -0400
> move the point where the support routine for packet capture is called to
> better reflect what is transmitted on the wire when GSO is active.
>
> At the moment, packet capture (a la tcpdump) on the transmission side happens
> before GSO takes place (if it does). Therefore, even if a packet gets
> segmented by GSO, the capture shows that one big packet was sent when in fact
> many small packets were sent on the wire. This behavior does not reflect the
> "reality" of what is transmitted and could lead to confusion, especially since
> a capture on the receiving side shows the segmented packets.
>
> Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
TSO does the same exact thing except that the networking card
chops up the packet before it hits the wire.
I really doubt there is anything seriously to gain by having
GSO behave one way and TSO another, and we should just keep
things as they are right now.
I'm not applying this, sorry.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-07 1:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 18:04 [PATCH] net: Take GSO into account when capturing packets Benjamin Poirier
2009-07-07 1:15 ` David Miller
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).