RE: [PATCH net-next] qed: Prevent stack corruption on MFW interaction

2016-11-07 Thread David Laight
From: Yuval Mintz > Sent: 06 November 2016 15:12 > Driver uses a union for copying data to & from management firmware > when interacting with it. > Problem is that the function always copies sizeof(union) while commit > 2edbff8dcb5d ("qed: Learn resources from management firmware") is casting >

RE: Coding Style: Reverse XMAS tree declarations ?

2016-11-07 Thread David Laight
From: Lino Sanfilippo > Sent: 04 November 2016 20:07 ... > In this case it is IMHO rather the declaration + initialization that makes > "bar" hard to find at one glance, not the use of RXT. You could do something > like > > [longish list of reverse xmas tree identifiers...] > struct

RE: [PATCH NET] ethtool: silence warning on bit loss

2016-10-14 Thread David Laight
From: Jesse Brandeburg > Sent: 14 October 2016 00:14 > Sparse was complaining when we went to prototype some code > using ethtool_cmd_speed_set and SPEED_10, which uses > the upper 16 bits of __u32 speed for the first time. ... > Reported-by: Preethi Banala >

RE: [PATCH v2] r8169: set coherent DMA mask as well as streaming DMA mask

2016-10-14 Thread David Laight
From: Of Ard Biesheuvel > Sent: 14 October 2016 14:41 > PCI devices that are 64-bit DMA capable should set the coherent > DMA mask as well as the streaming DMA mask. On some architectures, > these are managed separately, and so the coherent DMA mask will be > left at its default value of 32 if it

RE: [PATCH 3/5] genetlink: statically initialize families

2016-10-25 Thread David Laight
From: Johannes Berg > Sent: 24 October 2016 13:56 > On Mon, 2016-10-24 at 14:40 +0200, Johannes Berg wrote: > > From: Johannes Berg > > > > Instead of providing macros/inline functions to initialize > > the families, make all users initialize them statically and > > get

RE: [PATCH] cw1200: fix bogus maybe-uninitialized warning

2016-10-25 Thread David Laight
From: Of Arnd Bergmann > Sent: 24 October 2016 16:42 > On x86, the cw1200 driver produces a rather silly warning about the > possible use of the 'ret' variable without an initialization > presumably after being confused by the architecture specific definition > of WARN_ON: > >

RE: [PATCH] netfilter: ip_vs_sync: fix bogus maybe-uninitialized warning

2016-10-25 Thread David Laight
From: Arnd Bergmann > Sent: 24 October 2016 21:22 > On Monday, October 24, 2016 10:47:54 PM CEST Julian Anastasov wrote: > > > diff --git a/net/netfilter/ipvs/ip_vs_sync.c > > > b/net/netfilter/ipvs/ip_vs_sync.c > > > index 1b07578bedf3..9350530c16c1 100644 > > > ---

RE: [PATCH 4/9] ipv6: sr: add core files for SR HMAC support

2016-10-19 Thread David Laight
From: zhuyj > Sent: 19 October 2016 14:21 > __attribute__((packed)) is potentially unsafe on some systems. The > symptom probably won't show up on an x86, which just makes the problem > more insidious; testing on x86 systems won't reveal the problem. (On > the x86, misaligned accesses are handled

RE: [PATCH] mlx4: give precise rx/tx bytes/packets counters

2016-11-25 Thread David Laight
From: Of Eric Dumazet > Sent: 25 November 2016 15:46 > mlx4 stats are chaotic because a deferred work queue is responsible > to update them every 250 ms. > > Even sampling stats every one second with "sar -n DEV 1" gives > variations like the following : ... > This patch allows rx/tx

RE: [PATCH] net: fix bogus cast in skb_pagelen() and use unsigned variables

2016-11-23 Thread David Laight
From: Alexey Dobriyan > Sent: 19 November 2016 01:08 ... > - for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) > + for (i = skb_shinfo(skb)->nr_frags - 1; (int)i >= 0; i--) > len += skb_frag_size(_shinfo(skb)->frags[i]); Think I'd use: for (i =

RE: [patch added to 3.12-stable] net: sctp, forbid negative length

2016-11-24 Thread David Laight
From: Jiri Slaby > Sent: 24 November 2016 09:18 > This patch has been added to the 3.12 stable tree. If you have any > objections, please let us know. > > === > > [ Upstream commit a4b8e71b05c27bae6bad3bdecddbc6b68a3ad8cf ] > > Most of getsockopt handlers in net/sctp/socket.c check

RE: [PATCH v2 0/7] stmmac: dwmac-meson8b: configurable RGMII TX delay

