All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] af_packet: allow packets defragmentation not only for hash fanout type
@ 2015-02-20  5:24 Alexander Drozdov
  2015-02-22  4:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Drozdov @ 2015-02-20  5:24 UTC (permalink / raw)
  To: David S. Miller, Daniel Borkmann, Eric Dumazet, Al Viro,
	Willem de Bruijn, Michael S. Tsirkin
  Cc: netdev, linux-kernel, Alexander Drozdov

Packets defragmentation was introduced for PACKET_FANOUT_HASH only,
see 7736d33f4262 ("packet: Add pre-defragmentation support for ipv4
fanouts")

It may be useful to have defragmentation enabled regardless of
fanout type. Without that, the AF_PACKET user may have to:
1. Collect fragments from different rings
2. Defragment by itself

Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>
---
 net/packet/af_packet.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 9c28cec..99fc628 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1349,14 +1349,14 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
 		return 0;
 	}
 
+	if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
+		skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
+		if (!skb)
+			return 0;
+	}
 	switch (f->type) {
 	case PACKET_FANOUT_HASH:
 	default:
-		if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
-			skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
-			if (!skb)
-				return 0;
-		}
 		idx = fanout_demux_hash(f, skb, num);
 		break;
 	case PACKET_FANOUT_LB:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] af_packet: allow packets defragmentation not only for hash fanout type
  2015-02-20  5:24 [PATCH] af_packet: allow packets defragmentation not only for hash fanout type Alexander Drozdov
@ 2015-02-22  4:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-02-22  4:00 UTC (permalink / raw)
  To: al.drozdov; +Cc: dborkman, edumazet, viro, willemb, mst, netdev, linux-kernel

From: Alexander Drozdov <al.drozdov@gmail.com>
Date: Fri, 20 Feb 2015 08:24:27 +0300

> Packets defragmentation was introduced for PACKET_FANOUT_HASH only,
> see 7736d33f4262 ("packet: Add pre-defragmentation support for ipv4
> fanouts")
> 
> It may be useful to have defragmentation enabled regardless of
> fanout type. Without that, the AF_PACKET user may have to:
> 1. Collect fragments from different rings
> 2. Defragment by itself
> 
> Signed-off-by: Alexander Drozdov <al.drozdov@gmail.com>

Seems reasonable, applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-22  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20  5:24 [PATCH] af_packet: allow packets defragmentation not only for hash fanout type Alexander Drozdov
2015-02-22  4:00 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.