Re: [PATCH 2/2] af_packet: pass checksum validation status to the user

2015-03-19 Thread Alexander Drozdov
On Thu, 19 Mar 2015 11:29:32 -0400, Willem de Bruijn wrote: On Thu, Mar 19, 2015 at 4:01 AM, Alexander Drozdov wrote: Introduce TP_STATUS_CSUM_VALID tp_status flag to tell the af_packet user that at least the transport header checksum has been already validated. This changes the interface

Re: [PATCH 2/2] af_packet: pass checksum validation status to the user

2015-03-19 Thread Alexander Drozdov
On 19.03.2015 21:50:03 +0300 Willem de Bruijn wrote: On Thu, Mar 19, 2015 at 2:08 PM, Alexander Drozdov wrote: On Thu, 19 Mar 2015 11:29:32 -0400, Willem de Bruijn wrote: On Thu, Mar 19, 2015 at 4:01 AM, Alexander Drozdov wrote: Introduce TP_STATUS_CSUM_VALID tp_status flag to tell the

[PATCH V2 1/2] af_packet: make tpacket_rcv to not set status value before run_filter

2015-03-22 Thread Alexander Drozdov
It is just an optimization. We don't need the value of status variable if the packet is filtered. Signed-off-by: Alexander Drozdov --- net/packet/af_packet.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f8

[PATCH V2 2/2] af_packet: pass checksum validation status to the user

2015-03-22 Thread Alexander Drozdov
Introduce TP_STATUS_CSUM_VALID tp_status flag to tell the af_packet user that at least the transport header checksum has been already validated. For now, the flag may be set for incoming packets only. Signed-off-by: Alexander Drozdov Cc: Willem de Bruijn --- Documentation/networking

Re: [RESUBMIT Patch 1/1] net: replace if()/BUG with BUG_ON

2015-06-17 Thread Alexander Drozdov
On Wed, 17 Jun 2015 09:36:11 +0200, Frans Klaver wrote: On Wed, Jun 17, 2015 at 6:36 AM, Maninder Singh wrote: Use BUG_ON(condition) instead of if(condition)/BUG() . Signed-off-by: Maninder Singh Reviewed-by: Akhilesh Kumar --- net/packet/af_packet.c |3 +-- 1 files changed, 1 inserti

[PATCH] packet: tpacket_snd(): fix signed/unsigned comparison

2015-07-28 Thread Alexander Drozdov
to just returning an incorrect EMSGSIZE errno to the user. Signed-off-by: Alexander Drozdov --- net/packet/af_packet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index c9e8741..d1d3625 100644 --- a/net/packet/af_packe

[RESEND PATCH] af_packet: don't pass empty blocks for PACKET_V3

2015-02-23 Thread Alexander Drozdov
at happens because af_packet closes the current block on timeout even if the block is empty. Passing empty blocks to the user not only wastes CPU but also wastes ring buffer space increasing probability of packets dropping on small timeouts. Signed-off-by: Alexander Drozdov Cc: Dan Collins Cc: Willem

[PATCH] ipv4: ip_check_defrag should not assume that skb_network_offset is zero

2015-03-04 Thread Alexander Drozdov
ip_check_defrag() may be used by af_packet to defragment outgoing packets. skb_network_offset() of af_packet's outgoing packets is not zero. Signed-off-by: Alexander Drozdov --- net/ipv4/ip_fragment.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net

[PATCH] netfilter: ipset: make ip_set_get_ip*_port to use skb_network_offset

2015-03-06 Thread Alexander Drozdov
All the ipset functions respect skb->network_header value, except for ip_set_get_ip4_port() & ip_set_get_ip6_port(). The functions should use skb_network_offset() to get the transport header offset. Signed-off-by: Alexander Drozdov --- net/netfilter/ipset/ip_set_getport.c | 6 --

[PATCH 1/2] af_packet: make tpacket_rcv to not set status value before run_filter

2015-03-19 Thread Alexander Drozdov
It is just an optimization. We don't need the value of status variable if the packet is filtered. Signed-off-by: Alexander Drozdov --- net/packet/af_packet.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f8

[PATCH 2/2] af_packet: pass checksum validation status to the user

2015-03-19 Thread Alexander Drozdov
Introduce TP_STATUS_CSUM_VALID tp_status flag to tell the af_packet user that at least the transport header checksum has been already validated. For now, the flag may be set for incoming packets only. Signed-off-by: Alexander Drozdov --- include/uapi/linux/if_packet.h | 1 + net/packet

[PATCH] af_packet: don't pass empty blocks for PACKET_V3

2015-02-04 Thread Alexander Drozdov
lieve its better to set timeout for poll(2) when needed than to get empty blocks every millisecond when not needed. Signed-off-by: Alexander Drozdov --- net/packet/af_packet.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packe

Re: [PATCH] af_packet: don't pass empty blocks for PACKET_V3

2015-02-05 Thread Alexander Drozdov
On 06.02.2015 00:16:30 +0300 Guy Harris wrote: On Feb 5, 2015, at 12:01 PM, Willem de Bruijn wrote: On Wed, Feb 4, 2015 at 9:58 PM, Alexander Drozdov wrote: Don't close an empty block on timeout. Its meaningless to pass it to the user. Moreover, passing empty blocks wastes CPU &am

Re: [PATCH] af_packet: don't pass empty blocks for PACKET_V3

2015-02-05 Thread Alexander Drozdov
On 05.02.2015 23:01:38 +0300 Willem de Bruijn wrote: On Wed, Feb 4, 2015 at 9:58 PM, Alexander Drozdov wrote: Don't close an empty block on timeout. Its meaningless to pass it to the user. Moreover, passing empty blocks wastes CPU & buffer space increasing probability of packets dr

[RESEND PATCH] ipv4: ip_check_defrag should correctly check return value of skb_copy_bits

2015-02-19 Thread Alexander Drozdov
skb_copy_bits() returns zero on success and a negative value on error, so it is needed to invert the condition in ip_check_defrag(). Fixes: 1bf3751ec90c ("ipv4: ip_check_defrag must not modify skb before unsharing") Signed-off-by: Alexander Drozdov Acked-by: Eric Dumazet Cc: Joh

[PATCH] af_packet: allow packets defragmentation not only for hash fanout type

2015-02-19 Thread Alexander Drozdov
ments from different rings 2. Defragment by itself Signed-off-by: Alexander Drozdov --- 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

[PATCH] ipv4: ip_check_defrag should correctly check return value of skb_copy_bits

2015-02-17 Thread Alexander Drozdov
skb_copy_bits() returns zero on success and negative value on error, so it is needed to invert the condition in ip_check_defrag(). Fixes: 1bf3751ec90c ("ipv4: ip_check_defrag must not modify skb before unsharing") Signed-off-by: Alexander Drozdov --- net/ipv4/ip_fragment.c | 2