2016-11-25 Thread David Laight
From: Martin Blumenstingl > Sent: 25 November 2016 13:02 > Currently the dwmac-meson8b stmmac glue driver uses a hardcoded 1/4 > cycle TX clock delay. This seems to work fine for many boards (for > example Odroid-C2 or Amlogic's reference boards) but there are some > others where TX traffic is

RE: [PATCH net-next 5/5] udp: add recvmmsg implementation

2016-11-28 Thread David Laight
From: Hannes Frederic Sowa > Sent: 25 November 2016 17:09 ... > Currently sk_err is set so the next syscall would get an -EFAULT, which > seems very bad and can also be overwritten by incoming icmp packets, so > we never get a notification that we actually had a bad pointer somewhere > in the

RE: [PATCH net-next 06/10] net/mlx4_core: Dynamically allocate structs at mlx4_slave_cap

2016-11-28 Thread David Laight
From: Tariq Toukan > Sent: 27 November 2016 15:51 > From: Eran Ben Elisha > > In order to avoid temporary large structs on the stack, > allocate them dynamically. > > Signed-off-by: Eran Ben Elisha > Signed-off-by: Tal Alon >

RE: [PATCH net-next v3 4/7] vxlan: improve vxlan route lookup checks.

2016-11-17 Thread David Laight
From: Of Jiri Benc > Sent: 15 November 2016 14:40 > On Sun, 13 Nov 2016 20:43:55 -0800, Pravin B Shelar wrote: > > @@ -1929,8 +1951,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, > > struct net_device *dev, > > union vxlan_addr *src; > > struct vxlan_metadata _md; > > struct

RE: Netperf UDP issue with connected sockets

2016-11-17 Thread David Laight
From: Jesper Dangaard Brouer > Sent: 17 November 2016 14:58 > On Thu, 17 Nov 2016 06:17:38 -0800 > Eric Dumazet wrote: > > > On Thu, 2016-11-17 at 14:42 +0100, Jesper Dangaard Brouer wrote: > > > > > I can see that qdisc layer does not activate xmit_more in this case. > >

RE: [PATCH 20/39] netfilter: ipset: Use kmalloc() in comment extension helper

2016-11-15 Thread David Laight
From: Pablo Neira Ayuso > Sent: 13 November 2016 22:25 > Allocate memory with kmalloc() rather than kzalloc(): the string > is immediately initialized so it is unnecessary to zero out > the allocated memory area. > > Ported from a patch proposed by Sergey Popovich . > >

RE: [PATCH net-next 1/1] driver: tun: Use new macro SOCK_IOC_MAGIC instead of literal number 0x89

2016-10-26 Thread David Laight
From: f...@ikuai8.com > Sent: 25 October 2016 13:56 > The current codes use _IOC_TYPE(cmd) == 0x89 to check if the cmd is one > socket ioctl command like SIOCGIFHWADDR. But the literal number 0x89 may > confuse readers. So create one macro SOCK_IOC_MAGIC like SPI_IOC_MAGIC to > enhance the

RE: [PATCH 2/4] isdn/eicon: fix some message formatting errors

2016-10-31 Thread David Laight
From: Nicolas Iooss > Sent: 29 October 2016 13:56 > There are some inconsistent debug message formats in message.c. For > example, > > dprintf("XDI CAPI: RC cancelled Id:0x02, Ch:%02x", e->Id, ch); > > wrongly reports an ID of 2 and prints the entity ID as the channel ID. > There are also

RE: [PATCH net] sctp: assign assoc_id earlier in __sctp_connect

2016-11-04 Thread David Laight
From: Of Marcelo Ricardo Leitner > Sent: 03 November 2016 19:04 > sctp_wait_for_connect() currently already holds the asoc to keep it > alive during the sleep, in case another thread release it. But Andrey > Konovalov and Dmitry Vyukov reported an use-after-free in such > situation. > > Problem

RE: [PATCH net-next] mlx5: Add MLX5_SET64_VCHK to fix BUILD_BUG_ON

2016-10-11 Thread David Laight
From: Tom Herbert > Sent: 11 October 2016 05:22 ... > Fix is to create MLX5_SET64_VCHK that takes an additional argument > that is a constant. There are two callers of MLX5_SET64 that are > trying to get a variable offset, change those to call MLX5_SET64_VCHK > passing pas[0] as the argument to

RE: Kernel 4.6.7-rt13: Intel Ethernet driver igb causes huge latencies in cyclictest

2016-10-13 Thread David Laight
From: Koehrer Mathias > Sent: 13 October 2016 11:57 .. > > The time between my trace points 700 and 701 is about 30us, the time > > between my > > trace points 600 and 601 is even 37us!! > > The code in between is > > tsyncrxctl = rd32(E1000_TSYNCRXCTL); resp. > > lvmmc =

RE: igb driver can cause cache invalidation of non-owned memory?

2016-10-13 Thread David Laight
From: Alexander Duyck > Sent: 12 October 2016 19:30 > On Wed, Oct 12, 2016 at 11:12 AM, Nikita Yushchenko > wrote: > >> It would make more sense to update the DMA API for > >> __dma_page_cpu_to_dev on ARM so that you don't invalidate the cache if > >> the

RE: igb driver can cause cache invalidation of non-owned memory?

2016-10-12 Thread David Laight
From: Alexander Duyck > Sent: 12 October 2016 16:33 ... > > To get some throughput improvement, I propose removal of that > > sync_for_device() before reusing buffer. Will you accept such a patch ;) > > Not one that gets rid of sync_for_device() in the driver. From what I > can tell there are

RE: [PATCH 0/9] net: add support for IPv6 Segment Routing

