* Re: [PATCH V2 net-next] ipx: remove unnecessary casting on ntohl
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, joe, acme, netdev
In-Reply-To: <1414439709-5870-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 20:55:08 +0100
> use %08X instead of %08lX and remove casting.
>
> Suggested-by: Joe Perches <joe@perches.com>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> V2: remove casting instead of long unsigned int -> unsigned long
> (suggested by Joe Perches)
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipx: move extern sysctl_ipx_pprop_broadcasting to header file
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, acme, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1414436441-4784-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 20:00:41 +0100
> include ipx.h from sysctl_net_ipx.c
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipv6: include linux/uaccess.h instead of asm/uaccess.h
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1414433578-29321-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:12:58 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipv6: replace min/casting by min_t
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1414433516-29278-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:11:56 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1] ipv4: remove set but unused variable sha
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <1414433002-29106-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:03:22 +0100
> unsigned char *sha (source) was already in original git version
> but was never used.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] net/irda: include linux/uaccess.h instead of asm/uaccess.h
From: David Miller @ 2014-10-27 20:04 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, samuel, netdev
In-Reply-To: <1414432809-29054-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:00:08 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
* [PATCH V2 net-next] ipx: remove unnecessary casting on ntohl
From: Fabian Frederick @ 2014-10-27 19:55 UTC (permalink / raw)
To: linux-kernel
Cc: joe, Fabian Frederick, Arnaldo Carvalho de Melo, David S. Miller,
netdev
use %08X instead of %08lX and remove casting.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: remove casting instead of long unsigned int -> unsigned long
(suggested by Joe Perches)
net/ipx/ipx_proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
index e15c16a..8391191 100644
--- a/net/ipx/ipx_proc.c
+++ b/net/ipx/ipx_proc.c
@@ -89,8 +89,8 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v)
seq_printf(seq, "%08lX ", (unsigned long int)ntohl(rt->ir_net));
if (rt->ir_routed)
- seq_printf(seq, "%08lX %02X%02X%02X%02X%02X%02X\n",
- (long unsigned int)ntohl(rt->ir_intrfc->if_netnum),
+ seq_printf(seq, "%08X %02X%02X%02X%02X%02X%02X\n",
+ ntohl(rt->ir_intrfc->if_netnum),
rt->ir_router_node[0], rt->ir_router_node[1],
rt->ir_router_node[2], rt->ir_router_node[3],
rt->ir_router_node[4], rt->ir_router_node[5]);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/1 net-next] ipx: replace __inline__ by inline
From: David Miller @ 2014-10-27 19:46 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, acme, netdev
In-Reply-To: <1414433352-29210-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:09:12 +0100
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
If it's in a foo.c file, just kill the inline completely and let the
compiler decide.
Thanks.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipx: replace long unsigned int by unsigned long
From: David Miller @ 2014-10-27 19:46 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, acme, netdev
In-Reply-To: <1414433133-29161-1-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 27 Oct 2014 19:05:33 +0100
> @@ -90,7 +90,7 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v)
> seq_printf(seq, "%08lX ", (unsigned long int)ntohl(rt->ir_net));
> if (rt->ir_routed)
> seq_printf(seq, "%08lX %02X%02X%02X%02X%02X%02X\n",
> - (long unsigned int)ntohl(rt->ir_intrfc->if_netnum),
> + (unsigned long)ntohl(rt->ir_intrfc->if_netnum),
How about we kill the silly cast altogether and use plain %08X?
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets
From: Tom Herbert @ 2014-10-27 19:36 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, Linux Netdev List
In-Reply-To: <1414435437.32624.1.camel@edumazet-glaptop2.roam.corp.google.com>
On Mon, Oct 27, 2014 at 11:43 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Mon, 2014-10-27 at 11:01 -0700, Tom Herbert wrote:
>> When receiving a packet on an unconnected UDP socket clear the
>> flow table for the corresponding hash. This is needed so flows over
>> unconnected UDP sockets will use RPS instead of using what is
>> present in the flow table. In particular, this avoids having flows
>> over unconnected sockets be perpetually steered by unrelated
>> entries in the flow table (idle TCP connections for instance).
>>
>> Tested:
>>
>> First filled up the RPS flow tables by creating a bunch of TCP
>> connections and letting them turn idle. Next, run netperf UDP_RR
>> with 200 flows.
>>
>> Before fix:
>> Client (connected UDP)
>> 81.15% CPU uilization
>> Server (unneconnedted UDP)
>> 83.63% CPU uilization
>> 118/167/249 90/95/99% latencies
>> 1.59215e+06 tps
>>
>> After fix:
>> Client (connected UDP)
>> 81.13% CPU uilization
>> Server (unneconnedted UDP)
>> 80.68% CPU uilization
>> 116/167/248 90/95/99% latencies
>> 1.61048e+06 tps
>>
>> Signed-off-by: Tom Herbert <therbert@google.com>
>> ---
>> net/ipv4/udp.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
>> index 9a0d346..e58d841 100644
>> --- a/net/ipv4/udp.c
>> +++ b/net/ipv4/udp.c
>> @@ -1451,6 +1451,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
>> if (inet_sk(sk)->inet_daddr) {
>> sock_rps_save_rxhash(sk, skb);
>> sk_mark_napi_id(sk, skb);
>> + } else {
>> + /* For an unconnected socket reset flow hash so that related
>> + * flow will use RPS.
>> + */
>> + sock_rps_reset_flow_hash(skb->hash);
>> }
>
> I believe I already said this patch was wrong Tom.
>
> We need something else for UDP packets.
>
> Its not because RFS is wrong for UDP packets that we want to make it
> worse for TCP traffic.
>
Please try this patch and provide real data to support your points.
> We do now want UDP packets to gradually make flow table empty.
If a TCP connection is hot it will continually refresh the table for
that connection, if connection becomes idle it only takes one received
packet to restore the CPU. The only time there could be a persistent
problem is if collision rate is high (which probably means table is
too small).
>
>
>
>
^ permalink raw reply
* nfs stalls over loopback interface (no sk_data_ready events?)
From: Jeff Layton @ 2014-10-27 19:29 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: Christoph Hellwig, Linux NFS Mailing List, Bruce Fields,
Trond Myklebust
(sorry for resend -- I got the netdev address wrong)
Sending this to netdev since I think I've now determined that this is
not a NFS specific problem. Recently Christoph mentioned that he was
seeing stalls when running xfstests generic/075 test on NFS over the
loopback interface with v3.18-rc1-ish kernel.
The configuration in this case is the nfs server and client on same box
communicating over the lo interface.
Here's are tracepoints from a typical request as it's supposed to work:
mount.nfs-906 [002] ...1 22711.996969: xprt_transmit: xprt=0xffff8800ce961000 xid=0xa8a34513 status=0
nfsd-678 [000] ...1 22711.997082: svc_recv: rq_xid=0xa8a34513 status=164
nfsd-678 [000] ..s8 22711.997185: xprt_lookup_rqst: xprt=0xffff8800ce961000 xid=0xa8a34513 status=0
nfsd-678 [000] ..s8 22711.997186: xprt_complete_rqst: xprt=0xffff8800ce961000 xid=0xa8a34513 status=140
nfsd-678 [000] ...1 22711.997236: svc_send: rq_xid=0xa8a34513 dropme=0 status=144
nfsd-678 [000] ...1 22711.997236: svc_process: rq_xid=0xa8a34513 dropme=0 status=144
...basically, we send a request to the server. Server picks it up and
sends the reply, and then the client IDs that reply and processes it.
This runs along just fine for ~ a minute or so. At some point, the
client stops seeing replies come in:
kworker/2:2-107 [002] ...1 22741.696070: xprt_transmit: xprt=0xffff8800ce961000 xid=0xc3a84513 status=0
nfsd-678 [002] .N.1 22741.696917: svc_recv: rq_xid=0xc3a84513 status=208
nfsd-678 [002] ...1 22741.699890: svc_send: rq_xid=0xc3a84513 dropme=0 status=262252
nfsd-678 [002] ...1 22741.699891: svc_process: rq_xid=0xc3a84513 dropme=0 status=262252
...a bit more tracepoint work seems to show that we just stop getting
sk_data_ready callbacks on the socket at all. I'm not terribly familiar
with the lower-level socket code, so I figured I'd email here and ask...
Anyone have insight into why this might be happening?
Thanks,
--
Jeff Layton <jlayton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* nfs stalls over loopback interface (no sk_data_ready events?)
From: Jeff Layton @ 2014-10-27 19:26 UTC (permalink / raw)
To: netdev-DgEjT+Ai2ygdnm+yROfE0A
Cc: Christoph Hellwig, Linux NFS Mailing List, Bruce Fields,
Trond Myklebust
Sending this to netdev since I think I've now determined that this is
not a NFS specific problem. Recently Christoph mentioned that he was
seeing stalls when running xfstests generic/075 test on NFS over the
loopback interface with v3.18-rc1-ish kernel.
The configuration in this case is the nfs server and client on same box
communicating over the lo interface.
Here's are tracepoints from a typical request as it's supposed to work:
mount.nfs-906 [002] ...1 22711.996969: xprt_transmit: xprt=0xffff8800ce961000 xid=0xa8a34513 status=0
nfsd-678 [000] ...1 22711.997082: svc_recv: rq_xid=0xa8a34513 status=164
nfsd-678 [000] ..s8 22711.997185: xprt_lookup_rqst: xprt=0xffff8800ce961000 xid=0xa8a34513 status=0
nfsd-678 [000] ..s8 22711.997186: xprt_complete_rqst: xprt=0xffff8800ce961000 xid=0xa8a34513 status=140
nfsd-678 [000] ...1 22711.997236: svc_send: rq_xid=0xa8a34513 dropme=0 status=144
nfsd-678 [000] ...1 22711.997236: svc_process: rq_xid=0xa8a34513 dropme=0 status=144
...basically, we send a request to the server. Server picks it up and
sends the reply, and then the client IDs that reply and processes it.
This runs along just fine for ~ a minute or so. At some point, the
client stops seeing replies come in:
kworker/2:2-107 [002] ...1 22741.696070: xprt_transmit: xprt=0xffff8800ce961000 xid=0xc3a84513 status=0
nfsd-678 [002] .N.1 22741.696917: svc_recv: rq_xid=0xc3a84513 status=208
nfsd-678 [002] ...1 22741.699890: svc_send: rq_xid=0xc3a84513 dropme=0 status=262252
nfsd-678 [002] ...1 22741.699891: svc_process: rq_xid=0xc3a84513 dropme=0 status=262252
...a bit more tracepoint work seems to show that we just stop getting
sk_data_ready callbacks on the socket at all. I'm not terribly familiar
with the lower-level socket code, so I figured I'd email here and ask...
Anyone have insight into why this might be happening?
Thanks,
--
Jeff Layton <jlayton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/1 net-next] ipx: move extern sysctl_ipx_pprop_broadcasting to header file
From: Fabian Frederick @ 2014-10-27 19:00 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Arnaldo Carvalho de Melo, David S. Miller,
Alexey Kuznetsov, James Morris, Hideaki YOSHIFUJI,
Patrick McHardy, netdev
include ipx.h from sysctl_net_ipx.c
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
include/net/ipx.h | 3 +++
net/ipx/sysctl_net_ipx.c | 4 +---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/net/ipx.h b/include/net/ipx.h
index 0143180..320f47b 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -42,6 +42,9 @@ struct ipxhdr {
struct ipx_address ipx_source __packed;
};
+/* From af_ipx.c */
+extern int sysctl_ipx_pprop_broadcasting;
+
static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
{
return (struct ipxhdr *)skb_transport_header(skb);
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index ad7c03d..0dafcc5 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -9,14 +9,12 @@
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <net/net_namespace.h>
+#include <net/ipx.h>
#ifndef CONFIG_SYSCTL
#error This file should not be compiled without CONFIG_SYSCTL defined
#endif
-/* From af_ipx.c */
-extern int sysctl_ipx_pprop_broadcasting;
-
static struct ctl_table ipx_table[] = {
{
.procname = "ipx_pprop_broadcasting",
--
1.9.1
^ permalink raw reply related
* Re: [PATCH net-next 1/2] udp: Record RPS flow in socket operations
From: Eric Dumazet @ 2014-10-27 18:50 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev
In-Reply-To: <1414432875-23795-1-git-send-email-therbert@google.com>
On Mon, 2014-10-27 at 11:01 -0700, Tom Herbert wrote:
> Add calls to sock_rps_record_flow for udp_sendmsg, udp_sendpage
> and udp_recvmsg. This enables RFS for connected UDP sockets.
>
> Tested:
...
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
> net/ipv4/udp.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index cd0db54..9a0d346 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -881,6 +881,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
> struct sk_buff *skb;
> struct ip_options_data opt_copy;
>
> + sock_rps_record_flow(sk);
> +
> if (len > 0xFFFF)
> return -EMSGSIZE;
>
> @@ -1113,6 +1115,8 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,
> struct udp_sock *up = udp_sk(sk);
> int ret;
>
> + sock_rps_record_flow(sk);
> +
> if (flags & MSG_SENDPAGE_NOTLAST)
> flags |= MSG_MORE;
>
> @@ -1253,6 +1257,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
> int is_udplite = IS_UDPLITE(sk);
> bool slow;
>
> + sock_rps_record_flow(sk);
> +
> if (flags & MSG_ERRQUEUE)
> return ip_recv_error(sk, msg, len, addr_len);
>
This patch is not needed.
All these paths go through af_inet.c and calls to sock_rps_record_flow()
are already done in inet_sendmsg(), inet_sendpage(), inet_recvmsg()
I wonder what you actually tested.
^ permalink raw reply
* TCP NewReno and single retransmit
From: Marcelo Ricardo Leitner @ 2014-10-27 18:49 UTC (permalink / raw)
To: netdev
Hi,
We have a report from a customer saying that on a very calm connection, like
having only a single data packet within some minutes, if this packet gets to
be re-transmitted, retrans_stamp is only cleared when the next acked packet is
received. But this may make we abort the connection too soon if this next
packet also gets lost, because the reference for the initial loss is still for
a big while ago..
local-machine remote-machine
| |
send#1---->(*1)|--------> data#1 --------->|
| | |
RTO : :
| | |
---(*2)|----> data#1(retrans) ---->|
| (*3)|<---------- ACK <----------|
| | |
| : :
| : :
| : :
16 minutes (or more) :
| : :
| : :
| : :
| | |
send#2---->(*4)|--------> data#2 --------->|
| | |
RTO : :
| | |
---(*5)|----> data#2(retrans) ---->|
| | |
| | |
RTO*2 : :
| | |
| | |
ETIMEDOUT<----(*6)| |
(diagram is not mine)
ETIMEDOUT happens way too early, because that's based on (*2) stamp.
Question is, can't we really clear retrans_stamp on step (*3)? Like with:
@@ -2382,31 +2382,32 @@ static inline bool tcp_may_undo(const struct tcp_sock *tp)
static bool tcp_try_undo_recovery(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_may_undo(tp)) {
int mib_idx;
/* Happy end! We did not retransmit anything
* or our original transmission succeeded.
*/
DBGUNDO(sk, inet_csk(sk)->icsk_ca_state == TCP_CA_Loss ?
"loss" : "retrans");
tcp_undo_cwnd_reduction(sk, false);
if (inet_csk(sk)->icsk_ca_state == TCP_CA_Loss)
mib_idx = LINUX_MIB_TCPLOSSUNDO;
else
mib_idx = LINUX_MIB_TCPFULLUNDO;
NET_INC_STATS_BH(sock_net(sk), mib_idx);
}
if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
/* Hold old state until something *above* high_seq
* is ACKed. For Reno it is MUST to prevent false
* fast retransmits (RFC2582). SACK TCP is safe. */
tcp_moderate_cwnd(tp);
+ tp->retrans_stamp = 0;
return true;
}
tcp_set_ca_state(sk, TCP_CA_Open);
return false;
}
We would still hold state, at least part of it.. WDYT?
Thanks,
Marcelo
^ permalink raw reply
* Re: [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets
From: Eric Dumazet @ 2014-10-27 18:43 UTC (permalink / raw)
To: Tom Herbert; +Cc: davem, netdev
In-Reply-To: <1414432875-23795-2-git-send-email-therbert@google.com>
On Mon, 2014-10-27 at 11:01 -0700, Tom Herbert wrote:
> When receiving a packet on an unconnected UDP socket clear the
> flow table for the corresponding hash. This is needed so flows over
> unconnected UDP sockets will use RPS instead of using what is
> present in the flow table. In particular, this avoids having flows
> over unconnected sockets be perpetually steered by unrelated
> entries in the flow table (idle TCP connections for instance).
>
> Tested:
>
> First filled up the RPS flow tables by creating a bunch of TCP
> connections and letting them turn idle. Next, run netperf UDP_RR
> with 200 flows.
>
> Before fix:
> Client (connected UDP)
> 81.15% CPU uilization
> Server (unneconnedted UDP)
> 83.63% CPU uilization
> 118/167/249 90/95/99% latencies
> 1.59215e+06 tps
>
> After fix:
> Client (connected UDP)
> 81.13% CPU uilization
> Server (unneconnedted UDP)
> 80.68% CPU uilization
> 116/167/248 90/95/99% latencies
> 1.61048e+06 tps
>
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
> net/ipv4/udp.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 9a0d346..e58d841 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -1451,6 +1451,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
> if (inet_sk(sk)->inet_daddr) {
> sock_rps_save_rxhash(sk, skb);
> sk_mark_napi_id(sk, skb);
> + } else {
> + /* For an unconnected socket reset flow hash so that related
> + * flow will use RPS.
> + */
> + sock_rps_reset_flow_hash(skb->hash);
> }
I believe I already said this patch was wrong Tom.
We need something else for UDP packets.
Its not because RFS is wrong for UDP packets that we want to make it
worse for TCP traffic.
We do now want UDP packets to gradually make flow table empty.
^ permalink raw reply
* Re: [PATCH 1/1 net-next] ipx: replace long unsigned int by unsigned long
From: Joe Perches @ 2014-10-27 18:22 UTC (permalink / raw)
To: Fabian Frederick
Cc: linux-kernel, Arnaldo Carvalho de Melo, David S. Miller, netdev
In-Reply-To: <1414433133-29161-1-git-send-email-fabf@skynet.be>
On Mon, 2014-10-27 at 19:05 +0100, Fabian Frederick wrote:
> Use standard unsigned long.
[]
> diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
[]
> @@ -90,7 +90,7 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v)
> seq_printf(seq, "%08lX ", (unsigned long int)ntohl(rt->ir_net));
> if (rt->ir_routed)
> seq_printf(seq, "%08lX %02X%02X%02X%02X%02X%02X\n",
> - (long unsigned int)ntohl(rt->ir_intrfc->if_netnum),
> + (unsigned long)ntohl(rt->ir_intrfc->if_netnum),
Maybe better to use no cast at all
seq_printf(seq, "%08X %02X%02X%02X%02X%02X%02X\n",
ntohl(etc...),
^ permalink raw reply
* [PATCH 1/1 net-next] ipv6: include linux/uaccess.h instead of asm/uaccess.h
From: Fabian Frederick @ 2014-10-27 18:12 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/ipv6/exthdrs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index bfde361..601d896 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -47,7 +47,7 @@
#include <net/xfrm.h>
#endif
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
/*
* Parsing tlv encoded headers.
--
1.9.1
^ permalink raw reply related
* [PATCH 1/1 net-next] ipv6: replace min/casting by min_t
From: Fabian Frederick @ 2014-10-27 18:11 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/ipv6/addrconf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 725c763..50b95b2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2315,8 +2315,8 @@ ok:
else
stored_lft = 0;
if (!update_lft && !create && stored_lft) {
- const u32 minimum_lft = min(
- stored_lft, (u32)MIN_VALID_LIFETIME);
+ const u32 minimum_lft = min_t(u32,
+ stored_lft, MIN_VALID_LIFETIME);
valid_lft = max(valid_lft, minimum_lft);
/* RFC4862 Section 5.5.3e:
--
1.9.1
^ permalink raw reply related
* [PATCH 1/1 net-next] ipx: replace __inline__ by inline
From: Fabian Frederick @ 2014-10-27 18:09 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Arnaldo Carvalho de Melo, David S. Miller,
netdev
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/ipx/af_ipx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 91729b8..61ffe3c 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -306,7 +306,7 @@ void ipxitf_down(struct ipx_interface *intrfc)
spin_unlock_bh(&ipx_interfaces_lock);
}
-static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
+static inline void __ipxitf_put(struct ipx_interface *intrfc)
{
if (atomic_dec_and_test(&intrfc->refcnt))
__ipxitf_down(intrfc);
--
1.9.1
^ permalink raw reply related
* [PATCH 1/1 net-next] ipx: replace long unsigned int by unsigned long
From: Fabian Frederick @ 2014-10-27 18:05 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Arnaldo Carvalho de Melo, David S. Miller,
netdev
Use standard unsigned long.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/ipx/ipx_proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
index e15c16a..c0cb442 100644
--- a/net/ipx/ipx_proc.c
+++ b/net/ipx/ipx_proc.c
@@ -90,7 +90,7 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v)
seq_printf(seq, "%08lX ", (unsigned long int)ntohl(rt->ir_net));
if (rt->ir_routed)
seq_printf(seq, "%08lX %02X%02X%02X%02X%02X%02X\n",
- (long unsigned int)ntohl(rt->ir_intrfc->if_netnum),
+ (unsigned long)ntohl(rt->ir_intrfc->if_netnum),
rt->ir_router_node[0], rt->ir_router_node[1],
rt->ir_router_node[2], rt->ir_router_node[3],
rt->ir_router_node[4], rt->ir_router_node[5]);
--
1.9.1
^ permalink raw reply related
* [PATCH 1/1] ipv4: remove set but unused variable sha
From: Fabian Frederick @ 2014-10-27 18:03 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
unsigned char *sha (source) was already in original git version
but was never used.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/ipv4/ipconfig.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 648fa14..a896da5 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -498,7 +498,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
struct arphdr *rarp;
unsigned char *rarp_ptr;
__be32 sip, tip;
- unsigned char *sha, *tha; /* s for "source", t for "target" */
+ unsigned char *tha; /* t for "target" */
struct ic_device *d;
if (!net_eq(dev_net(dev), &init_net))
@@ -549,7 +549,6 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto drop_unlock; /* should never happen */
/* Extract variable-width fields */
- sha = rarp_ptr;
rarp_ptr += dev->addr_len;
memcpy(&sip, rarp_ptr, 4);
rarp_ptr += 4;
--
1.9.1
^ permalink raw reply related
* [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets
From: Tom Herbert @ 2014-10-27 18:01 UTC (permalink / raw)
To: davem, netdev
In-Reply-To: <1414432875-23795-1-git-send-email-therbert@google.com>
When receiving a packet on an unconnected UDP socket clear the
flow table for the corresponding hash. This is needed so flows over
unconnected UDP sockets will use RPS instead of using what is
present in the flow table. In particular, this avoids having flows
over unconnected sockets be perpetually steered by unrelated
entries in the flow table (idle TCP connections for instance).
Tested:
First filled up the RPS flow tables by creating a bunch of TCP
connections and letting them turn idle. Next, run netperf UDP_RR
with 200 flows.
Before fix:
Client (connected UDP)
81.15% CPU uilization
Server (unneconnedted UDP)
83.63% CPU uilization
118/167/249 90/95/99% latencies
1.59215e+06 tps
After fix:
Client (connected UDP)
81.13% CPU uilization
Server (unneconnedted UDP)
80.68% CPU uilization
116/167/248 90/95/99% latencies
1.61048e+06 tps
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/ipv4/udp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 9a0d346..e58d841 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1451,6 +1451,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
if (inet_sk(sk)->inet_daddr) {
sock_rps_save_rxhash(sk, skb);
sk_mark_napi_id(sk, skb);
+ } else {
+ /* For an unconnected socket reset flow hash so that related
+ * flow will use RPS.
+ */
+ sock_rps_reset_flow_hash(skb->hash);
}
rc = sock_queue_rcv_skb(sk, skb);
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related
* [PATCH net-next 1/2] udp: Record RPS flow in socket operations
From: Tom Herbert @ 2014-10-27 18:01 UTC (permalink / raw)
To: davem, netdev
Add calls to sock_rps_record_flow for udp_sendmsg, udp_sendpage
and udp_recvmsg. This enables RFS for connected UDP sockets.
Tested:
Ran netperf UDP_RR with 200 flows, with and without UDP RSS enabled
Before fix:
No RSS
Client (connected UDP)
36.87% CPU utilization
Server (unconnected UDP)
33.64% CPU utilization
256/440/687 90/95/99% latencies
727273 tps
UDP RSS
Client
79.59% CPU utilization
Server
78.83% CPU utilization
116/159/226 90/95/99% latencies
1.60974e+06 tps
After fix:
No RSS
Client
44.38% CPU utilization
Server
50.46% CPU utilization
192/245/343 90/95/99% latencies
1.01413e+06
UDP RSS
Client
79.98% CPU utilization
Server
80.35% CPU utilization
113/158/230 90/95/99% latencies
1.60622e+06 tps
Signed-off-by: Tom Herbert <therbert@google.com>
---
net/ipv4/udp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cd0db54..9a0d346 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -881,6 +881,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
struct sk_buff *skb;
struct ip_options_data opt_copy;
+ sock_rps_record_flow(sk);
+
if (len > 0xFFFF)
return -EMSGSIZE;
@@ -1113,6 +1115,8 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,
struct udp_sock *up = udp_sk(sk);
int ret;
+ sock_rps_record_flow(sk);
+
if (flags & MSG_SENDPAGE_NOTLAST)
flags |= MSG_MORE;
@@ -1253,6 +1257,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
int is_udplite = IS_UDPLITE(sk);
bool slow;
+ sock_rps_record_flow(sk);
+
if (flags & MSG_ERRQUEUE)
return ip_recv_error(sk, msg, len, addr_len);
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related
* [PATCH 1/1 net-next] net/irda: include linux/uaccess.h instead of asm/uaccess.h
From: Fabian Frederick @ 2014-10-27 18:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Samuel Ortiz, David S. Miller, netdev
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/irda/ircomm/ircomm_tty_ioctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c
index ce94385..2db24bd 100644
--- a/net/irda/ircomm/ircomm_tty_ioctl.c
+++ b/net/irda/ircomm/ircomm_tty_ioctl.c
@@ -31,8 +31,7 @@
#include <linux/termios.h>
#include <linux/tty.h>
#include <linux/serial.h>
-
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
--
1.9.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox