RE: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-20 Thread David Laight
From: Of Rob Landley Sent: 19 April 2015 08:25 On Thu, Apr 16, 2015 at 6:03 PM, Tejun Heo t...@kernel.org wrote: In a lot of configurations, netconsole is a useful way to collect system logs; however, all netconsole does is simply emitting UDP packets for the raw messages and there's no

RE: [PATCH v3] Renesas Ethernet AVB driver

2015-04-24 Thread David Laight
From: Sergei Shtylyov Sent: 22 April 2015 22:39 On 04/22/2015 11:42 PM, David Miller wrote: Hmm, I've been digging in the net core, and was unable to see where TX skb's get their NET_IP_ALIGN bytes reserved. Have I missed something? Probably need to print out skb's fields...

RE: [Y2038] [PATCH 04/11] posix timers:Introduce the 64bit methods with timespec64 type for k_clock structure

2015-04-22 Thread David Laight
From: Thomas Gleixner Sent: 22 April 2015 09:45 On Tue, 21 Apr 2015, Thomas Gleixner wrote: On Tue, 21 Apr 2015, Arnd Bergmann wrote: I know there are concerns about this, in particular because C11 and POSIX both require tv_nsec to be 'long', unlike timeval-tv_usec, which is a

RE: [PATCH iproute2 1/3] tc: fix compilation warning on 32bits arch

2015-04-21 Thread David Laight
From: Nicolas Dichtel Sent: 21 April 2015 17:07 The warning was: m_simple.c: In function parse_simple: m_simple.c:142:4: warning: format %ld expects argument of type long int, but argument 3 has type size_t [-Wformat] Useful to be able to compile with -Werror. Signed-off-by: Nicolas

RE: [PATCH v3] Renesas Ethernet AVB driver

2015-04-27 Thread David Laight
From: Sergei Shtylyov Sent: 24 April 2015 19:27 ... If you have ethernet hardware that requires tx or rx buffers to be on 4n boundaries you should send it back as 'not fit for purpose'. The RX buffers can be adjusted with skb_resrerve(), it's only the TX buffers that need to be

RE: [PATCH 1/4] ozwpan: Use proper check to prevent heap overflow

2015-05-15 Thread David Laight
From: Jason A. Donenfeld Sent: 13 May 2015 19:34 Since elt-length is a u8, we can make this variable a u8. Then we can do proper bounds checking more easily. Without this, a potentially negative value is passed to the memcpy inside oz_hcd_get_desc_cnf, resulting in a remotely exploitable heap

RE: [PATCH 1/7] net: refactor __netif_receive_skb_core