2016-10-17 Thread David Laight
From: David Lebrun > Sent: 17 October 2016 15:42 > Segment Routing (SR) is a source routing paradigm, architecturally > defined in draft-ietf-spring-segment-routing-09 [1]. The IPv6 flavor of > SR is defined in draft-ietf-6man-segment-routing-header-02 [2]. > > The main idea is that an

RE: [PATCH] net/udp: do not touch skb->peeked unless really needed

2016-12-07 Thread David Laight
From: Paolo Abeni > Sent: 06 December 2016 17:08 ... > @@ -79,6 +82,9 @@ struct udp_sock { > int (*gro_complete)(struct sock *sk, > struct sk_buff *skb, > int nhoff); > + > +

RE: [Intel-wired-lan] [RFC PATCH] i40e: enable PCIe relax ordering for SPARC

2016-12-08 Thread David Laight
From: Alexander Duyck > Sent: 05 December 2016 21:55 ... > > @@ -1010,6 +1018,11 @@ int i40e_setup_tx_descriptors(struct i40e_ring > > *tx_ring) > > */ > > tx_ring->size += sizeof(u32); > > tx_ring->size = ALIGN(tx_ring->size, 4096); > > +#ifdef CONFIG_SPARC > > +

RE: [Intel-wired-lan] [RFC PATCH] i40e: enable PCIe relax ordering for SPARC

2016-12-08 Thread David Laight
From: Alexander Duyck > Sent: 06 December 2016 17:10 ... > I was thinking about it and I realized we can probably simplify this > even further. In the case of most other architectures the > DMA_ATTR_WEAK_ORDERING has no effect anyway. So from what I can tell > there is probably no reason not to

RE: [PATCH 1/3] siphash: add cryptographically secure hashtable function

2016-12-14 Thread David Laight
From: Jason A. Donenfeld > Sent: 14 December 2016 00:17 > SipHash is a 64-bit keyed hash function that is actually a > cryptographically secure PRF, like HMAC. Except SipHash is super fast, > and is meant to be used as a hashtable keyed lookup function. > > SipHash isn't just some new trendy hash

RE: [PATCH 3/3] secure_seq: use fast siphash instead of slow md5

2016-12-14 Thread David Laight
From: Jason A. Donenfeld > Sent: 14 December 2016 00:17 > This gives a clear speed and security improvement. Rather than manually > filling MD5 buffers, we simply create a layout by a simple anonymous > struct, for which gcc generates rather efficient code. ... > + const struct { > +

RE: [PATCH 3/3] netns: fix net_generic() "id - 1" bloat

2016-12-14 Thread David Laight
From: Alexey Dobriyan > Sent: 14 December 2016 13:20 ... > > If you have foo->bar[id - const] then the compiler has to add the > > offset of 'bar' and subtract for 'const'. > > If the numbers match no add or subtract is needed. > > > > It is much cleaner to do this by explicitly removing the

RE: [PATCH v2 3/4] secure_seq: use siphash24 instead of md5_transform

2016-12-14 Thread David Laight
From: Jason A. Donenfeld > Sent: 14 December 2016 13:44 > To: Hannes Frederic Sowa > > __packed not only removes all padding of the struct but also changes the > > alignment assumptions for the whole struct itself. The rule, the struct > > is aligned by its maximum alignment of a member is no

RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 15 December 2016 12:50 > On 15.12.2016 13:28, David Laight wrote: > > From: Hannes Frederic Sowa > >> Sent: 15 December 2016 12:23 > > ... > >> Hmm? Even the Intel ABI expects alignment of unsigned long long to be 8 &

RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 15 December 2016 14:57 > On 15.12.2016 14:56, David Laight wrote: > > From: Hannes Frederic Sowa > >> Sent: 15 December 2016 12:50 > >> On 15.12.2016 13:28, David Laight wrote: > >>> From: Hannes Frederi

RE: [PATCH 3/3] netns: fix net_generic() "id - 1" bloat

2016-12-13 Thread David Laight
From: Alexey Dobriyan > Sent: 13 December 2016 14:23 ... > Well, the point of the patch is to save .text, so might as well save > as much as possible. Any form other than "ptr[id]" is going > to be either bigger or bigger and slower and "ptr" should be the first field. You've not read and

RE: [PATCH 3/3] netns: fix net_generic() "id - 1" bloat

2016-12-07 Thread David Laight
From: Alexey Dobriyan > Sent: 05 December 2016 14:48 > On Mon, Dec 5, 2016 at 3:49 PM, David Laight <david.lai...@aculab.com> wrote: > > From: Alexey Dobriyan > >> Sent: 02 December 2016 01:22 > >> net_generic() function is both a) inline and b) used ~600 times.

RE: [PATCH v3 3/3] random: use siphash24 instead of md5 for get_random_int/long

