RE: A reduced Linux network stack for small systems

2014-05-06 Thread David Laight
From: Andi Kleen There has been a lot of interest recently to run Linux on very small systems, like Quark systems. These may have only 2-4MB memory. They are also limited by flash space. I'm intrigued about the 2-4MB memory. That is more that would typically be available on-chip in a DSP or

RE: [PATCH/RFC] usb: gadget: CONFIG_USB_S3C_HSOTG should depend on HAS_DMA

2014-05-06 Thread David Laight
From: Geert Uytterhoeven If NO_DMA=y: drivers/built-in.o: In function `s3c_hsotg_map_dma': s3c-hsotg.c:(.text+0x375b2c): undefined reference to `usb_gadget_map_request' drivers/built-in.o: In function `s3c_hsotg_unmap_dma': s3c-hsotg.c:(.text+0x376a32): undefined reference to

RE: [PATCH 00/13] Refactor pci_is_brdige() to simplify code

2014-04-25 Thread David Laight
From: Yijing Wang This patchset rename the current pci_is_bridge() to pci_has_subordinate(), and introduce a new pci_is_bridge() which determine pci bridge by check dev-hdr_type. The new one is more accurate. PCIe Spec define the pci device is a bridge by the dev-hdr_type = 0x01 || 0x02. That

RE: [PATCH v3 2/8] DMA: Freescale: unify register access methods

2014-04-10 Thread David Laight
From: hongbo.zh...@freescale.com Methods of accessing DMA contorller registers are inconsistent, some registers ^^ are accessed by DMA_IN/OUT directly, while others are accessed by functions get/set_* which are wrappers of DMA_IN/OUT, and even for the BCR

RE: [PATCH] tcp: fix compiler array bounds warning on selective_acks[]

2014-04-11 Thread David Laight
Bjorn Helgaas With -Werror=array-bounds, gcc v4.8.x warns that in tcp_sack_remove(), a selective_acks[] array subscript is above array bounds. I don't understand how gcc figures this out, or why we don't see similar problems many other places, but this is the only fix I can figure out. ...

RE: [PATCH v2 15/45] rcu: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-27 Thread David Laight
It would also increase the latency of CPU-hotunplug operations. Is that a big deal? I thought that was the whole deal with this patchset - making cpu hotunplugs lighter and faster mostly for powersaving. That said, just removing stop_machine call would be a pretty good deal and I

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-10 Thread David Laight
From: Olivier Sobrie ... The function put_rxbuf_data() is called from the urb completion handler. It puts the data of the urb transfer in the tty buffer with tty_insert_flip_string_flags() and schedules a work queue in order to push the data to the ldisc. Problem is that we are in a urb

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-10 Thread David Laight
From: One Thousand Gnomes On Thu, 10 Jul 2014 14:37:37 + David Laight david.lai...@aculab.com wrote: From: Olivier Sobrie ... The function put_rxbuf_data() is called from the urb completion handler. It puts the data of the urb transfer in the tty buffer

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-11 Thread David Laight
From: Olivier Sobrie Olivier Sobrie Hi Alan and Davids, On Thu, Jul 10, 2014 at 04:50:03PM +0100, One Thousand Gnomes wrote: On Thu, 10 Jul 2014 14:37:37 + David Laight david.lai...@aculab.com wrote: From: Olivier Sobrie ... The function put_rxbuf_data() is called from

RE: [PATCH 1/5] xhci: Use correct SLOT ID when handling a reset device command

2014-06-24 Thread David Laight
From: Of Mathias Nyman Command completion events normally include command completion status, SLOT_ID, and a pointer to the original command. Reset device command completion SLOT_ID may be zero according to xhci specs 4.6.11. VIA controllers set the SLOT_ID to zero, triggering a WARN_ON in

RE: [PATCH] vfio: Fix endianness handling for emulated BARs

2014-06-24 Thread David Laight
From: Alexey Kardashevskiy ... So IMHO we should either create new, generic iowrite helpers that don't do any endian swapping at all or do iowrite32(cpu_to_le32(val)) calls. I'm one of those people for whom iowrite32(le32_to_cpu(val)) makes sense I do not understand why @val is

RE: [PATCH] USB: ehci-pci: USB host controller support for Intel Quark X1000

2014-06-25 Thread David Laight
From: Chen, Alvin On Tue, Jun 24, 2014 at 08:51:43AM -0700, Chen, Alvin wrote: diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 00661d3..1ea8803 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -823,6 +823,48 @@