2015-04-15 Thread David Laight
From: Alexander Duyck Sent: 10 April 2015 20:56 On 04/10/2015 05:15 AM, Pablo Neira Ayuso wrote: +another_round: + ret = __netif_receive_skb_ingress(skb, pfmemalloc, orig_dev); + switch (ret) { + case NET_RX_SUCCESS: + case NET_RX_DROP: + break; + case

RE: [Xen-devel] tcp: refine TSO autosizing causes performance regression on Xen

2015-04-16 Thread David Laight
From: George Dunlap Sent: 16 April 2015 09:56 On 04/15/2015 07:19 PM, Eric Dumazet wrote: On Wed, 2015-04-15 at 19:04 +0100, George Dunlap wrote: Maybe you should stop wasting all of our time and just tell us what you're thinking. I think you make me wasting my time. I already

RE: [PATCH 15/17] switch kernel_sendmsg() and kernel_recvmsg() to iov_iter_kvec()

2015-04-15 Thread David Laight
From: Al Viro Sent: 14 April 2015 17:59 On Tue, Apr 14, 2015 at 04:36:36PM +, David Laight wrote: From: Al Viro Sent: 14 April 2015 17:34 On Tue, Apr 14, 2015 at 04:21:02PM +, David Laight wrote: Massive NAK. This breaks any code that is using msg_control to set SCTP

RE: [PATCH 15/17] switch kernel_sendmsg() and kernel_recvmsg() to iov_iter_kvec()

2015-04-15 Thread David Laight
From: Daniel Borkmann Sent: 15 April 2015 10:37 On 04/15/2015 11:08 AM, David Laight wrote: ... Apart from any other code that is using the interface. I know you guys don't do anything to help out of tree code, but removing the setfs() stuff from the kernel_recvmsg() code would break

RE: [PATCH 03/12] netfilter: x_tables: align per cpu xt_counter

2015-06-22 Thread David Laight
From: Pablo Neira Ayuso Sent: 19 June 2015 18:18 From: Eric Dumazet eduma...@google.com Let's force a 16 bytes alignment on xt_counter percpu allocations, so that bytes and packets sit in same cache line. xt_counter being exported to user space, we cannot add __align(16) on the structure

RE: [net 06/10] e1000e: i219 - increase IPG for speed 10/100 full duplex

2015-06-26 Thread David Laight
From: Of Jeff Kirsher Sent: 26 June 2015 11:21 In SPT/i219, there were CRC errors in speed 10/100 full duplex. The solution given by the HW team is to increase the IPG from 8 to 0xC Signed-off-by: Yanir Lubetkin yanirx.lubet...@intel.com Tested-by: Aaron Brown aaron.f.br...@intel.com

RE: [PATCH net-next v2 05/19] bna: use BIT(x) instead of (1 x)

2015-06-12 Thread David Laight
From: Ivan Vecera ... diff --git a/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h b/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h index 679a503..16090fd 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h +++ b/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h

RE: Fw: [Bug 98781] New: WWAN: TX bytes counter shows very huge impossible value

2015-06-16 Thread David Laight
From: Kevin Sent: 13 June 2015 01:29 ... Linux uranis 3.19.0-20-generic #20-Ubuntu SMP Fri May 29 10:10:47 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux wwan0 Link encap:Ethernet HWaddr 26:03:a9:e3:88:2e inet addr:41.150.225.132 Bcast:41.150.225.135 Mask:255.255.255.248

RE: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket

2015-05-27 Thread David Laight
From: Daniel Borkmann Sent: 27 May 2015 10:34 ... Fixes: 299ee123e198 (sctp: Fixup v4mapped behaviour to comply with Sock API) ... This bugfix should be a candidate for -stable Anyone know off-hand which kernel releases are affected? I'm going to have to note this in the release

RE: [PATCH] net: tcp: Fix a PTO timing granularity issue

2015-05-27 Thread David Laight
From: Of Ido Yariv Sent: 26 May 2015 21:17 The Tail Loss Probe RFC specifies that the PTO value should be set to max(2 * SRTT, 10ms), where SRTT is the smoothed round-trip time. The PTO value is converted to jiffies, so the timer may expire prematurely. This is especially problematic on

RE: [PATCH net-next 02/14] sfc: Add sysfs entry for flags (link control and primary)

2015-05-29 Thread David Laight
From: Shradha Shah Sent: 29 May 2015 11:01 On every adapter there will be one primary PF per adaptor and one link control PF per port. ... + return sprintf(buf, %d\n, +((efx-mcdi-fn_flags) + (1 MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL)) +

RE: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket

2015-05-27 Thread David Laight
From: Jason Gunthorpe Sent: 27 May 2015 16:32 On Wed, May 27, 2015 at 10:11:22AM +, David Laight wrote: In any case it looks like I can escape by turning off SCTP_I_WANT_MAPPED_V4_ADDR for kernels 3.17 through 4.0. Just be aware that option is unusable on kernels without 299ee. I

RE: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket

2015-05-27 Thread David Laight
From: Jason Gunthorpe Sent: 27 May 2015 17:32 On Wed, May 27, 2015 at 04:16:44PM +, David Laight wrote: From: Jason Gunthorpe Sent: 27 May 2015 16:32 On Wed, May 27, 2015 at 10:11:22AM +, David Laight wrote: In any case it looks like I can escape by turning off

RE: [PATCH] net: tcp: Fix a PTO timing granularity issue

2015-05-28 Thread David Laight
From: Ido Yariv Sent: 28 May 2015 05:37 ... +/* Convert msecs to jiffies, ensuring that the return value is at least 2 + * jiffies. + * This can be used when setting tick-based timers to guarantee that they won't + * expire right away. + */ +static inline unsigned long

RE: [PATCH] sctp: Fix mangled IPv4 addresses on a IPv6 listening socket

2015-05-28 Thread David Laight
From: Jason Gunthorpe Sent: 27 May 2015 18:05 On Wed, May 27, 2015 at 04:41:18PM +, David Laight wrote: The code will be sleeping in kernel_accept() and later calls kernel_getpeername(). The code is used for both TCP and SCTP and this part is common (using the TCP semantics

RE: [PATCH/RFC net-next] rocker: remove rocker parameter from functions that have rocker_port parameter

2015-05-28 Thread David Laight
From: Simon Horman Sent: 28 May 2015 04:23 The rocker (switch) of a rocker_port may be trivially obtained from the latter it seems cleaner not to pass the former to a function when the latter is being passed anyway. If the arguments are passed in registers (they almost certainly are) or the

RE: [PATCH net-next] net: macb: replace literal constant with NET_IP_ALIGN

2015-07-03 Thread David Laight
From: Eric Dumazet Sent: 01 July 2015 23:14 To: Joe Perches ... Then please use netdev_alloc_skb_ip_align(), so that you get rid of skb_reserve() It seems there are ~50 of these in the kernel tree that could be converted. Make sure the 2 is really NET_IP_ALIGN Some hardwares

RE: [PATCH net-next] net: macb: replace literal constant with NET_IP_ALIGN

2015-07-06 Thread David Laight
From: Eric Dumazet [mailto:eric.duma...@gmail.com] Sent: 03 July 2015 17:39 On Fri, 2015-07-03 at 16:18 +, David Laight wrote: Even on x86 aligning the ethernet receive data on a 4n+2 boundary is likely to give marginally better performance than aligning on a 4n boundary. You

RE: [PATCH net] x86: bpf_jit: fix compilation of large bpf programs

2015-05-26 Thread David Laight
From: Alexei Starovoitov Sent: 22 May 2015 23:43 x86 has variable length encoding. x86 JIT compiler is trying to pick the shortest encoding for given bpf instruction. While doing so the jump targets are changing, so JIT is doing multiple passes over the program. Typical program needs 3

RE: [PATCH net] x86: bpf_jit: fix compilation of large bpf programs

2015-05-26 Thread David Laight
From: Eric Dumazet Sent: 26 May 2015 15:35 On Tue, 2015-05-26 at 13:40 +, David Laight wrote: If the JIT compiler is only changing the encoding of the constants in the x86 instructions (rather than changing the instructions themselves) then there is likely to me an unmeasurable

RE: [PATCH net] x86: bpf_jit: fix compilation of large bpf programs

2015-05-26 Thread David Laight
From: Eric Dumazet Sent: 26 May 2015 16:30 Yes, interesting, a benchmark that manages to run a lot of code 'cold cache'. We have binaries here at Google with 400 or 500 MBytes of text. Not benchmark, super real workloads you know. Indeed, and a lot of the code is likely to be

RE: [PATCH 4/6] dlm: use sctp 1-to-1 API

2015-08-12 Thread David Laight
From: Marcelo Ricardo Leitner Sent: 12 August 2015 14:16 Em 12-08-2015 07:23, David Laight escreveu: From: Marcelo Ricardo Leitner Sent: 11 August 2015 23:22 DLM is using 1-to-many API but in a 1-to-1 fashion. That is, it's not needed but this causes it to use sctp_do_peeloff() to mimic

RE: [PATCH net] inet: fix potential deadlock in reqsk_queue_unlink()

2015-08-18 Thread David Laight
From: Eric Dumazet Sent: 13 August 2015 23:45 When replacing del_timer() with del_timer_sync(), I introduced a deadlock condition : reqsk_queue_unlink() is called from inet_csk_reqsk_queue_drop() inet_csk_reqsk_queue_drop() can be called from many contexts, one being the timer handler

RE: [PATCH net-next 2/3] qeth: Convert use of __constant_htons to htons

2015-08-20 Thread David Laight
From: Ursula Braun Sent: 19 August 2015 09:21 In little endian cases, the macro htons unfolds to __swab16 which provides special case for constants. In big endian cases, __constant_htons and htons expand directly to the same expression. So, replace __constant_htons with htons with the goal of

RE: [PATCH net-next 2/3] qeth: Convert use of __constant_htons to htons

2015-08-20 Thread David Laight
From: Ursula Braun [mailto:ubr...@linux.vnet.ibm.com] Sent: 20 August 2015 12:44 On Thu, 2015-08-20 at 10:46 +, David Laight wrote: From: Ursula Braun Sent: 19 August 2015 09:21 In little endian cases, the macro htons unfolds to __swab16 which provides special case for constants

RE: [PATCH net] inet: fix potential deadlock in reqsk_queue_unlink()

2015-08-18 Thread David Laight
From: Eric Dumazet Sent: 18 August 2015 14:37 On Tue, 2015-08-18 at 11:04 +, David Laight wrote: From: Eric Dumazet Sent: 13 August 2015 23:45 When replacing del_timer() with del_timer_sync(), I introduced a deadlock condition : reqsk_queue_unlink() is called from

RE: Fix skb_set_peeked use-after-free bug

2015-08-04 Thread David Laight
From: Herbert Xu Sent: 04 August 2015 10:21 On Tue, Aug 04, 2015 at 09:15:13AM +, David Laight wrote: You've introduced a memory leak if skb_clone() fails. No I have not. nskb = skb_clone(skb, GFP_ATOMIC); if (!nskb) - return -ENOMEM; + return ERR_PTR

RE: Fix skb_set_peeked use-after-free bug

2015-08-04 Thread David Laight
From: Herbert Xu Sent: 04 August 2015 08:43 Brenden Blanco bbla...@plumgrid.com wrote: [ 318.244596] BUG: unable to handle kernel NULL pointer dereference at 008e [ 318.245182] IP: [81455e7c] __skb_recv_datagram+0xbc/0x5a0 Replying to myself, and adding commit

RE: [PATCH 08/15] drivers: net: Drop unlikely before IS_ERR(_OR_NULL)

2015-07-31 Thread David Laight
From: Murali Karicheri Sent: 31 July 2015 16:04 On 07/31/2015 04:38 AM, Viresh Kumar wrote: IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there is no need to do that again from its callers. Drop it. IS_ERR_OR_NULL() is defined as static inline bool __must_check

RE: [PATCH 2/4] batman-adv: fix kernel crash due to missing NULL checks

2015-08-05 Thread David Laight
From: Of Antonio Quartulli Sent: 05 August 2015 13:52 From: Marek Lindner mareklind...@neomailbox.ch batadv_softif_vlan_get() may return NULL which has to be verified by the caller. ... diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index c002961..a2fc843

RE: [PATCH 2/4] batman-adv: fix kernel crash due to missing NULL checks

2015-08-12 Thread David Laight
From: Antonio Quartulli Sent: 11 August 2015 17:43 On 05/08/15 15:15, David Laight wrote: So is this test just hiding anoter bug somewhere?? Hi David and thanks for your feedback. The point is that we got several bug reports of kernel crashes due to NULL pointer deferences

RE: [PATCH 4/6] dlm: use sctp 1-to-1 API

2015-08-12 Thread David Laight
From: Marcelo Ricardo Leitner Sent: 11 August 2015 23:22 DLM is using 1-to-many API but in a 1-to-1 fashion. That is, it's not needed but this causes it to use sctp_do_peeloff() to mimic an kernel_accept() and this causes a symbol dependency on sctp module. By switching it to 1-to-1 API we

RE: [PATCH iproute2] ip: replace exit with return

2015-08-12 Thread David Laight
From: netdev-ow...@vger.kernel.org Sent: 11 August 2015 10:40 In our manual, we have this description of 'EXIT STATUS': Exit status is 0 if command was successful, and 1 if there is a syntax error. But we exit in command functions with code -1 when there is a syntax error. It's better to

RE: [RFC] bmac:change to use bitrev8() generic function

2015-08-10 Thread David Laight
From: Tobias Klauser Sent: 10 August 2015 12:49 On 2015-08-10 at 11:53:41 +0200, yalin wang yalin.wang2...@gmail.com wrote: This change to use generic bitrev8() for bmac driver. ... @@ -871,7 +860,7 @@ bmac_addhash(struct bmac_data *bp, unsigned char *addr) if (!(*addr)) return;

RE: [PATCH v2] ravb: minimize TX data copying

2015-07-27 Thread David Laight
From: Sergei Shtylyov Sent: 25 July 2015 21:42 Renesas Ethernet AVB controller requires that all data are aligned on 4-byte boundary. While it's easily achievable for the RX data with the help of skb_reserve() (we even align on 128-byte boundary as recommended by the manual), we can't

RE: [PATCH v2 1/2] sctp: add new getsockopt option SCTP_SOCKOPT_PEELOFF_KERNEL

2015-07-22 Thread David Laight
From: Marcelo Ricardo Leitner Sent: 14 July 2015 18:13 SCTP has this operation to peel off associations from a given socket and create a new socket using this association. We currently have two ways to use this operation: - via getsockopt(), on which it will also create and return a file

RE: [RFC net-next 1/1] : sctp: denoise deprecation log on SCTP_EVENTS

2015-07-22 Thread David Laight
From: Jamal Hadi Salim Sent: 09 July 2015 11:38 In the newer kernels this message is extremely noisy. After a quick discussion with Daniel it seems to me it will be very hard to get existing apps that nobody is going to update to continue to work (i.e no forward compat). And newer apps that

RE: [iproute PATCH 05/12] ip{,6}tunnel: align do_tunnels_list() a bit

2015-11-13 Thread David Laight
From: Phil Sutter > Sent: 13 November 2015 17:09 > In iptunnel, declare loop variables inside the loop as done in > ip6tunnel. ... > @@ -396,14 +396,8 @@ static void print_tunnel(struct ip_tunnel_parm *p) > > static int do_tunnels_list(struct ip_tunnel_parm *p) > { > - char name[IFNAMSIZ];

RE: irq_fpu_usable() is false in ndo_start_xmit() for UDP packets

2015-11-17 Thread David Laight
From: David Miller > Sent: 16 November 2015 20:32 > From: "Jason A. Donenfeld" > Date: Mon, 16 Nov 2015 20:52:28 +0100 > > > This works fine with, say, iperf3 in TCP mode. The AVX performance > > is great. However, when using iperf3 in UDP mode, irq_fpu_usable() > > is mostly

RE: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-11-04 Thread David Laight
From: Al Viro > Sent: 30 October 2015 21:10 > On Fri, Oct 30, 2015 at 05:43:21PM +, David Laight wrote: > > > ISTM that the correct call should be listen(fd, 0); > > Although that doesn't help a thread stuck in recvmsg() for a datagram. > > > > It is als

RE: Fw: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-11-02 Thread David Laight
From: casper@oracle.com > Sent: 21 October 2015 21:33 .. > >Er... So fd2 = dup(fd);accept(fd)/close(fd) should *not* trigger that > >behaviour, in your opinion? Because fd is sure as hell not the last > >descriptor refering to that socket - fd2 remains alive and well. > > > >Behaviour you

RE: [PATCH RFC net-next 2/2] tcp: Add Redundant Data Bundling (RDB)

2015-11-02 Thread David Laight
From: Bendik Rønning Opstad > Sent: 23 October 2015 21:50 > RDB is a mechanism that enables a TCP sender to bundle redundant > (already sent) data with TCP packets containing new data. By bundling > (retransmitting) already sent data with each TCP packet containing new > data, the connection will

RE: [PATCH RFC net-next 2/2] tcp: Add Redundant Data Bundling (RDB)

2015-11-02 Thread David Laight
From: Bendik Rønning Opstad > Sent: 29 October 2015 22:54 ... > > > > The semantics of the tp->nonagle bits are already a bit complex. My > > > > sense is that having a setsockopt of TCP_RDB transparently modify the > > > > nagle behavior is going to add more extra complexity and unanticipated > >

RE: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-11-06 Thread David Laight
From: Al Viro > Sent: 04 November 2015 16:28 > On Wed, Nov 04, 2015 at 03:54:09PM +, David Laight wrote: > > > Sigh... The kernel has no idea when other threads are done with "all > > > io activities using that fd" - it can wait for them to leave the >

RE: [GIT] Networking

2015-11-06 Thread David Laight
> From: Linus Torvalds > Sent: 03 November 2015 20:45 > On Tue, Nov 3, 2015 at 12:05 PM, Linus Torvalds > wrote: > > result = add_overflow( > > mul_overflow(sec, SEC_CONVERSION, ), > > mul_overflow(nsec, NSEC_CONVERSION, ), > > ); > > >

RE: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-30 Thread David Laight
From: David Holland > Sent: 29 October 2015 14:59 > On Tue, Oct 27, 2015 at 10:52:46AM +, Alan Burlison wrote: > > >But in general, this is basically a problem with the application: the file > > >descriptor space is shared between threads and having one thread sniping > > >at open files,

RE: [PATCH] net: hix5hd2_gmac: avoid integer overload warning

2015-10-16 Thread David Laight
From: Arnd Bergmann > Sent: 16 October 2015 11:01 > BITS_RX_EN is an 'unsigned long' constant, so the ones complement of that > has bits set that do not fit into a 32-bit variable on 64-bit architectures, > which causes a harmless gcc warning: ... > static void hix5hd2_port_disable(struct

RE: [PATCH net-next v3] bnxt_en: New Broadcom ethernet driver.

2015-10-20 Thread David Laight
From: Stephen Hemminger ... > On Sat, 17 Oct 2015 00:21:44 -0400 > Michael Chan wrote: > > > +static bool bnxt_vf_pciid(int idx) > > +{ > > + if (idx == BCM57304_VF || idx == BCM57404_VF) > > + return true; > > + return false; > > +} > > + > > I prefer just

RE: Fw: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-21 Thread David Laight
From: Alan Burlison > Sent: 20 October 2015 19:31 ... > The problem with poll() is that it returns immediately when passed a FD > that is in the listening state. rather than waiting until there's an > incoming connection to handle. As I said, that means you can't use > poll() to multiplex between

RE: next build: 235 warnings 3 failures (next/next-20151117)

2015-11-18 Thread David Laight
From: Will Deacon > Sent: 18 November 2015 12:28 > On Wed, Nov 18, 2015 at 12:11:25PM +, David Laight wrote: > > From: Will Deacon > > > Sent: 18 November 2015 10:14 > > > On Tue, Nov 17, 2015 at 08:17:17PM +0100, Arnd Bergmann wrote: > > > > On Tue

RE: next build: 235 warnings 3 failures (next/next-20151117)

2015-11-18 Thread David Laight
From: Will Deacon [mailto:will.dea...@arm.com] > Sent: 18 November 2015 15:37 > On Wed, Nov 18, 2015 at 03:21:19PM +, David Laight wrote: > > From: Will Deacon > > > Sent: 18 November 2015 12:28 > > > On Wed, Nov 18, 2015 at 12:11:25PM +, David Laight wr

RE: [PATCH] net/core: use netdev name in warning if no parent

2015-11-17 Thread David Laight
From: Bjørn Mork > Sent: 16 November 2015 18:17 > A recent flaw in the netdev feature setting resulted in warnings > like this one from VLAN interfaces: > > WARNING: CPU: 1 PID: 4975 at net/core/dev.c:2419 > skb_warn_bad_offload+0xbc/0xcb() > : caps=(0x001b5820, 0x001b5829)

RE: [PATCH net-next 3/5] net: Add helper function to compare inetpeer addresses

2015-08-28 Thread David Laight
From: David Ahern Sent: 27 August 2015 22:17 ATCH net-next 3/5] net: Add helper function to compare inetpeer addresses tcp_metrics and inetpeer both have functions to compare inetpeer addresses. Consolidate into 1 version. Signed-off-by: David Ahern d...@cumulusnetworks.com --- ... diff

RE: [GIT] Networking

2015-09-04 Thread David Laight
> I find them useful as syntactic sugar. We have not used them a lot, but there > are cases in our crypto > handling code where we have fixed size array inputs/outputs and there we > opted to use them. They make > it easy to remember what the expected sizes of input and output are without >

RE: [GIT] Networking

2015-09-07 Thread David Laight
From: Rustad, Mark D ... > >> static int smp_ah(struct crypto_blkcipher *tfm, const u8 irk[16], > >> const u8 r[3], u8 res[3]) > > > > Expect that it looks like you are passing arrays by value, > > but instead you are passing by reference. > > > > Explicitly pass by reference and

RE: [PATCH] x86: Wire up 32-bit direct socket calls

2015-09-03 Thread David Laight
From: Peter Anvin > Sent: 02 September 2015 21:16 > On 09/02/2015 02:48 AM, Geert Uytterhoeven wrote: > > > > Should all other architectures follow suit? > > Or should we follow the s390 approach: > > > > It is up to the maintainer(s), largely dependent on how likely you are > going to want to

RE: [PATCH] mwifiex: Make mwifiex_dbg a function, reduce object size

2015-09-01 Thread David Laight
From: Joe Perches > Sent: 31 August 2015 18:47 > > The mwifiex_dbg macro has two tests that could be consolidated > into a function reducing overall object size ~10KB (~4%). > > So convert the macro into a function. This looks like it will slow things down somewhat. Maybe inline the tests and

RE: [PATCH net] sctp: support global vtag assochash and per endpoint s(d)port assochash table

2015-09-01 Thread David Laight
From: Xin Long > Sent: 31 August 2015 18:44 > > for telecom center, the usual case is that a server is connected by thousands > of clients. but if the server with only one enpoint(udp style) use the same > sport and dport to communicate with every clients, and every assoc in server > will be

RE: [PATCH net] sctp: fix race on protocol/netns initialization

2015-09-10 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 10 September 2015 13:54 > Em 09-09-2015 21:16, David Miller escreveu: > > From: Marcelo Ricardo Leitner > > Date: Wed, 9 Sep 2015 17:03:01 -0300 > > > >> So the fix then is to invert the initialization order inside > >>

RE: [PATCH net] sctp: fix race on protocol/netns initialization

2015-09-10 Thread David Laight
From: Marcelo Ricardo > Sent: 10 September 2015 15:36 ... > > Given that the first ->create() blocks while the protocol code loads > > it really wouldn't be right to error a subsequent ->create() because > > the load hasn't completed. > > Can't say I don't agree with you, but at the same time,

RE: [PATCH net-next RFC] net: increase LL_MAX_HEADER for Hyper-V

2015-09-16 Thread David Laight
From: Haiyang Zhang > Sent: 16 September 2015 17:09 > > -Original Message- > > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > > Sent: Wednesday, September 16, 2015 11:50 AM > > To: netdev@vger.kernel.org > > Cc: David S. Miller ; linux-ker...@vger.kernel.org; >

RE: PATCH: netdev: add a cast NLMSG_OK to avoid a GCC warning in users' code

2015-09-11 Thread David Laight
From: D. Hugh Redelmeier > Sent: 09 September 2015 21:24 ... > 2) if you use the type "unsigned int" on a 32-bit machine, you get the >warning for an earlier conjunct: > > #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ > (nlh)->nlmsg_len >=

RE: [PATCH net-next RFC] net: increase LL_MAX_HEADER for Hyper-V

2015-09-17 Thread David Laight
From: KY Srinivasan > Sent: 16 September 2015 23:58 ... > > I think we get that. The question is does the Remote NDIS header and > > packet info actually need to be a part of the header data? I would > > argue that it probably doesn't. > > > > So for example in netvsc_start_xmit it looks like

RE: [PATCH v4 net-next 0/2] ipv4: Hash-based multipath routing

2015-09-29 Thread David Laight
From: Peter Nørlund > Sent: 29 September 2015 12:29 ... > As for using L4 hashing with anycast, CloudFlare apparently does L4 > hashing - they could have disabled it, but they didn't. Besides, > analysis of my own load balancers showed that only one in every > 500,000,000 packets is fragmented.

RE: [PATCH v2] net: sctp: Don't use 64 kilobyte lookup table for four elements

2015-09-28 Thread David Laight
From: Eric Dumazet > Sent: 28 September 2015 15:27 > On Mon, 2015-09-28 at 14:12 +, David Laight wrote: > > From: Neil Horman > > > Sent: 28 September 2015 14:51 > > > On Mon, Sep 28, 2015 at 02:34:04PM +0200, Denys Vlasenko wrote: > > > > Seemin

RE: [PATCH v2] net: sctp: Don't use 64 kilobyte lookup table for four elements

2015-09-28 Thread David Laight
From: Neil Horman > Sent: 28 September 2015 14:51 > On Mon, Sep 28, 2015 at 02:34:04PM +0200, Denys Vlasenko wrote: > > Seemingly innocuous sctp_trans_state_to_prio_map[] array > > is way bigger than it looks, since > > "[SCTP_UNKNOWN] = 2" expands into "[0x] = 2" ! > > > > This patch replaces

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: James Bottomley [mailto:james.bottom...@hansenpartnership.com] > Sent: 28 September 2015 15:27 > On Mon, 2015-09-28 at 08:58 +, David Laight wrote: > > From: Rafael J. Wysocki > > > Sent: 27 September 2015 15:09 > > ... > > > > > Say you have thr

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: James Bottomley > Sent: 28 September 2015 16:12 > > > > The x86 cpus will also do 32bit wide rmw cycles for the 'bit' > > > > operations. > > > > > > That's different: it's an atomic RMW operation. The problem with the > > > alpha was that the operation wasn't atomic (meaning that it

RE: [PATCH v2 00/14] RDS: connection scalability and performance improvements

2015-10-01 Thread David Laight
From: Santosh Shilimkar > Sent: 30 September 2015 18:24 ... > This is being addressed by simply using per bucket rw lock which makes the > locking simple and very efficient. The hash table size is still an issue and > I plan to address it by using re-sizable hash tables as suggested on the list.

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: Rafael J. Wysocki > Sent: 27 September 2015 15:09 ... > > > Say you have three adjacent fields in a structure, x, y, z, each one byte > > > long. > > > Initially, all of them are equal to 0. > > > > > > CPU A writes 1 to x and CPU B writes 2 to y at the same time. > > > > > > What's the

RE: [PATCH net-next 3/9] net: Remove e_nobufs label from ip_route_input_slow

2015-09-24 Thread David Laight
From: Eric W. Biederman > Sent: 23 September 2015 03:15 > David Ahern writes: > > > e_nobufs has 1 user. Move setting err to -ENOBUFS for the 1 user and > > use the goto out label instead of e_nobufs. Stepping stone patch; next > > one moves rth code into a helper

RE: [PATCH 05/15] RDS: increase size of hash-table to 8K

2015-09-21 Thread David Laight
From: Santosh Shilimkar > Sent: 20 September 2015 00:05 > Even with per bucket locking scheme, in a massive parallel > system with active rds sockets which could be in excess of multiple > of 10K, rds_bin_lookup() workload is siginificant because of smaller > hashtable size. > > With some tests,

RE: [patch net-next 10/14] rocker: pass "learning" value as a parameter to rocker_port_set_learning

2015-10-05 Thread David Laight
From: Jiri Pirko > Sent: 04 October 2015 22:26 > Be consistent with the rest of the setting functions, and pass > "learning" as a bool function parameter. ... > diff --git a/drivers/net/ethernet/rocker/rocker_main.c > b/drivers/net/ethernet/rocker/rocker_main.c > index fb7e8c2..d9329a7 100644 >

RE: [PATCH v2 8/8] treewide: Remove newlines inside DEFINE_PER_CPU() macros

2015-12-07 Thread David Laight
From: Michal Marek > Sent: 04 December 2015 15:26 > Otherwise make tags can't parse them: > > ctags: Warning: arch/ia64/kernel/smp.c:60: null expansion of name pattern "\1" ... Seems to me you need to fix ctags. David -- To unsubscribe from this list: send the line "unsubscribe netdev"

RE: 4.4-rc2 xfrm_lookup kasan trace

2015-12-08 Thread David Laight
From: Of David Miller > Sent: 03 December 2015 16:59 > From: Eric Dumazet > Date: Mon, 30 Nov 2015 17:22:11 -0800 > > > @@ -2198,6 +2198,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct > > dst_entry *dst_orig, > > xdst = NULL; > > route = NULL; > > > >

RE: bpf: undefined shift in __bpf_prog_run

2015-12-07 Thread David Laight
From: Dmitry Vyukov > Sent: 04 December 2015 19:49 ... > 3.4.3 > undefined behavior > 1 behavior, upon use of a nonportable or erroneous program construct > or of erroneous data, for which this International Standard imposes no > requirements > 2 NOTE Possible undefined behavior ranges from

RE: [PATCH net] ipv6: sctp: clone options to avoid use after free

2015-12-09 Thread David Laight
> SCTP is lacking proper np->opt cloning at accept() time. > > TCP and DCCP use ipv6_dup_options() helper, do the same in SCTP. > > We might later factorize this code in a common helper to avoid > future mistakes. I'm wondering what the real impact of this and the other recent SCTP bugs/patches

RE: [PATCH net] ipv6: sctp: clone options to avoid use after free

2015-12-09 Thread David Laight
From: Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: 09 December 2015 16:00 > On Wed, 2015-12-09 at 15:49 +, David Laight wrote: > > > SCTP is lacking proper np->opt cloning at accept() time. > > > > > > TCP and DCCP use ipv6_dup_options() helper,

RE: [PATCH (net-next.git) 13/18] stmmac: perf, remove modulo in stmmac_rx()

2015-12-09 Thread David Laight
From: Giuseppe Cavallaro > Sent: 09 December 2015 08:38 > The indexes into the ring buffer are always incremented, and > the entry is accessed via doing a modulo to find the "real" index. > Modulo is an expensive operation. > > This patch replaces the modulo with a simple if clamp. > It helps

RE: rhashtable: ENOMEM errors when hit with a flood of insertions

2015-12-03 Thread David Laight
From: Herbert Xu > Sent: 03 December 2015 12:51 > On Mon, Nov 30, 2015 at 06:18:59PM +0800, Herbert Xu wrote: > > > > OK that's better. I think I see the problem. The test in > > rhashtable_insert_rehash is racy and if two threads both try > > to grow the table one of them may be tricked into

RE: ipsec impact on performance

2015-12-02 Thread David Laight
From: Sowmini Varadhan > Sent: 01 December 2015 18:37 ... > I was using esp-null merely to not have the crypto itself perturb > the numbers (i.e., just focus on the s/w overhead for now), but here > are the numbers for the stock linux kernel stack > Gbps peak cpu util > esp-null

RE: ipsec impact on performance

2015-12-02 Thread David Laight
From: Sowmini Varadhan > Sent: 02 December 2015 12:12 > On (12/02/15 11:56), David Laight wrote: > > > Gbps peak cpu util > > > esp-null 1.8 71% > > > aes-gcm-c-2561.6 79% > > > aes-ccm-a-1280.7 96% > > > &g

RE: [PATCH 1/1] net: sctp: dynamically enable or disable pf state

2015-12-14 Thread David Laight
From: zyjzyj2...@gmail.com > Sent: 11 December 2015 09:06 ... > +pf_enable - INTEGER > + Enable or disable pf state. A value of pf_retrans > path_max_retrans > + also disables pf state. That is, one of both pf_enable and > + pf_retrans > path_max_retrans can disable pf state. Since

RE: use-after-free in sctp_do_sm

2015-12-14 Thread David Laight
From: Vlad Yasevich > Sent: 11 December 2015 18:38 ... > > Found a similar place in abort primitive handling like in this last > > patch update, it's probably the issue you're still triggering. > > > > Also found another place that may lead to this use after free, in case > > we receive a packet

RE: [PATCH net] ipv6: sctp: clone options to avoid use after free

2015-12-10 Thread David Laight
From: Daniel Borkmann > Sent: 09 December 2015 19:19 > On 12/09/2015 06:11 PM, Marcelo Ricardo Leitner wrote: > > Em 09-12-2015 14:31, David Laight escreveu: > >> From: Eric Dumazet [mailto:eric.duma...@gmail.com] > >>> Sent: 09 December 2015 16:00 > >>

RE: [PATCH net] ipv6: sctp: clone options to avoid use after free

2015-12-10 Thread David Laight
From: Eric Dumazet > Sent: 10 December 2015 15:58 > > BTW, are you even using IPv6 SCTP sessions ? Our M3UA/SCTP protocol stack supports them and defaults to using IPv6 listening sockets for IPv4 connections. I very much doubt than any customers have used them yet. So most of the IPv6

RE: Checksum offload queries

2015-12-09 Thread David Laight
From: Edward Cree > Sent: 09 December 2015 17:29 You also need to stop (probably outluck?) from deleting newlines and flowing the text. The message below is completely unreadable. David > On 09/12/15 16:01, Tom Herbert wrote: > > On Wed, Dec 9, 2015 at 4:14 AM, Edward Cree

RE: [PATCH v2 net-next] net: Implement fast csum_partial for x86_64

2016-01-06 Thread David Laight
From: Eric Dumazet > Sent: 05 January 2016 22:19 > To: Tom Herbert > You might add a comment telling the '4' comes from length of 'adcq > 6*8(%rdi),%rax' instruction, and that the 'nop' is to compensate that > 'adcq0*8(%rdi),%rax' is using 3 bytes instead. > > We also could use .byte 0x48,

RE: [PATCH] net: add per device sg_max_frags for skb

2016-01-06 Thread David Laight
From: Hans Westgaard Ry > Sent: 06 January 2016 13:16 > Devices may have limits on the number of fragments in an skb they > support. Current codebase uses a constant as maximum for number of > fragments (MAX_SKB_FRAGS) one skb can hold and use. > > When enabling scatter/gather and running traffic

RE: [PATCH v2 net-next] net: Implement fast csum_partial for x86_64

2016-01-06 Thread David Laight
From: Eric Dumazet > Sent: 06 January 2016 14:25 > On Wed, 2016-01-06 at 10:16 +, David Laight wrote: > > From: Eric Dumazet > > > Sent: 05 January 2016 22:19 > > > To: Tom Herbert > > > You might add a comment telling the '4' comes from length of

RE: [PATCH] arm64: net: bpf: don't BUG() on large shifts

2016-01-07 Thread David Laight
From: Alexei Starovoitov > Sent: 06 January 2016 22:13 > On Wed, Jan 06, 2016 at 09:31:27PM +0100, Rabin Vincent wrote: > > On Tue, Jan 05, 2016 at 09:55:58AM -0800, Alexei Starovoitov wrote: > > > this one is better to be addressed in verifier instead of eBPF JITs. > > > Please reject it in

RE: [PATCH v2 net-next 1/5] net: local checksum offload for encapsulation

2016-01-07 Thread David Laight
From: Edward Cree > Sent: 07 January 2016 17:12 > The arithmetic properties of the ones-complement checksum mean that a > correctly checksummed inner packet, including its checksum, has a ones > complement sum depending only on whatever value was used to initialise > the checksum field before

RE: [PATCH] netfilter: nf_conntrack: use safer way to lock all buckets

2016-01-05 Thread David Laight
From: Sasha Levin > Sent: 05 January 2016 02:26 > When we need to lock all buckets in the connection hashtable we'd attempt to > lock 1024 spinlocks, which is way more preemption levels than supported by > the kernel. Furthermore, this behavior was hidden by checking if lockdep is > enabled, and

RE: [Resend PATCH] RDS: fix race condition when sending a message on unbound socket

2015-11-25 Thread David Laight
From: Santosh Shilimkar > Sent: 24 November 2015 22:13 ... > Sasha's found a NULL pointer dereference in the RDS connection code when > sending a message to an apparently unbound socket. The problem is caused > by the code checking if the socket is bound in rds_sendmsg(), which checks > the

  1   2   3   4   5   6   7   >