2016-12-15 Thread David Laight
From: Behalf Of Jason A. Donenfeld > Sent: 14 December 2016 18:46 ... > + ret = *chaining = siphash24((u8 *), offsetof(typeof(combined), > end), If you make the first argument 'const void *' you won't need the cast on every call. I'd also suggest making the key u64[2]. David

RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 14 December 2016 22:03 > On 14.12.2016 13:46, Jason A. Donenfeld wrote: > > Hi David, > > > > On Wed, Dec 14, 2016 at 10:56 AM, David Laight <david.lai...@aculab.com> > > wrote: > >> ... > >>> +u64

RE: [PATCH v3 1/3] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Linus Torvalds > Sent: 15 December 2016 00:11 > On Wed, Dec 14, 2016 at 3:34 PM, Jason A. Donenfeld wrote: > > > > Or does your reasonable dislike of "word" still allow for the use of > > dword and qword, so that the current function names of: > > dword really is confusing

RE: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread David Laight
From: Hannes Frederic Sowa > Sent: 15 December 2016 12:23 ... > Hmm? Even the Intel ABI expects alignment of unsigned long long to be 8 > bytes on 32 bit. Do you question that? Yes. The linux ABI for x86 (32 bit) only requires 32bit alignment for u64 (etc). David

RE: Designing a safe RX-zero-copy Memory Model for Networking

2016-12-14 Thread David Laight
From: Christoph Lameter > Sent: 14 December 2016 17:00 > On Tue, 13 Dec 2016, Hannes Frederic Sowa wrote: > > > > Interesting. So you even imagine sockets registering memory regions > > > with the NIC. If we had a proper NIC HW filter API across the drivers, > > > to register the steering rule

RE: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-16 Thread David Laight
From: George Spelvin > Sent: 15 December 2016 23:29 > > If a halved version of SipHash can bring significant performance boost > > (with 32b words instead of 64b words) with an acceptable security level > > (64-bit enough?) then we may design such a version. > > I was thinking if the key could be

RE: Misalignment, MIPS, and ip_hdr(skb)->version

2016-12-12 Thread David Laight
From: Måns Rullgård > Sent: 10 December 2016 13:25 ... > I solved this problem in an Ethernet driver by copying the initial part > of the packet to an aligned skb and appending the remainder using > skb_add_rx_frag(). The kernel network stack only cares about the > headers, so the alignment of

RE: [PATCH 3/3] powerpc: bpf: implement in-register swap for 64-bit endian operations

2017-01-13 Thread David Laight
From: Naveen N. Rao > Sent: 13 January 2017 17:10 > Generate instructions to perform the endian conversion using registers, > rather than generating two memory accesses. > > The "way easier and faster" comment was obviously for the author, not > the processor. That rather depends on whether the

RE: [PATCH v2 8/8] crypto/testmgr: Allocate only the required output size for hash tests

2017-01-11 Thread David Laight
From: Andy Lutomirski > Sent: 10 January 2017 23:25 > There are some hashes (e.g. sha224) that have some internal trickery > to make sure that only the correct number of output bytes are > generated. If something goes wrong, they could potentially overrun > the output buffer. > > Make the test

RE: [PATCH net-next v2 05/10] drivers: base: Add device_find_class()

2017-01-13 Thread David Laight
From: Florian Fainelli > Sent: 12 January 2017 22:51 > On 01/12/2017 01:21 PM, David Miller wrote: > > From: Florian Fainelli > > Date: Wed, 11 Jan 2017 19:41:16 -0800 > > > >> Add a helper function to lookup a device reference given a class name. > >> This is a preliminary

RE: Aw: Re: [PATCH] mlx4: give precise rx/tx bytes/packets counters

2016-11-30 Thread David Laight
From: Eric Dumazet > Sent: 29 November 2016 00:19 > On Mon, 2016-11-28 at 23:02 +0100, Lino Sanfilippo wrote: > > Hi Eric, > > > > On 25.11.2016 20:19, Eric Dumazet wrote: > > > On Fri, 2016-11-25 at 17:30 +0100, Lino Sanfilippo wrote: > > >> Hi, > > >> > > >> > > >> > > > >> > The READ_ONCE() are

RE: [PATCH] net:phy fix driver reference count error when attach and detach phy device

2016-12-02 Thread David Laight
From: Mao Wenan > Sent: 30 November 2016 10:23 > The nic in my board use the phy dev from marvell, and the system will > load the marvell phy driver automatically, but when I remove the phy > drivers, the system immediately panic: > Call trace: > [ 2582.834493] [] phy_state_machine+0x3c/0x438 [ >

RE: [PATCH net-next v3 3/4] Documentation: net: phy: Add blurb about RGMII

2016-11-29 Thread David Laight
From: Florian Fainelli > Sent: 28 November 2016 02:45 > RGMII is a recurring source of pain for people with Gigabit Ethernet > hardware since it may require PHY driver and MAC driver level > configuration hints. Document what are the expectations from PHYLIB and > what options exist. ... > + *

RE: [PATCH net-next v2 3/4] Documentation: net: phy: Add blurb about RGMII

2016-11-30 Thread David Laight
From: Florian Fainelli > Sent: 27 November 2016 23:03 > Le 27/11/2016 14:24, Timur Tabi a crit : > >> + * PHY device drivers in PHYLIB being reusable by nature, being able to > >> + configure correctly a specified delay enables more designs with > >> similar delay > >> + requirements to be

RE: [PATCH net-next v6 6/6] samples/bpf: add userspace example for prohibiting sockets

2016-12-05 Thread David Laight
From: David Ahern > Sent: 01 December 2016 15:14 > On 11/30/16 10:59 PM, Alexei Starovoitov wrote: > > On Wed, Nov 30, 2016 at 10:16:50AM -0800, David Ahern wrote: > >> Add examples preventing a process in a cgroup from opening a socket > >> based family, protocol and type. > >> > >>

RE: [PATCH 3/3] netns: fix net_generic() "id - 1" bloat

2016-12-05 Thread David Laight
From: Alexey Dobriyan > Sent: 02 December 2016 01:22 > net_generic() function is both a) inline and b) used ~600 times. > > It has the following code inside > > ... > ptr = ng->ptr[id - 1]; > ... > > "id" is never compile time constant so compiler is forced to