RE: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread David Laight
From: Guenter Roeck On 06/25/2014 07:49 AM, Uwe Kleine-Knig wrote: Hello Guenter, On Wed, Jun 25, 2014 at 07:27:47AM -0700, Guenter Roeck wrote: Maybe the author's intention was: static inline int cpu_corepower_flags(void) __attribute__((const)); ? This specifies that the

RE: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread David Laight
From: Uwe Kleine-König Hello, On Wed, Jun 25, 2014 at 03:40:28PM +, David Laight wrote: From: Guenter Roeck Actually turns out one can use __attribute_const__, and it is static inline int __attribute_const__ cpu_corepower_flags(void) which turns out to be widely used

RE: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread David Laight
From: Chema Gonzalez ... 4.5. BPF_ST|BPF_MEM Operation: *(size *) (dst_reg + off16) = imm32 This insn encodes 2 immediate values (the offset and the imm32 value) in the insn, and actually forces the sock_filter_int 64-bit struct to have both a 16-bit offset field and a 32-bit immediate

RE: [PATCH net-next 1/2] net: filter: split filter.c into two files

2014-07-23 Thread David Laight
From: Varka Bhadram On 07/23/2014 11:31 AM, Alexei Starovoitov wrote: BPF is used in several kernel components. This split creates logical boundary between generic eBPF core and the rest kernel/bpf/core.c: eBPF interpreter net/core/filter.c: classic-eBPF converter, classic

RE: [PATCH v2] USB: ehci-pci: USB host controller support for Intel Quark X1000

2014-06-27 Thread David Laight
From: Jingoo Han ... /* The maximal threshold value is 0x80, which means 512 bytes */ #define EHCI_THRESHOLD_512BYTES 0x80 #define EHCI_THRESHOLD_508BYTES 0x79 It would be better to define these using expressions. So: #define EHCI_THRESHOLD_512BYTES (512u /

RE: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX

2014-06-30 Thread David Laight
From: Of Richard Leitner Replaces all hardcoded ttyGS strings with the PREFIX macro. Due to the fact the strings are spread over different source files the PREFIX definition is moved to u_serial.h Lots of changes like: - DBG(cdev, acm ttyGS%d completion, err %d\n, -

RE: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX

2014-06-30 Thread David Laight
From: Richard Leitner On Mon, 30 Jun 2014 08:41:18 + David Laight david.lai...@aculab.com wrote: From: Of Richard Leitner Replaces all hardcoded ttyGS strings with the PREFIX macro. Due to the fact the strings are spread over different source files the PREFIX definition

RE: [PATCH RFC net-next 07/14] bpf: expand BPF syscall with program load/unload

2014-06-30 Thread David Laight
From: Alexei Starovoitov On Fri, Jun 27, 2014 at 5:19 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:05 PM, Alexei Starovoitov a...@plumgrid.com wrote: eBPF programs are safe run-to-completion functions with load/unload methods from userspace similar to kernel

RE: [PATCH] vsprintf: Remove SPECIAL from pointer types

2014-07-07 Thread David Laight
From: Joe Perches Because gcc issues a complaint about any pointer format with %#p, remove the use of SPECIAL to prefix 0x to various pointer types. There are no uses in the kernel tree of %#p. I know you guys don't really care about them, but there might be uses in out of tree drivers.

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-07 Thread David Laight
From: Olivier Sobrie When the module sends bursts of data, sometimes a deadlock happens in the hso driver when the tty buffer doesn't get the chance to be flushed quickly enough. To avoid this, first, we remove the endless while loop in put_rx_bufdata() which is the root cause of the

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-07 Thread David Laight
From: Olivier Sobrie Hi David, On Mon, Jul 07, 2014 at 09:13:53AM +, David Laight wrote: From: Olivier Sobrie When the module sends bursts of data, sometimes a deadlock happens in the hso driver when the tty buffer doesn't get the chance to be flushed quickly enough

RE: [PATCH 1/3] PCI/MSI: Add pci_enable_msi_partial()

2014-07-08 Thread David Laight
From: Bjorn Helgaas ... Even if you do that, you ought to write valid interrupt information into the 4th slot (maybe replicating one of the earlier interrupts). Then, if the device does raise the 'unexpected' interrupt you don't get a write to a random kernel location. I might be

RE: [PATCH 1/2] net: cadence: macb: add support for the WOL

2014-07-14 Thread David Laight
From: Varka Bhadram On 07/14/2014 02:32 PM, Jongsung Kim wrote: This patch enables the ethtool utility to control the WOL function of the PHY connected to the GEM/MACB. (if supported) ... +static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) +{ + struct

RE: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-07-02 Thread David Laight
From: Alexei Starovoitov ... +#define _(OP) ({ int ret = OP; if (ret 0) return ret; }) ... + _(get_map_info(env, map_id, map)); Nit: such macros should be removed, please. It may surely look unconventional, but alternative is to replace every usage of _ macro with: err = if

RE: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread David Laight
From: Stefan Klug ... Is there any way to check if the host controller supports arbitrary alignment? If I read the xhci spec correctly arbitrary alignment is explicitly permitted. Not entirely. The xhci spec has a few limits on the alignment of transfer buffer. They seem to be designed to

RE: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-07-03 Thread David Laight
From: Alexei Starovoitov +#define _(OP) ({ int ret = OP; if (ret 0) return ret; }) +1 to removing the _ macro. If you want to avoid the 3 lines (is there anything in the style guide against if ((err=OP) 0) ... ?), at assignment and function call inside 'if' ? I don't like such style.

RE: [PATCH 1/3] PCI/MSI: Add pci_enable_msi_partial()

2014-07-03 Thread David Laight
From: Bjorn Helgaas On Tue, Jun 10, 2014 at 03:10:30PM +0200, Alexander Gordeev wrote: There are PCI devices that require a particular value written to the Multiple Message Enable (MME) register while aligned on power of 2 boundary value of actually used MSI vectors 'nvec' is a lesser of

RE: [PATCH 1/3] PCI/MSI: Add pci_enable_msi_partial()

2014-07-04 Thread David Laight
From: Alexander Gordeev ... Even if you do that, you ought to write valid interrupt information into the 4th slot (maybe replicating one of the earlier interrupts). Then, if the device does raise the 'unexpected' interrupt you don't get a write to a random kernel location. I might be

RE: [PATCH 3/7] drivers: usb: Include appropriate header file in hcd.h

2013-12-19 Thread David Laight
From: Rashika Kheria Include header file include/linux/usb.h in include/linux/usb/hcd.h because structures usb_device, usb_host_config and usb_interface have their definitions in include/linux/usb.h. This eliminates the following warning in include/linux/usb/hcd.h:

RE: [PATCH 1/7] drivers: usb: Include appropriate header file in hcd.c

2013-12-19 Thread David Laight
These warning are non-default GCC warnings. These can be seen either by adding W=1 while running make (i.e. make W=1) or adding -Wmissing-prototypes in KBUILD_CFLAGS in the toplevel Makefile. By default, we don't care about 'W=1' warnings, as no one sees them, and they don't matter.

RE: [PATCH 1/7] drivers: usb: Include appropriate header file in hcd.c

2013-12-20 Thread David Laight
From: Josh Triplett On Thu, Dec 19, 2013 at 05:33:09PM -, David Laight wrote: OTOH just including extra headers isn't ideal - it can considerably slow down the compilation time. There are many subsystems that don't really separate their internal headers from their external ones

RE: [PATCH] net: asix: fix bad header length bug

2014-02-06 Thread David Laight
From: Emil Goode The AX88772B occasionally send rx packets that cross urb boundaries and the remaining partial packet is sent with no header. When the buffer with a partial packet is of less number of octets than the value of hard_header_len the buffer is discarded by the usbnet module. This

RE: [PATCH] net: asix: fix bad header length bug

2014-02-06 Thread David Laight
From: Igor Gnatenko On Thu, 2014-02-06 at 13:56 +0100, Emil Goode wrote: The AX88772B occasionally send rx packets that cross urb boundaries and the remaining partial packet is sent with no header. When the buffer with a partial packet is of less number of octets than the value of

RE: [PATCH 19/26] drivers: isdn: Move prototype declaration to header file platform.h from diva_didd.c

2014-02-07 Thread David Laight
From: Rashika Kheria Move prototype declarations of function to header file hardware/eicon/platform.h because they are used by more than one file. This eliminates the following warnings in hardware/eicon/diddfunc.c: drivers/isdn/hardware/eicon/diddfunc.c:95:12: warning: no previous prototype

RE: [PATCH] net: asix: fix bad header length bug

2014-02-07 Thread David Laight
From: Emil Goode On Fri, Feb 07, 2014 at 10:38:04AM +0100, Bjørn Mork wrote: Emil Goode emilgo...@gmail.com writes: On Thu, Feb 06, 2014 at 03:28:13PM +, David Laight wrote: From: Igor Gnatenko On Thu, 2014-02-06 at 13:56 +0100, Emil Goode wrote: The AX88772B occasionally

RE: [PATCH 19/26] drivers: isdn: Move prototype declaration to header file platform.h from diva_didd.c

2014-02-07 Thread David Laight
From: Josh Triplett On Fri, Feb 07, 2014 at 01:33:46PM +, David Laight wrote: From: Rashika Kheria Move prototype declarations of function to header file hardware/eicon/platform.h because they are used by more than one file. This eliminates the following warnings in hardware

RE: [PATCH RFCv3 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-07-16 Thread David Laight
From: Will Deacon ... + BUG_ON(imm 0 || imm 65535); Do this check with masking instead? The compiler will convert that to a single unsigned comparison. ... + BUG_ON(shift != 0 shift != 16 shift != 32 + shift != 48); OTOH I don't think it will convert

RE: [PATCH RFCv3 08/14] arm64: introduce aarch64_insn_gen_movewide()

2014-07-17 Thread David Laight
From: Will Deacon ... + BUG_ON(imm 0 || imm 65535); Do this check with masking instead? Ok, if you prefer, I can change it to: BUG_ON(imm ~GENMASK(15, 0)); Gah - then anyone reading the code has to look up another define. There isn't a prize for the most complicated

RE: [net-next PATCH v2 0/3] Broadcast/Multicast rate limit via Ethtool Coalesce

2014-07-17 Thread David Laight
From: Mugunthan V N On Thursday 10 July 2014 05:14 AM, David Miller wrote: From: Mugunthan V N mugunthan...@ti.com Date: Wed, 9 Jul 2014 12:44:07 +0530 A system/cpu can be loaded by a hacker with flooding of broadcast or multicast packets, to prevent this some Ethernet controllers like

RE: [PATCH net-next v9 3/9] net: nl802154 - make add_iface take name assign type

2014-07-18 Thread David Laight
From: David Miller From: Tom Gundersen t...@jklm.no Date: Thu, 17 Jul 2014 10:06:04 +0200 @@ -192,8 +193,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info) if (devname[nla_len(info-attrs[IEEE802154_ATTR_DEV_NAME]) - 1]

RE: [PATCH v2 2/9] mailbox: Add NVIDIA Tegra XUSB mailbox driver

2014-08-26 Thread David Laight
From: Thierry Reding ... Is _nocache required? I don't see other drivers using it. I assume there's nothing special about the mbox registers. Most drivers should be using devm_ioremap_resource() which will use the _nocache variant of devm_ioremap() when appropriate. Usually the region

RE: [PATCH v6 2/4] net: moxa: replace build_skb() with netdev_alloc_skb_ip_align() / memcpy()

2014-08-26 Thread David Laight
From: Arnd Bergmann On Monday 25 August 2014 16:22:22 Jonas Jensen wrote: @@ -226,13 +226,15 @@ static int moxart_rx_poll(struct napi_struct *napi, int budget) if (len RX_BUF_SIZE) len = RX_BUF_SIZE; - skb =

RE: [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat registers to zero

2014-08-21 Thread David Laight
From: Mark Einon Replace a long list of contiguous writel() calls with a for loop iterating over the same address values. Also remove redundant comments on the macstat registers, the variable names are good enough. ... - writel(0, macstat-txrx_0_64_byte_frames); ... - writel(0,

RE: [PATCH] vhost: Add polling mode

2014-08-21 Thread David Laight
From: Razya Ladelsky Michael S. Tsirkin m...@redhat.com wrote on 20/08/2014 01:57:10 PM: Results: Netperf, 1 vm: The polling patch improved throughput by ~33% (1516 MB/sec - 2046 MB/sec). Number of exits/sec decreased 6x. The same improvement was shown when I tested with 3

RE: [PATCH RFC v4 net-next 00/26] BPF syscall, maps, verifier, samples, llvm

2014-08-13 Thread David Laight
From: Of Alexei Starovoitov one more RFC... Major difference vs previous set is a new 'load 64-bit immediate' eBPF insn. Which is first 16-byte instruction. It shows how eBPF ISA can be extended while maintaining backward compatibility, but mainly it cleans up eBPF program access to maps

RE: [PATCH] usb: xhci: Fix Set TR Dequeue Pointer cycle state for quirky xHCs

2014-08-11 Thread David Laight
It's starting to get a bit too complicated. xhci find_new_dequeue_state() now has four places where it can toggle the cycle bit in addition to the cycle toggle in find_trb_seg(). In the end we really just want to do it max once. I'll see if I can simplify the whole cycle bit code

RE: [PATCH RFC 1/4] virtio_net: pass vi around

2014-10-24 Thread David Laight
From: Michael S. Tsirkin Too many places poke at [rs]q-vq-vdev-priv just to get the the vi structure. Let's just pass the pointer around: seems cleaner, and might even be faster. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/net/virtio_net.c | 36

RE: [RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()

2014-10-15 Thread David Laight
From: Of Michael S. Tsirkin On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: Accumulate the sent packets and sent bytes in local variables and perform a single u64_stats_update_begin/end() after. Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com

RE: [RFC PATCH net-next 3/6] virtio-net: small optimization on free_old_xmit_skbs()

2014-10-15 Thread David Laight
From: Michael S. Tsirkin On Wed, Oct 15, 2014 at 09:49:01AM +, David Laight wrote: From: Of Michael S. Tsirkin On Wed, Oct 15, 2014 at 03:25:27PM +0800, Jason Wang wrote: Accumulate the sent packets and sent bytes in local variables and perform a single

RE: [PATCH] virtio_net: fix use after free

2014-10-15 Thread David Laight
From: Michael S. Tsirkin commit 0b725a2ca61bedc33a2a63d0451d528b268cf975 net: Remove ndo_xmit_flush netdev operation, use signalling instead. added code that looks at skb-xmit_more after the skb has been put in TX VQ. Since some paths process the ring and free the skb immediately, this

RE: [PATCH v3 2/2] usb: dwc2: gadget: modify return statement

2014-10-17 Thread David Laight
From: Of Sudip Mukherjee modified the function to have a single return statement at the end instead of multiple return statement in the middle of the function to improve the readability of the code. Many of us would disagree with you there. Early returns actually make the code easier to read,

RE: [PATCH] netlink: don't copy over empty attribute data

2014-10-22 Thread David Laight
From: Sasha Levin netlink uses empty data to seperate different levels. However, we still try to copy that data from a NULL ptr using memcpy, which is an undefined behaviour. Signed-off-by: Sasha Levin sasha.le...@oracle.com --- lib/nlattr.c |3 ++- 1 file changed, 2 insertions(+), 1

RE: bit fields data tearing

2014-09-05 Thread David Laight
From: Paul E. McKenney On Thu, Sep 04, 2014 at 10:47:24PM -0400, Peter Hurley wrote: Hi James, On 09/04/2014 10:11 PM, James Bottomley wrote: On Thu, 2014-09-04 at 17:17 -0700, Paul E. McKenney wrote: +And there are anti-guarantees: + + (*) These guarantees do not apply to

RE: bit fields data tearing

2014-09-05 Thread David Laight
From: Peter Hurley [ +cc linux-arm ] Hi David, On 09/05/2014 04:30 AM, David Laight wrote: I've seen gcc generate 32bit accesses for 16bit structure members on arm. It does this because of the more limited range of the offsets for the 16bit access. OTOH I don't know if it ever did

RE: [PATCH v2] cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec

2014-09-01 Thread David Laight
From: Shilpa Bhat Hi Viresh, On Fri, 2014-08-29 at 05:33 +0530, Viresh Kumar wrote: On 28 August 2014 19:36, Shilpasri G Bhat shilpa.b...@linux.vnet.ibm.com wrote: Changes v1-v2: Invoke .target() driver callback to set the cpus to nominal frequency in reboot notifier, instead of

RE: [PATCH v3 0/3] sched: Always check the integrity of the canary

2014-09-12 Thread David Laight
From: Chuck Ebbert David Laight david.lai...@aculab.com wrote: From: Aaron Tomlin Currently in the event of a stack overrun a call to schedule() does not check for this type of corruption. This corruption is often silent and can go unnoticed. However once the corrupted region

RE: [PATCH] net: can: usb: peak_usb: pcan_usb_core.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-09-15 Thread David Laight
From: Rickard Strandqvist ... Replacing strncpy with strlcpy to avoid strings that lacks null terminate. ... diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index 644e6ab..d4fe8ac 100644 ---

RE: [PATCH] net: can: usb: peak_usb: pcan_usb_core.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-09-15 Thread David Laight
From: Marc Kleine-Budde [ On 09/15/2014 10:28 AM, David Laight wrote: From: Rickard Strandqvist ... Replacing strncpy with strlcpy to avoid strings that lacks null terminate. ... diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c

RE: [PATCH] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-07 Thread David Laight
From: Lothar Waßmann commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access memory beyond the actual packet size in the DMA buffer.

RE: [PATCH] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-07 Thread David Laight
From: Lothar David Laight wrote: From: Lothar Waßmann commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access memory

RE: [PATCH] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-07 Thread David Laight
From: Eric Dumazet On Tue, 2014-10-07 at 15:19 +0200, Lothar Wamann wrote: commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access

RE: [PATCH] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-08 Thread David Laight
From: Lothar Waßmann David Laight wrote: From: Eric Dumazet On Tue, 2014-10-07 at 15:19 +0200, Lothar Wamann wrote: commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing

RE: [PATCH] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-08 Thread David Laight
From: Sergei Shtylyov On 10/07/2014 05:19 PM, Lothar Wamann wrote: commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access

RE: [PATCH 1/1 net-next] af_unix: remove NULL assignment on static

2014-10-08 Thread David Laight
From: Hannes Frederic Sowa I think David's concern was whether if 0 == false in all situations. It is pretty clear that static memory is initialized to 0. I'm not 100% sure about that. static pointers may be required to be initialised to NULL. If NULL isn't the 'all 0 bit pattern' then the

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread David Laight
From: Hannes Frederic On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: On Mon, Sep 29, 2014 at 4:04 AM, David Laight david.lai...@aculab.com wrote: From: Kees Cook This makes the size argument a const, since it is always populated by the caller. There is almost no point

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-30 Thread David Laight
From: Hannes Frederic On Di, 2014-09-30 at 08:20 +, David Laight wrote: From: Hannes Frederic On Mo, 2014-09-29 at 12:41 -0700, Kees Cook wrote: On Mon, Sep 29, 2014 at 4:04 AM, David Laight david.lai...@aculab.com wrote: From: Kees Cook This makes the size argument

RE: [PATCH v5 2/3] net: Add Keystone NetCP ethernet driver

2014-09-30 Thread David Laight
From: David Miller From: Santosh Shilimkar santosh.shilim...@ti.com Date: Thu, 25 Sep 2014 13:48:36 -0400 +static inline int gbe_phy_link_status(struct gbe_slave *slave) +{ + if (!slave-phy) + return 1; + + if (slave-phy-link) + return 1; + + return

RE: [PATCHv2 6/6] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-28 Thread David Laight
From: Lothar Waßmann commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access memory beyond the actual packet size in the DMA buffer.

RE: [PATCHv2 6/6] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-28 Thread David Laight
From: Lothar Waßmann commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access memory beyond the actual packet size in the DMA buffer.

RE: [PATCHv2 6/6] net: fec: fix regression on i.MX28 introduced by rx_copybreak support

2014-10-28 Thread David Laight
From: Lothar Waßmann David Laight wrote: From: Lothar Waßmann commit 1b7bde6d659d (net: fec: implement rx_copybreak to improve rx performance) introduced a regression for i.MX28. The swap_buffer() function doing the endian conversion of the received data on i.MX28 may access memory

RE: [PATCH 03/10] mm: Convert p[te|md]_numa users to p[te|md]_protnone_numa

2014-11-20 Thread David Laight
From: Mel Gorman Convert existing users of pte_numa and friends to the new helper. Note that the kernel is broken after this patch is applied until the other page table modifiers are also altered. This patch layout is to make review easier. Doesn't that break bisection? David

RE: [PATCH v3 0/3] sched: Always check the integrity of the canary

2014-09-11 Thread David Laight
From: Aaron Tomlin Currently in the event of a stack overrun a call to schedule() does not check for this type of corruption. This corruption is often silent and can go unnoticed. However once the corrupted region is examined at a later stage, the outcome is undefined and often results in a

RE: bit fields data tearing

2014-09-04 Thread David Laight
From: Benjamin Herrenschmidt On Wed, 2014-09-03 at 18:51 -0400, Peter Hurley wrote: Apologies for hijacking this thread but I need to extend this discussion somewhat regarding what a compiler might do with adjacent fields in a structure. The tty subsystem defines a large aggregate

RE: [RFC] situation with csum_and_copy_... API

2014-11-21 Thread David Laight
From: Al Viro ... We would be better off with iov_iter passed to __sock_{send,recv}msg() (as a part of struct msghdr, instead of -msg_iov/-msg_iovlen) and always advanced to match the amount of data actually picked from it. With iovec behind it remaining constant. That would work just as

RE: [RFC] situation with csum_and_copy_... API

2014-11-24 Thread David Laight
From: Al Viro On Fri, Nov 21, 2014 at 05:42:55PM +, David Laight wrote: Callers of kernel_send/recvmsg() could easily be using a wrapper function that creates the 'msghdr'. When the want to send the remaining part of a buffer the old iterator will no longer be available - just

RE: [RFC] situation with csum_and_copy_... API

2014-11-24 Thread David Laight
From: Al Viro On Fri, Nov 21, 2014 at 08:49:56AM +, Al Viro wrote: Overall, I think I have the whole series plotted in enough details to be reasonably certain we can pull it off. Right now I'm dealing with mm/iov_iter.c stuff; the amount of boilerplate source is already high enough

RE: [PATCH] net: can: usb: peak_usb: pcan_usb_core.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-09-16 Thread David Laight
From: Rickard Strandqvist 2014-09-15 10:47 GMT+02:00 David Laight david.lai...@aculab.com: ... Or: char name[sizeof netdev-name]; memcpy(name, netdev-name, sizeof netdev-name); ... I liked the variant: char name[sizeof(netdev-name)]; But dislike and do not understand what

RE: [PATCH] tun: make sure interface usage can not overflow

2014-09-29 Thread David Laight
From: Kees Cook This makes the size argument a const, since it is always populated by the caller. There is almost no point making parameters 'const. ('const foo *' makes sense). Additionally double-checks to make sure the copy_from_user can never overflow, keeping

RE: [PATCH 1/3] arch: Introduce load_acquire() and store_release()

2014-11-14 Thread David Laight
From: Alexander Duyck It is common for device drivers to make use of acquire/release semantics when dealing with descriptors stored in device memory. On reviewing the documentation and code for smp_load_acquire() and smp_store_release() as well as reviewing an IBM website that goes over the

RE: [PATCH 0/4] phy: samsung-usb2: Add support for Vbus regulator

2014-12-11 Thread David Laight
From: Vivek Gautam This has been on my to-do list for sometime. Until now the host controller (specifically ehci-exynos) is responsible for enabling VBUS supply. This opens up one more issue which is, when only ohci-exynos is enabled and ehci-exynosis disabled then VBUS was never enabled

RE: [PATCH v2 1/1] net/macb: add TX multiqueue support for gem

2014-12-12 Thread David Laight
From: Thomas Petazzoni On Thu, 11 Dec 2014 11:16:51 +0100, Cyrille Pitchen wrote: +#define GEM_ISR1 0x0400 +#define GEM_ISR2 0x0404 +#define GEM_ISR3 0x0408 +#define GEM_ISR4 0x040c

RE: [PATCH v2 1/1] net/macb: add TX multiqueue support for gem

2014-12-12 Thread David Laight
From: Cyrille Pitchen [... It will probably add a lot of object code and, depending on how often the registers are accesses, might have performance impact. Having: #define GEM_ISR(n) (0x400 + (n) 4) will save source code. David So you suggest that we keep the unsigned

RE: [PATCH 0/4] Add lightweight memory barriers fast_rmb() and fast_wmb()

2014-11-18 Thread David Laight
From: Alexander Duyck These patches introduce two new primitives for synchronizing cache-enabled memory writes and reads. These two new primitives are: fast_rmb() fast_wmb() Not sure I like the names. If the aim is to sync data into the local cache so that hardware that is

RE: [PATCH RFC v4 net-next 0/5] virtio_net: enabling tx interrupts

2014-12-02 Thread David Laight
From: Jason Wang On Mon, Dec 01, 2014 at 06:17:03PM +0800, Jason Wang wrote: Hello: We used to orphan packets before transmission for virtio-net. This breaks socket accounting and can lead serveral functions won't work, e.g: - Byte Queue Limit depends on tx completion

RE: nf_reject_ipv4: module license 'unspecified' taints kernel

2014-10-10 Thread David Laight
From: Dave Young With today's linus tree, I got below kmsg: [ 23.545204] nf_reject_ipv4: module license 'unspecified' taints kernel. [ 23.551886] Disabling lock debugging due to kernel taint ... Not 100% related, but why does loading a non-GPL module disable lock debugging? (Is 'lock

RE: [PATCH] net: wireless: brcm80211: brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

2014-10-13 Thread David Laight
From: Rickard Strandqvist Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And changed from using strncpy to strlcpy to simplify code. I think you should return an error if the strings get truncated. Silent truncation is going to lead to issues at some point in the

RE: RCU bug with v3.17-rc3 ?

2014-10-13 Thread David Laight
From: Nathan Lynch On 10/10/2014 11:25 AM, Russell King - ARM Linux wrote: Right, so GCC 4.8.{1,2} are totally unsuitable for kernel building (and it seems that this has been known about for some time.) Looking at http://gcc.gnu.org/PR58854 it seems that all 4.8.x for x 3 are affected,

RE: [PATCH] net: eth: realtek: atp: checkpatch errors and warnings corrected

2014-11-04 Thread David Laight
From: Roberto Medina On 11/03/2014 07:51 PM, Joe Perches wrote: Some ancient drivers could be regarded as neolithic curiosities that never need updating. This may be one. But if you really want to change it, could you please make sure that objdiff shows no changes? I see some

RE: [PATCH] x86: bpf_jit_comp: simplify trivial boolean return

2014-11-27 Thread David Laight
From: Joe Perches On Wed, 2014-11-26 at 10:34 -0800, Alexei Starovoitov wrote: On Wed, Nov 26, 2014 at 10:02 AM, Joe Perches j...@perches.com wrote: On Wed, 2014-11-26 at 09:23 -0800, Alexei Starovoitov wrote: On Wed, Nov 26, 2014 at 8:58 AM, Joe Perches j...@perches.com wrote: Is

RE: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-27 Thread David Laight
From: David Hildenbrand ... Although it might not be optimal, but keeping a separate counter for pagefault_disable() as part of the preemption counter seems to be the only doable thing right now. I am not sure if a completely separated counter is even possible, increasing the size of

RE: [RFC 0/2] Reenable might_sleep() checks for might_fault() when atomic

2014-11-27 Thread David Laight
From: David Hildenbrand [mailto:d...@linux.vnet.ibm.com] From: David Hildenbrand ... Although it might not be optimal, but keeping a separate counter for pagefault_disable() as part of the preemption counter seems to be the only doable thing right now. I am not sure if a completely

RE: Where exactly will arch_fast_hash be used

2014-12-04 Thread David Laight
From: Herbert Xu On Thu, Dec 04, 2014 at 04:43:31PM +0100, Daniel Borkmann wrote: Hm, I thought the kernel doc on arch_fast_hash() in include/linux/hash.h would give enough of a hint ... I think something more explicit like do not use this in a hash table unless you know what you're

RE: [PATCH v1 3/5] mm, uaccess: trigger might_sleep() in might_fault() when pagefaults are disabled

2014-12-05 Thread David Laight
From: David Hildenbrand [... This should be likely() instead of unlikely(), no? I'd rather write this if (pagefault_disabled()) return; __might_sleep(file, line, 0); and leave the likely stuff completely away. Makes perfect sense! From my experience of

RE: [PATCH 2/2] gianfar: handle map error in gfar_start_xmit()

2014-12-10 Thread David Laight
From: David Miller From: Arseny Solokha asolo...@kb.kras.ru Date: Fri, 5 Dec 2014 17:37:54 +0700 @@ -2296,6 +2296,12 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) 0,

RE: [RFC PATCH 0/3] Faster than SLAB caching of SKBs with qmempool (backed by alf_queue)

2014-12-10 Thread David Laight
From: Jesper Dangaard Brouer The network stack have some use-cases that puts some extreme demands on the memory allocator. One use-case, 10Gbit/s wirespeed at smallest packet size[1], requires handling a packet every 67.2 ns (nanosec). Micro benchmarking[2] the SLUB allocator (with skb size

RE: [PATCH 0/5] powerpc: Get rid of redundant arch specific swab functions

2015-02-04 Thread David Laight
From: David Gibson arch/powerpc/include/asm/swab.h includes some powerpc specific byteswapping functions, which are implemented in terms of powerpc's built in byte reversed load/store instructions. There are two problems with this: 1) They're not necessary - gcc is perfectly capable of

RE: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread David Laight
From: Gang S On 2/3/15 10:32, Chen Gang S wrote: On 2/3/15 05:20, Joe Perches wrote: On Tue, 2015-02-03 at 05:14 +0800, Chen Gang S wrote: hci_test_bit() does not modify 2nd parameter, so it is better to let it be constant, or may cause build warning. The related warning (with

RE: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread David Laight
From: Chen Gang S -static inline int hci_test_bit(int nr, void *addr) +static inline int hci_test_bit(int nr, const void *addr) { return *((__u32 *) addr + (nr 5)) ((__u32) 1 (nr 31)); } Is there a 'standard' function lurking that will do the above. On x86 the cpus 'bit test'

<    1   2   3   4   5   6   7   8   9   10   >