RE: [iproute PATCH v2 08/18] ss: Turn generic_proc_open() wrappers into macros

2016-12-05 Thread David Laight
From: Phil Sutter > Sent: 02 December 2016 10:40 > Signed-off-by: Phil Sutter > --- > misc/ss.c | 89 > ++- > 1 file changed, 19 insertions(+), 70 deletions(-) > > diff --git a/misc/ss.c b/misc/ss.c > index

RE: [PATCH v2 net-next 3/4] secure_seq: use SipHash in place of MD5

2017-01-09 Thread David Laight
From: Eric Biggers > Sent: 07 January 2017 22:09 .. > Out of curiosity, is this actually a solvable problem, e.g. by making the code > using the XMM registers responsible for saving and restoring the ones > clobbered, > or by optimizing kernel_fpu_begin()/kernel_fpu_end()? Or does it in fact >

RE: [RFC PATCH] intel: Use upper_32_bits and lower_32_bits

2017-01-09 Thread David Laight
From: Joe Perches > Sent: 07 January 2017 18:33 > Shifting and masking various types can be made a bit > simpler to read by using the available kernel macros. ... > - ew32(TDBAH, (tdba >> 32)); > - ew32(TDBAL, (tdba & 0xULL)); > + ew32(TDBAH,

RE: [PATCH v2 09/11] net: mvpp2: simplify MVPP2_PRS_RI_* definitions

2017-01-04 Thread David Laight
From: Thomas Petazzoni > Sent: 27 December 2016 16:54 > Some of the MVPP2_PRS_RI_* definitions use the ~(value) syntax, which > doesn't compile nicely on 64-bit. Moreover, those definitions are in > fact unneeded, since they are always used in combination with a bit > mask that ensures only the

RE: [PATCHv3 net-next] sctp: prepare asoc stream for stream reconf

2017-01-06 Thread David Laight
From: Xin Long > Sent: 06 January 2017 14:19 > sctp stream reconf, described in RFC 6525, needs a structure to > save per stream information in assoc, like stream state. > > In the future, sctp stream scheduler also needs it to save some > stream scheduler params and queues. > > This patchset is

RE: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-19 Thread David Laight
From: George Spelvin > Sent: 17 December 2016 15:21 ... > uint32_t > hsiphash24(char const *in, size_t len, uint32_t const key[2]) > { > uint32_t c = key[0]; > uint32_t d = key[1]; > uint32_t a = 0x6c796765 ^ 0x736f6d65; > uint32_t b = d ^ 0x74656462 ^ 0x646f7261; I've

RE: [PATCH v5 3/4] secure_seq: use SipHash in place of MD5

2016-12-16 Thread David Laight
From: Jason A. Donenfeld > Sent: 15 December 2016 20:30 > This gives a clear speed and security improvement. Siphash is both > faster and is more solid crypto than the aging MD5. > > Rather than manually filling MD5 buffers, for IPv6, we simply create > a layout by a simple anonymous struct, for

RE: [PATCH v5 2/4] siphash: add Nu{32,64} helpers

2016-12-16 Thread David Laight
From: Jason A. Donenfeld > Sent: 15 December 2016 20:30 > These restore parity with the jhash interface by providing high > performance helpers for common input sizes. ... > +#define PREAMBLE(len) \ > + u64 v0 = 0x736f6d6570736575ULL; \ > + u64 v1 = 0x646f72616e646f6dULL; \ > + u64 v2

RE: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-03-22 Thread David Laight
From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] > Sent: 21 March 2017 22:04 > Hi, ... > > > 2. send 1 more chunk with MSG_MORE clear, the queue is: > > > chk4[clear] -> chk3 [clear] -> chk2 [clear] -> chk1 [clear] > > > > I don't think processing the entire queue is a good idea.

RE: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-03-24 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 23 March 2017 16:42 ... > > > David, are we on the same page now? ;-) Probably... > > > Xin, what do you think? > > If we insist that MSG_MORE means not to send ANY data, I compromise. > > does ANY include retransmission DATA? should MSG_MORE block > >

RE: [PATCH] xfrm: branchless addr4_match() on 64-bit

2017-03-24 Thread David Laight
From: Alexey Dobriyan > Sent: 23 March 2017 23:33 > Current addr4_match() code has special test for /0 prefixes because of > standard required undefined behaviour. However, it is possible to omit > it on 64-bit because shifting can be done in a 64-bit register and then > truncated to the expected

RE: [PATCH 06/16] drivers, net, mlx5: convert mlx5_cq.refcount from atomic_t to refcount_t

2017-03-28 Thread David Laight
From: Elena Reshetova > Sent: 28 March 2017 09:57 > > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. I can't help

RE: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-03-28 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 21 March 2017 22:04 ... > > > 3. then if user send more small chunks with MSG_MORE set, > > > the queue is like: > > > chkB[set] -> chkA[set] -> chk4[clear] -> chk3 [clear] -> chk2 [clear] > > > -> chk1 [clear] > > > so that the new small chunks' flag will

RE: [PATCHv2 net] sctp: change to save MSG_MORE flag into assoc

2017-03-28 Thread David Laight
> -Original Message- > From: Xin Long [mailto:lucien@gmail.com] > Sent: 26 March 2017 17:21 > To: network dev; linux-s...@vger.kernel.org > Cc: da...@davemloft.net; Marcelo Ricardo Leitner; Neil Horman; David Laight > Subject: [PATCHv2 net] sctp: change to save MSG_MO

RE: [PATCH 5/5] PCI: remove pci_enable_msix

2017-03-28 Thread David Laight
From: David Daney > Sent: 27 March 2017 18:31 > On 03/27/2017 10:11 AM, Christoph Hellwig wrote: > > On Mon, Mar 27, 2017 at 09:59:35AM -0700, David Daney wrote: > >> On 03/27/2017 01:29 AM, Christoph Hellwig wrote: > >>> Unused now that all callers switched to pci_alloc_irq_vectors. > >>> > >> >

RE: [PATCH] net: netfilter: Remove multiple assignment.

2017-03-27 Thread David Laight
From: Pablo Neira Ayuso > Sent: 27 March 2017 13:08 > On Sat, Mar 25, 2017 at 06:19:47PM +0530, Arushi Singhal wrote: > > This patch removes multiple assignments. > > Done using coccinelle. > > @@ > > identifier i1,i2; > > constant c; > > @@ > > - i1=i2=c; > > + i1=c; > > + i2=c; > > You have to

RE: [PATCH 5/5] PCI: remove pci_enable_msix

2017-03-27 Thread David Laight
From: 'Christoph Hellwig' > Sent: 27 March 2017 15:52 > On Mon, Mar 27, 2017 at 02:06:45PM +, David Laight wrote: > > Apart from all the 'out of tree' drivers that will need > > fixing and a conditional compile added. > > That has never been a reason for stopping li

RE: [PATCH] netfilter: ipset: Use max macro instead of ternary operator

2017-03-28 Thread David Laight
From: simran singhal > Sent: 28 March 2017 14:33 > This patch replaces ternary operator with macro max as it shorter and > thus increases code readability. Macro max return the maximum of the two > compared values. ... > /* Convert error codes to nomatch */ > - return (ret < 0 ? 0 :

RE: [PATCH] igb: add module param to set max-rss-queues.

2017-03-27 Thread David Laight
From: gree...@candelatech.com > Sent: 24 March 2017 20:59 > From: Ben Greear > > In systems where you may have a very large number of network > adapters, certain drivers may consume an unfair amount of > IRQ resources. So, allow a module param that will limit the >

RE: [PATCH 22/22] usb: document that URB transfer_buffer should be aligned

2017-03-30 Thread David Laight
From: Mauro Carvalho Chehab > Sent: 30 March 2017 11:28 ... > While debugging this issue, I saw *a lot* of network-generated URB > traffic from RPi3 Ethernet port drivers that were using non-aligned > buffers and were subject to the temporary buffer conversion. Buffers from the network stack will

RE: SCTP MSG_MORE code

2017-03-23 Thread David Laight
From: Xin Long > Sent: 21 March 2017 06:01 > On Tue, Mar 21, 2017 at 1:49 AM, David Laight <david.lai...@aculab.com> wrote: > > Something needs to be done with SCTP MSG_MORE before the end of the rc > > cycle. > > The current code is definitely broken. > agreed.

RE: [PATCH 5/5] PCI: remove pci_enable_msix

2017-03-27 Thread David Laight
From: Christoph Hellwig > Sent: 27 March 2017 09:30 > > Unused now that all callers switched to pci_alloc_irq_vectors. Apart from all the 'out of tree' drivers that will need fixing and a conditional compile added. At least give us a couple of kernel versions to get it sorted. David

RE: [PATCH net-next] udp: use sk_protocol instead of pcflag to detect udplite sockets

2017-03-31 Thread David Laight
From: Eric Dumazet > Sent: 31 March 2017 14:25 > On Fri, 2017-03-31 at 11:47 +0200, Paolo Abeni wrote: > > In the udp_sock struct, the 'forward_deficit' and 'pcflag' fields > > share the same cacheline. While the first is dirtied by > > udp_recvmsg, the latter is read, possibly several times, by

RE: [PATCH net-next] r8152: simply the arguments

2017-03-16 Thread David Laight
From: Hayes Wang > Sent: 16 March 2017 06:28 > Replace >napi with napi and tp->netdev with netdev. > > Signed-off-by: Hayes Wang > --- > drivers/net/usb/r8152.c | 44 +++- > 1 file changed, 27 insertions(+), 17 deletions(-) > >

RE: [PATCH v2 net-next 4/5] sunvnet: count multicast packets

2017-03-15 Thread David Laight
From: Shannon Nelson > Sent: 14 March 2017 17:25 ... > + if (unlikely(is_multicast_ether_addr(eth_hdr(skb)->h_dest))) > + dev->stats.multicast++; I'd guess that: dev->stats.multicast += is_multicast_ether_addr(eth_hdr(skb)->h_dest); generates faster code. Especially if

RE: [PATCH v2 net-next 4/5] sunvnet: count multicast packets

2017-03-16 Thread David Laight
From: Shannon Nelson > Sent: 16 March 2017 00:18 > To: David Laight; netdev@vger.kernel.org; da...@davemloft.net > On 3/15/2017 1:50 AM, David Laight wrote: > > From: Shannon Nelson > >> Sent: 14 March 2017 17:25 > > ... > >> + if (unlikely(is_mu

RE: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t

2017-03-20 Thread David Laight
From: Herbert Xu > Sent: 20 March 2017 13:16 > On Mon, Mar 20, 2017 at 11:39:37AM +0100, Peter Zijlstra wrote: > > > > Can we at least give a benchmark and have someone run numbers? We should > > be able to quantify these things. > > Do you realise how many times this thing gets hit at 10Gb/s or

RE: [PATCH 07/17] net: convert sock.sk_refcnt from atomic_t to refcount_t

2017-03-20 Thread David Laight
From: Peter Zijlstra > Sent: 20 March 2017 14:28 > On Mon, Mar 20, 2017 at 02:10:24PM +, David Laight wrote: > > On x86 the cpu flags from the 'lock inc/dec' could be used to reasonably > > cheaply detect errors - provided you actually generate a forwards branch. >

SCTP MSG_MORE code

2017-03-20 Thread David Laight
Something needs to be done with SCTP MSG_MORE before the end of the rc cycle. The current code is definitely broken. I objected to the last 'fix' patch because it clears the flag is a place where I don't think it is necessary to do so - so could generate extra ethernet frames. David

RE: [PATCH net-next] r8152: simply the arguments

2017-03-17 Thread David Laight
From: Hayes Wang > Sent: 17 March 2017 03:00 > To: David Laight; netdev@vger.kernel.org > Cc: nic_swsd; linux-ker...@vger.kernel.org; linux-...@vger.kernel.org > Subject: RE: [PATCH net-next] r8152: simply the arguments > > David Laight [mailto:david.lai...@aculab.com] > &g

RE: [PATCH 05/10] netfilter: nf_tables: fix mismatch in big-endian system

2017-03-16 Thread David Laight
From: Pablo Neira Ayuso > Sent: 15 March 2017 17:01 > From: Liping Zhang > > Currently, there are two different methods to store an u16 integer to > the u32 data register. For example: > u32 *dest = >data[priv->dreg]; > 1. *dest = 0; *(u16 *) dest = val_u16; > 2. *dest

RE: [PATCH 07/10] netfilter: Force fake conntrack entry to be at least 8 bytes aligned

2017-03-16 Thread David Laight
From: Pablo Neira Ayuso > Sent: 15 March 2017 17:01 > From: "Steven Rostedt (VMware)" > > Since the nfct and nfctinfo have been combined, the nf_conn structure > must be at least 8 bytes aligned, as the 3 LSB bits are used for the > nfctinfo. But there's a fake nf_conn

RE: [PATCH net-next 5/7] s390/qeth: improve endianness handling

2017-04-10 Thread David Laight
From: Ursula Braun > Sent: 07 April 2017 13:33 > On 04/07/2017 01:25 PM, David Laight wrote: > > From: Ursula Braun > >> Sent: 05 April 2017 09:40 > >> From: Hans Wippel <hwip...@linux.vnet.ibm.com> > >> > >> Avoid endianness warnings repor

RE: [PATCH net-next 5/7] s390/qeth: improve endianness handling

2017-04-07 Thread David Laight
From: Ursula Braun > Sent: 05 April 2017 09:40 > From: Hans Wippel > > Avoid endianness warnings reported by sparse by (1) using endianness > conversions for assigning and using network packet fields, and (2) > removing unnecessary endianness conversions from

RE: [PATCH net-next 1/1] skbuff: Extend gso_type to unsigned int.

2017-04-07 Thread David Laight
From: Steffen Klassert > Sent: 03 April 2017 09:16 > All available gso_type flags are currently in use, so > extend gso_type from 'unsigned short' to 'unsigned int' > to be able to add further flags. > > We also reorder the struct skb_shared_info to use > two bytes of the four byte hole before

RE: [PATCH] soreuseport: use "unsigned int" in __reuseport_alloc()

2017-04-05 Thread David Laight
From: Alexey Dobriyan > Sent: 04 April 2017 12:36 > On Mon, Apr 3, 2017 at 4:56 PM, Craig Gallek wrote: > > On Sun, Apr 2, 2017 at 6:18 PM, Alexey Dobriyan wrote: > >> Number of sockets is limited by 16-bit, so 64-bit allocation will never > >> happen.

RE: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-10 Thread David Laight
From: Matthias Kaehlcke > Sent: 06 April 2017 19:57 > Clang raises a warning about the expression 'strlen(CONFIG_XXX)' being > used in a logical operation. Clangs' builtin strlen function resolves the > expression to a constant at compile time, which causes clang to generate > a

RE: [PATCH net-next V2 5/7] s390/qeth: improve endianness handling

2017-04-10 Thread David Laight
From: Ursula Braun > Sent: 07 April 2017 08:16 > Avoid endianness warnings reported by sparse by (1) using endianness > conversions for assigning and using network packet fields, and (2) > removing unnecessary endianness conversions from qeth_l3_rebuild_skb. No > functional changes. ... > - if

RE: [PATCH 16/22] xen-blkfront: Make use of the new sg_map helper function

2017-04-18 Thread David Laight
From: Logan Gunthorpe > Sent: 13 April 2017 23:05 > Straightforward conversion to the new helper, except due to > the lack of error path, we have to warn if unmapable memory > is ever present in the sgl. > > Signed-off-by: Logan Gunthorpe > --- >

RE: Re: [PATCH net-next 1/4] ixgbe: sparc: rename the ARCH_WANT_RELAX_ORDER to IXGBE_ALLOW_RELAXED_ORDER

2017-04-18 Thread David Laight
From: Gabriele Paoloni > Sent: 13 April 2017 10:11 > > > Till now only the Intel ixgbe could support enable > > > Relaxed ordering in the drivers for special architecture, > > > but the ARCH_WANT_RELAX_ORDER is looks like a general name > > > for all arch, so rename to a specific name for intel >

RE: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-03 Thread David Laight
From: Xin Long > Sent: 03 March 2017 15:43 ... > > It is much more important to get MSG_MORE working 'properly' for SCTP > > than for TCP. For TCP an application can always use a long send. > "long send" ?, you mean bigger data, or keeping sending? > I didn't get the difference between SCTP and

RE: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation

2017-03-03 Thread David Laight
From: Andrey Ryabinin > Sent: 03 March 2017 13:50 ... > noinline_iff_kasan might be a better name. noinline_for_kasan gives the > impression > that we always noinline function for the sake of kasan, while > noinline_iff_kasan > clearly indicates that function is noinline only if kasan is used.

RE: [PATCH net-next 09/12] net: bcmgenet: return EOPNOTSUPP for unknown ioctl commands

2017-03-14 Thread David Laight
From: Doug Berger > Sent: 14 March 2017 00:42 > This commit changes the ioctl handling behavior to return the > EOPNOTSUPP error code instead of the EINVAL error code when an > unknown ioctl command value is detected. > > It also removes some redundant parsing of the ioctl command value > and

RE: [PATCHv3 net-next 21/22] net: mvpp2: set dma mask and coherent dma mask on PPv2.2

2017-03-08 Thread David Laight
From: Thomas Petazzoni > Sent: 07 March 2017 18:12 > Hello, > > On Tue, 7 Mar 2017 17:24:21 +, David Laight wrote: > > > Are the coherent mappings just used for ring structures? > > If it might be reasonable to allocate them as a single entity, > >

RE: [PATCHv3 net-next 21/22] net: mvpp2: set dma mask and coherent dma mask on PPv2.2

2017-03-07 Thread David Laight
From: Thomas Petazzoni > Sent: 07 March 2017 15:53 > On PPv2.2, the streaming mappings can be anywhere in the first 40 bits > of the physical address space. However, for the coherent mappings, we > still need them to be in the first 32 bits of the address space, > because all BM pools share a

RE: [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines

2017-03-03 Thread David Laight
From: Jeff Kirsher > Sent: 03 March 2017 02:25 > From: Alexander Duyck > > On architectures that have a cache line size larger than 64 Bytes we start > running into issues where the amount of headroom for the frame starts > shrinking. > > The size of skb_shared_info

RE: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-03 Thread David Laight
From: Xin Long > Sent: 03 March 2017 06:24 > David Laight noticed the support for MSG_MORE with datamsg->force_day > didn't really work as we expected, as the first msg with MSG_MORE set > would always block the following chunks' dequeuing. > > This Patch is to rewrite it b

RE: [PATCH net-next 4/4] net: dsa: lan9303: MDIO access phy registers directly

2017-07-31 Thread David Laight
From: Florian Fainelli > Sent: 28 July 2017 18:05 ... > +EXPORT_SYMBOL(lan9303_indirect_phy_ops); > >>> > >>> Isn't EXPORT_SYMBOL_GPL prefered over EXPORT_SYMBOL? > >> > >> I have no opinion. I just used the same variant as the other EXPORTS > >> in the file. > > > > If there is no concern

<    1   2   3   4   5   6   7   >