RE: [PATCH v3 06/10] net/macb: clean up ring buffer logic

2012-10-30 Thread David Laight
Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. ... +static unsigned int macb_tx_ring_avail(struct macb

RE: [PATCH v3 06/10] net/macb: clean up ring buffer logic

2012-10-31 Thread David Laight
On Tue, Oct 30, 2012 at 4:12 AM, David Laight david.lai...@aculab.com wrote: Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize

RE: [PATCH v3 06/10] net/macb: clean up ring buffer logic

2012-10-31 Thread David Laight
return (TX_RING_SIZE - (bp-tx_head - bp-tx_tail) (TX_RING_SIZE - 1)); Is equivalent to: return (bp-tx_tail - bp-tx_head) (TX_RING_SIZE - 1)); David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

RE: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-31 Thread David Laight
On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit kernels. */ +#define hash_min(val, bits) \ +({

RE: [PATCH 3/9] net: xfrm: use this_cpu_ptr per-cpu helper

2012-11-01 Thread David Laight
this_cpu_read |-_this_cpu_generic_read #define _this_cpu_generic_read(pcp) \ ({ typeof(pcp) ret__; \ preempt_disable(); \ ret__ =

RE: [PATCH v4] lxt PHY: Support for the buggy LXT973 rev A2

2012-09-24 Thread David Laight
This patch adds proper handling of the buggy revision A2 of LXT973 phy, adding precautions linked to ERRATA Item 4: Revision A2 of LXT973 chip randomly returns the contents of the previous even register when you read a odd register regularly Does reading the PHY registers involve

RE: [PATCH v6] hashtable: introduce a small and naive hashtable

2012-09-26 Thread David Laight
Amazing how something simple gets lots of comments and versions :-) ... + * This has to be a macro since HASH_BITS() will not work on pointers since + * it calculates the size during preprocessing. + */ +#define hash_empty(hashtable) \

RE: [PATCH v6] hashtable: introduce a small and naive hashtable

2012-09-27 Thread David Laight
And even then, if we would do: for (i = 0; i HASH_SIZE(hashtable); i++) if (!hlist_empty(hashtable[i])) break; return i = HASH_SIZE(hashtable); What happens if the last entry of the table is non-empty ? It still works, as 'i' is not

RE: [PATCH v6] hashtable: introduce a small and naive hashtable

2012-09-27 Thread David Laight
Moreover, if your thinking is that we do not need a static inline function replicated at every caller, maybe we should introduce a lib/hashtable.c that implements those 2 functions. That was my thought... Given their nature, I'd guess they aren't critical path. Probably not worth adding an

RE: [PATCH v2 00/11] introduce random32_get_bytes() and random32_get_bytes_state()

2012-11-06 Thread David Laight
On Sun, 04 Nov 2012 00:43:31 +0900, Akinobu Mita said: This patchset introduces new functions into random32 library for getting the requested number of pseudo-random bytes. Before introducing these new functions into random32 library, prandom32() and prandom32_seed() with prandom32

RE: [RFC PATCH v2 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-10-24 Thread David Laight
Looks the problem is worse than above, not only bitfields are affected, the adjacent fields might be involved too, see: http://lwn.net/Articles/478657/ Not mentioned in there is that even with x86/amd64 given a struct with the following adjacent fields: char a;

RE: [PATCH net-next?] pktgen: Use simpler test for non-zero ipv6 address

2012-10-11 Thread David Laight
- if (pkt_dev-min_in6_daddr.s6_addr32[0] == 0 - pkt_dev-min_in6_daddr.s6_addr32[1] == 0 - pkt_dev-min_in6_daddr.s6_addr32[2] == 0 - pkt_dev-min_in6_daddr.s6_addr32[3] == 0) ; - else { + if

RE: [RFC net-next] treewide: s/ipv4_is_foo()/ipv4_addr_foo/

2012-10-11 Thread David Laight
ipv4 and ipv6 use different styles for these tests. ipv4_is_foo(__be32) ipv6_addr_foo(struct in6_addr *) I presume there is a 'const' in there ... Perhaps it'd be good to convert the ipv4 tests to the ipv6 style. You don't want to force an IPv4 address (which might be in a register) be

RE: [PATCH] SUNRPC: Prevent kernel stack corruption on long values of flush

2012-10-18 Thread David Laight
... long is always the same or bigger then a pointer (A pointer must always fit in a long) ... Linux may make that assumption, but it doesn't have to be true. 64bit windows still has 32bit long. C99 inttypes.h defines [u]intptr_t to be an integral type that is large enough to hold a pointer

RE: [PATCH BUGFIX 2/6] pkt_sched: fix the update of eligible-group sets

2013-03-06 Thread David Laight
Between two invocations of make_eligible, the system virtual time may happen to grow enough that, in its binary representation, a bit with higher order than 31 flips. This happens especially with TSO/GSO. Before this fix, the mask used in make_eligible was computed as

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a necessary step on the way to reduce the amount of copying done by the driver.

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-03 Thread David Laight
On 12/03/2012 01:43 PM, David Laight : Allocate regular pages to use as backing for the RX ring and use the DMA API to sync the caches. This should give a bit better performance since it allows the CPU to do burst transfers from memory. It is also a necessary step on the way to reduce

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
If I understand well, you mean that the call to: dma_sync_single_range_for_device(bp-pdev-dev, phys, pg_offset, frag_len, DMA_FROM_DEVICE); in the rx path after having copied the data to skb is not needed? That is also the conclusion that I

RE: [PATCH v2] net/macb: Use non-coherent memory for rx buffers

2012-12-05 Thread David Laight
Well, for the 10/100 MACB interface, I am stuck with 128 Bytes buffers! So this use of pages seems sensible. If you have dma coherent memory you can make the rx buffer space be an array of short buffers referenced by adjacent ring entries (possibly with the last one slightly short to allow for

RE: [PATCH, resubmit] ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver

2013-02-08 Thread David Laight
+struct ax88179_rx_pkt_header { + u8 l4_csum_err:1, + l3_csum_err:1, + l4_type:3, + l3_type:2, + ce:1; + + u8 vlan_ind:3, + rx_ok:1, + pri:3, + bmc:1; + + u16 len:13, +

Re: [PATCH v3 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-03-01 Thread David Laight
On Thu, Feb 28, 2013 at 01:53:25PM -0800, Andy Lutomirski wrote: O_DENYMAND - to switch on/off three flags above. O_DENYMAND doesn't deny anything. Would a name like O_RESPECT_DENY be better? Possibly rename to O_CHECK_DENY ? David -- David Laight: da...@l8s.co.uk

RE: [PATCH] vhost-net: fall back to vmalloc if high-order allocation fails

2013-01-24 Thread David Laight
+ n = kmalloc(sizeof *n, GFP_KERNEL | __GFP_NOWARN); + if (!n) + n = vmalloc(sizeof *n); I'm slightly confused by this construct. I thought kmalloc(... GFP_KERNEL) would sleep waiting for memory (rather than return NULL). I realise that (for multi-page sizes) that

RE: [PATCH] vhost-net: fall back to vmalloc if high-order allocation fails

2013-01-24 Thread David Laight
I think this means that kmalloc() is likely to be faster (if it doesn't have to sleep), but that vmalloc() is allocating from a much larger resource. This make me that that large allocations that are not temporary should probably be allocated with vmalloc(). vmalloc has some issues

RE: [patch v2] b43: N-PHY: fix gain in b43_nphy_get_gain_ctl_workaround_ent()

2013-01-18 Thread David Laight
+ int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a, 0x106c, +0x1074, 0x107c, 0x207c}; static const int ... David -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

RE: [PATCH v6 08/46] CPU hotplug: Provide APIs to prevent CPU offline from atomic context

2013-02-19 Thread David Laight
I wouldn't go that far... ;-) Unfairness is not a show-stopper right? IMHO, the warning/documentation should suffice for anybody wanting to try out this locking scheme for other use-cases. I presume that by 'fairness' you mean 'write preference'? I'd not sure how difficult it would be, but

RE: Disable IPv4-mapped - enforce IPV6_V6ONLY

2013-02-25 Thread David Laight
A proper solution would be to either return false if net.ipv6.bindv6only is true and optval is false (which would break downward compatibility because it wouldn't just be a default and setsockopt might return an error) or to introduce a new sysctl variable like

RE: [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-09-06 Thread David Laight
My solution to making 'break' work in the iterator is: for (bkt = 0, node = NULL; bkt HASH_SIZE(name) node == NULL; bkt++) hlist_for_each_entry(obj, node, name[bkt], member) I'd take a look at the generated code. Might come out a bit better if the condition is changed

RE: [PATCH 2/2] netprio_cgroup: Optimize the priomap copy loop slightly

2012-09-11 Thread David Laight
- for (i = 0; - old_priomap (i old_priomap-priomap_len); - i++) - new_priomap-priomap[i] = old_priomap-priomap[i]; + if (old_priomap) { + old_len = old_priomap-priomap_len; + + for (i = 0; i old_len; i++) +

RE: [PATCH 9/9] drivers/isdn/gigaset/common.c: Remove useless kfree

2012-09-13 Thread David Laight
Remove useless kfree() and clean up code related to the removal. ... diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index aa41485..30a6b17 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c @@ -1123,7 +1123,6 @@ struct gigaset_driver

RE: [PATCH] sata_fsl: add workaround for data length mismatch on freescale V2 controller

2012-09-04 Thread David Laight
+ /* Read command completed register */ + done_mask = ioread32(hcr_base + CC); + + if (host_priv-quirks SATA_FSL_QUIRK_V2_ERRATA) { + if (unlikely(hstatus INT_ON_DATA_LENGTH_MISMATCH)) { + for (tag = 0; tag ATA_MAX_QUEUE; tag++) { +

RE: [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-15 Thread David Laight
Yes hash_32 seems reasonable for the uid hash. With those long hash chains I wouldn't like to be on a machine with 10,000 processes with each with a different uid, and a processes calling setuid in the fast path. The uid hash that we are playing with is one that I sort of wish that the

RE: [PATCH 1/1] tcp: Wrong timeout for SYN segments

2012-08-23 Thread David Laight
I would suggest to increase TCP_SYN_RETRIES from 5 to 6. 180 secs is eternity, but 31 secs is too small. Wasn't the intention of the long delay to allow a system acting as a router to reboot? I suspect that is why it (and some other TCP timers) are in minutes. David

RE: [PATCH v2 3/3] pppoatm: protect against freeing of vcc

2012-11-28 Thread David Laight
On Tue, 27 Nov 2012 18:02:29 + David Woodhouse dw...@infradead.org wrote: In solos-pci at least, the ops-close() function doesn't flush all pending skbs for this vcc before returning. So can be a tasklet somewhere which has loaded the address of the vcc-pop function from one of

Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-12 Thread David Laight
compiler manages to obtain exclusive access to the source files - stopping the other systems from reading them. David -- David Laight: da...@l8s.co.uk -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo

RE: [PATCH 0/2] fs: supply inode uid/gid setting interface

2013-08-27 Thread David Laight
Subject: Re: [PATCH 0/2] fs: supply inode uid/gid setting interface On 2013/8/23 12:10, Greg KH wrote: On Fri, Aug 23, 2013 at 10:48:36AM +0800, Rui Xiang wrote: This patchset implements an accessor functions to set uid/gid in inode struct. Just finish code clean up. Why? It can

RE: [net-next rfc 1/3] net: avoid high order memory allocation for queues by using flex array

2013-06-19 Thread David Laight
+static void netif_free_tx_queues(struct net_device *dev) +{ + if (is_vmalloc_addr(dev-_tx)) + vfree(dev-_tx); + else + kfree(dev-_tx); +} + static int netif_alloc_netdev_queues(struct net_device *dev) { unsigned int count = dev-num_tx_queues; @@

RE: [PATCH 2/2] perf tools: Make Power7 events available for perf

2013-06-20 Thread David Laight
I think we should be able to do something better using the C preprocessor, this is exactly the sort of thing it's good at. What I mean is something like we do with arch/powerpc/include/asm/systbl.h, where we define the list of syscalls once, and then include it in multiple places, using

RE: [PATCH v7] ethernet/arc/arc_emac - Add new driver

2013-06-21 Thread David Laight
So it should be declared dma_addr_t then, + addr = dma_map_single(ndev-dev, (void *)rx_buff-skb-data, + buflen, DMA_FROM_DEVICE); + if (dma_mapping_error(ndev-dev, addr)) { + if (net_ratelimit())

RE: [RFC PATCH] vsnprintf: Remove use of %n and convert existing uses

2013-09-12 Thread David Laight
On Wed, Sep 11, 2013 at 05:04:17PM -0700, Joe Perches wrote: On Thu, 2013-09-12 at 08:40 +0900, Tetsuo Handa wrote: Joe Perches wrote: - seq_printf(m, %s%d%n, con-name, con-index, len); + len = seq_printf(m, %s%d, con-name, con-index); Isn't len always 0 or -1 ?

RE: [PATCH v3 1/3] phy: Add new Exynos USB PHY driver

2013-11-06 Thread David Laight
I just did a diff of registers in exynos 4210 and 4212 PHY drivers [1] and couldn't find that big a difference in register layout. Of course there are a few changes in HSIC bit fields and PHYFSEL but that's only minimal and could well be handled in a single driver. [1] -

RE: [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern

2013-10-04 Thread David Laight
It seems to me that a more useful interface would take a minimum and maximum number of vectors from the driver. This wouldn't allow the driver to specify that it could only accept, say, any even number within a certain range, but you could still leave the current functions available for

RE: [PATCH 02/10][v6] powerpc/Power7: detect load/store instructions

2013-10-16 Thread David Laight
Implement instr_is_load_store_2_06() to detect whether a given instruction is one of the fixed-point or floating-point load/store instructions in the POWER Instruction Set Architecture v2.06. ... +int instr_is_load_store_2_06(const unsigned int *instr) +{ + unsigned int op, upper, lower;

RE: [PATCH] X.25: Fix address field length calculation

2013-10-16 Thread David Laight
On Tue, 2013-10-15 at 14:29 +, Kelleter, Günther wrote: Addresses are BCD encoded, not ASCII. x25_addr_ntoa got it right. [] Wrong length calculation leads to rejection of CALL ACCEPT packets. [] diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c [] @@ -98,7 +98,7 @@ int

RE: [PATCH RFC v2 29/29] vmxnet3: Make use of pcim_enable_msix_range() interface

2013-10-21 Thread David Laight
Subject: [PATCH RFC v2 29/29] vmxnet3: Make use of pcim_enable_msix_range() interface ... diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index d33802c..e552d2b 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@

RE: [PATCH 1/1] mfd: omap-usb-host: Fix USB device detection problems on OMAP4 Panda

2013-11-29 Thread David Laight
From: Of Roger Quadros With u-boot 2013.10, USB devices are sometimes not detected on OMAP4 Panda. To make us independent of what bootloader does with the USB Host module, we must RESET it to get it to a known good state. This patch Soft RESETs the USB Host module. ... +++

RE: [PATCH 1/4] pch_gbe: Fix transmit queue management

2013-12-02 Thread David Laight
From: David Miller According to Documentation/networking/driver.txt the ndo_start_xmit method should not return NETDEV_TX_BUSY under normal circumstances. Stop the transmit queue when tx_ring is full. ... You should be instead preventing the transmit method from being invoked when it

RE: [PATCH 1/1] mfd: omap-usb-host: Fix USB device detection problems on OMAP4 Panda

2013-12-02 Thread David Laight
From: Roger Quadros [mailto:rog...@ti.com] On 11/29/2013 03:17 PM, David Laight wrote: ... + timeout = jiffies + msecs_to_jiffies(100); + while (!(usbhs_read(omap-uhh_base, OMAP_UHH_SYSSTATUS) + OMAP_UHH_SYSSTATUS_RESETDONE)) { + cpu_relax(); You mean use

RE: [PATCH] ipvs: Remove unused variable ret from sync_thread_master()

2013-11-12 Thread David Laight
@@ -1637,7 +1637,7 @@ static int sync_thread_master(void *data) continue; } while (ip_vs_send_sync_msg(tinfo-sock, sb-mesg) 0) { - int ret = __wait_event_interruptible(*sk_sleep(sk), So ideally there's be a comment here

RE: [PATCH] ipvs: Remove unused variable ret from sync_thread_master()

2013-11-12 Thread David Laight
I've done this in the past so that the code sleeps interruptibly unless there is a signal pending - which would cause it to return early. /* Tell scheduler we are going to sleep... */ if (signal_pending(current)) /* We don't want waking immediately (again) */

RE: [Fwd: Re: [PATCH v2 2/2] x86: add prefetching to do_csum]

2013-11-13 Thread David Laight
Sure, I modified the code so that we only prefetched 2 cache lines ahead, but only if the overall length of the input buffer is more than 2 cache lines. Below are the results (all counts are the average of 100 iterations of the csum operation, as previous tests were, I just omitted that

RE: [Fwd: Re: [PATCH v2 2/2] x86: add prefetching to do_csum]

2013-11-13 Thread David Laight
I'm not sure, whats the typical capacity for the branch predictors ability to remember code paths? ... For such simple single-target branches it goes near or over a thousand for recent Intel and AMD microarchitectures. Thousands for really recent CPUs. IIRC the x86 can also correctly

RE: net/usb/ax88179_178a driver broken in linux-3.12

2013-11-19 Thread David Laight
From: Eric Dumazet [mailto:eric.duma...@gmail.com] On Tue, 2013-11-19 at 09:02 -0500, Mark Lord wrote: On 13-11-19 05:04 AM, David Laight wrote: From: Mark Lord .. except the ax88179_178a driver still does not work in linux-3.12, whereas it works fine in all earlier kernels. I've

RE: net/usb/ax88179_178a driver broken in linux-3.12

2013-11-19 Thread David Laight
From: Eric Dumazet [mailto:eric.duma...@gmail.com] On Tue, 2013-11-19 at 14:43 +, David Laight wrote: It isn't directly a TSO problem. There has always been a bug in the xhci driver for fragmented buffers. TSO just means it is given a lot of fragmented buffers. As well as user

RE: Supporting 4 way connections in LKSCTP

2013-12-04 Thread David Laight
In normal operation, IP-A sends INIT to IP-X, IP-X returns INIT_ACK to IP-A. IP-A then sends HB to IP-X, IP-X then returns HB_ACK to IP-A. In the meantime, IP-B sends HB to IP-Y and IPY returns HB_ACK. In case of the path between IP-A and IP-X is broken, IP-B sends INIT to IP-X, NODE-B

RE: Supporting 4 way connections in LKSCTP

2013-12-04 Thread David Laight
There are some network configurations that do cause problems. Consider 4 systems with 3 LAN segments: A) 10.10.10.1 on LAN X and 192.168.1.1 on LAN Y. B) 10.10.10.2 on LAN X and 192.168.1.2 on LAN Y. C) 10.10.10.3 on LAN X. D) 10.10.10.4 on LAN X and 192.168.1.2 on LAN Z. There are

RE: Supporting 4 way connections in LKSCTP

2013-12-04 Thread David Laight
The point is that address scoping should be used. When sending an INIT from 10.10.10.1 to 10.10.10.4 you should not list 192.168.1.1, since you are transmitting an address to a node which might or might not be in the same scope. You might have two machines that are connected via the public

RE: Supporting 4 way connections in LKSCTP

2013-12-05 Thread David Laight
the configured addresses could be: System A) 10.0.0.1 on Lan X, 10.10.0.1 on Lan Y System B) 10.0.0.2 on Lan X, 10.10.0.2 on Lan Y System C) 10.0.0.3 on Lan X, 10.10.0.2 on Lan Z Same problem will occur. ... With that, Sys A talking to Sys C will get an abort from Sys B when trying

RE: [PATCH net-next v2 1/2] r8152: add RTL8152_EARLY_AGG_TIMEOUT_SUPER

2014-03-13 Thread David Laight
From: Hayes Wang For slow CPU, the frequent bulk transfer would cause poor throughput. One solution is to increase the timeout of the aggregation. It let the hw could complete the bulk transfer later and fill more packets into the buffer. Besides, it could reduce the frequency of the bulk

RE: [PATCH net-next v3 1/2] r8152: add RTL8152_EARLY_AGG_TIMEOUT_SUPER

2014-03-13 Thread David Laight
From: Hayes Wang ... I should have spotted this before. /* USB_RX_EARLY_AGG */ -#define EARLY_AGG_SUPPER 0x0e832981 +#define EARLY_AGG_SUPER rx_buf_sz - 1522) / 4) 16) | \ + (u32)(CONFIG_RTL8152_EARLY_AGG_TIMEOUT_SUPER = 0 ? 85 * 125 : \ +

RE: [PATCH v3 1/4] net: add name_assign_type netdev attribute

2014-03-17 Thread David Laight
From: David Herrmann The name_assign_type attribute gives hints where the interface name of a given net-device comes from. Three different values are currently defined: NET_NAME_ENUM: This is the default. The ifname is provided by the kernel with an enumerated suffix. Names may be

RE: [PATCH v2] net: netfilter: LLVMLinux: vlais-netfilter

2014-03-18 Thread David Laight
From: beh...@converseincode.com From: Mark Charlebois charl...@gmail.com Replaced non-standard C use of Variable Length Arrays In Structs (VLAIS) in xt_repldata.h with a C99 compliant flexible array member and then calculated offsets to the other struct members. These other members aren't

RE: [PATCH v2] net: netfilter: LLVMLinux: vlais-netfilter

2014-03-18 Thread David Laight
From: Behan Webster On 03/18/14 02:41, David Laight wrote: From: beh...@converseincode.com From: Mark Charlebois charl...@gmail.com Replaced non-standard C use of Variable Length Arrays In Structs (VLAIS) in xt_repldata.h with a C99 compliant flexible array member

RE: sisusb: Use static const, fix typo

2014-02-24 Thread David Laight
From: Joe Perches Reduce text a bit by using static const. If you want to save a few bytes remove the pointers. (and the fixed RAM text to get below 7 chars). eg: - const char *ramtypetext2[] = { SDR SDRAM, SDR SGRAM, - DDR SDRAM, DDR SGRAM };

RE: sisusb: Use static const, fix typo

2014-02-25 Thread David Laight
From: Joe Perches [ On Mon, 2014-02-24 at 10:26 +, David Laight wrote: From: Joe Perches Reduce text a bit by using static const. If you want to save a few bytes remove the pointers. (and the fixed RAM text to get below 7 chars). Hi David. eg: - const char

RE: [PATCH] net/usb: Add Lenovo ThinkPad OneLink GigaLAN USB ID to ax88179 driver

2014-02-25 Thread David Laight
From: Keith Packard The Lenovo OneLink dock includes a USB ethernet adapter using the AX88179 chip, but with a different USB ID. Add this new USB id to the driver so that it will autodetect the adapter correctly. Signed-off-by: Keith Packard kei...@keithp.com Tested-by: Carl Worth

RE: [PATCH net-next 08/12] r8152: support TSO

2014-03-04 Thread David Laight
From: Hayes Wang Support scatter gather and TSO. Adjust the tx checksum function and set the max gso size to fix the size of the tx aggregation buffer. There is little point supporting TSO unless the usb host controller supports arbitrary aligned scatter-gather. All you do is require that a

RE: [PATCH net-next 08/12] r8152: support TSO

2014-03-04 Thread David Laight
From: hayeswang David Laight [mailto:david.lai...@aculab.com] Sent: Tuesday, March 04, 2014 8:12 PM To: 'Hayes Wang'; net...@vger.kernel.org Cc: nic_s...@realtek.com; linux-kernel@vger.kernel.org; linux-...@vger.kernel.org Subject: RE: [PATCH net-next 08/12] r8152: support TSO

RE: [PATCH net-next 08/12] r8152: support TSO

2014-03-04 Thread David Laight
From: Eric Dumazet On Tue, 2014-03-04 at 14:35 +, David Laight wrote: Does that mean you are splitting the 64k 'ethernet packet' from TCP is software? I've looked at the ax88179 where the hardware can do it. Is there really a gain doing segmentation here if you have to do

RE: [PATCH] phy: fix compiler array bounds warning on settings[]

2014-03-05 Thread David Laight
From: Bjorn Helgaas With -Werror=array-bounds, gcc v4.7.x warns that in phy_find_valid(), the settings[] array subscript is above array bounds, I think because idx is a signed integer and if the caller supplied idx 0, we pass the guard but still reference out of bounds. Not rejecting the

RE: [PATCH] phy: fix compiler array bounds warning on settings[]

2014-03-05 Thread David Laight
From: Bjorn Helgaas On Wed, Mar 5, 2014 at 2:10 AM, David Laight david.lai...@aculab.com wrote: From: Bjorn Helgaas With -Werror=array-bounds, gcc v4.7.x warns that in phy_find_valid(), the settings[] array subscript is above array bounds, I think because idx is a signed integer

RE: [PATCH] phy: fix compiler array bounds warning on settings[]

2014-03-06 Thread David Laight
From: Bjorn Helgaas I'm stumped. phy_find_valid() is static and only called from one place. The 'idx' argument is always the result of phy_find_setting(), which should always return something between 0 and ARRAY_SIZE(settings), so I don't see any way idx can be 0. I stripped this down as

RE: [PATCH 3/3] perf: Use 64-bit value when comparing sample_regs

2014-03-06 Thread David Laight
From: Sukadev Bhattiprolu When checking whether a bit representing a register is set in sample_regs, a 64-bit mask, use 64-bit value (1LL). Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com --- tools/perf/util/unwind.c |4 ++-- 1 file changed, 2 insertions(+), 2

RE: [PATCH 2/2] Revert USBNET: ax88179_178a: enable tso if usb host supports sg dma

2014-03-07 Thread David Laight
From: Mathias Nyman This reverts commit 3804fad45411b48233b48003e33a78f290d227c8. This commit, together with commit 247bf557273dd775505fb9240d2d152f4f20d304 xhci 1.0: Limit arbitrarily-aligned scatter gather. were origially added to get xHCI 1.0 hosts and usb ethernet ax88179_178a devices

RE: [PATCH 1/2] Revert xhci 1.0: Limit arbitrarily-aligned scatter gather.

2014-03-07 Thread David Laight
From: Mathias Nyman This reverts commit 247bf557273dd775505fb9240d2d152f4f20d304. You need to revert further. Just don’t set hcd-self.no_sg_constraint ever - since it just doesn't work. That will stop the ax88179_178a driver sending fragmented packets. With the check for aligned non-terminal

RE: [PATCH 2/2] Revert USBNET: ax88179_178a: enable tso if usb host supports sg dma

2014-03-07 Thread David Laight
From: Alan Stern On Fri, 7 Mar 2014, David Laight wrote: From: Mathias Nyman This reverts commit 3804fad45411b48233b48003e33a78f290d227c8. This commit, together with commit 247bf557273dd775505fb9240d2d152f4f20d304 xhci 1.0: Limit arbitrarily-aligned scatter gather. were

RE: [PATCH 1/2] Revert xhci 1.0: Limit arbitrarily-aligned scatter gather.

2014-03-07 Thread David Laight
From: Alan Stern On Fri, 7 Mar 2014, David Laight wrote: From: Mathias Nyman This reverts commit 247bf557273dd775505fb9240d2d152f4f20d304. You need to revert further. Just don?t set hcd-self.no_sg_constraint ever - since it just doesn't work. No; it does work most of the time

RE: [PATCH 2/2] Revert USBNET: ax88179_178a: enable tso if usb host supports sg dma

2014-03-07 Thread David Laight
From: On Fri, 7 Mar 2014, David Laight wrote: From: Alan Stern On Fri, 7 Mar 2014, David Laight wrote: From: Mathias Nyman This reverts commit 3804fad45411b48233b48003e33a78f290d227c8. This commit, together with commit 247bf557273dd775505fb9240d2d152f4f20d304

RE: rfc: checkpatch logical line continuations (was IBM Akebono: Add support for a new PHY interface to the IBM emac driver)

2014-03-10 Thread David Laight
From: j...@joshtriplett.org On Fri, Mar 07, 2014 at 01:02:44PM -0800, Joe Perches wrote: On Fri, 2014-03-07 at 15:41 -0500, David Miller wrote: From: Alistair Popple alist...@popple.id.au Date: Thu, 6 Mar 2014 14:52:25 +1100 + out_be32(dev-reg, in_be32(dev-reg) |

RE: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-11 Thread David Laight
From: David Miller From: Linus Torvalds torva...@linux-foundation.org Date: Mon, 10 Mar 2014 19:02:18 -0700 I would generally suggest that people only use bool for function return types, and absolutely nothing else. Seriously. I think it makes sense for function arguments too. 'bool'

RE: [PATCH RFC] netfilter: cacheline aligning in struct netns_ct

2014-03-12 Thread David Laight
From: Zhouyi Zhou not frequently changing components should share same cachelines Signed-off-by: Zhouyi Zhou yizhouz...@ict.ac.cn --- include/net/netns/conntrack.h | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/net/netns/conntrack.h

RE: [PATCH -next] qlcnic: fix compiler warning

2014-01-10 Thread David Laight
From: Shahed Shaikh Adding netdev. -Original Message- From: Martin Kaiser,,, [mailto:mar...@reykholt.kaiser.cx] On Behalf Of Martin Kaiser Sent: Thursday, January 09, 2014 9:29 PM To: Himanshu Madhani; Rajesh Borundia Cc: linux-kernel; triv...@kernel.org Subject: [PATCH

RE: [PATCH v2 3/4] net: make tcp_cleanup_rbuf private

2014-01-10 Thread David Laight
From: David Miller ... On Thu, Jan 9, 2014 at 12:26 PM, Neal Cardwell ncardw...@google.com wrote: On Thu, Jan 9, 2014 at 3:16 PM, Dan Williams dan.j.willi...@intel.com wrote: net_dma was the only external user so this can become local to tcp.c again. ... -void

RE: [PATCH 3.12 033/118] usb: xhci: Link TRB must not occur within a USB payload burst

2014-01-10 Thread David Laight
From: walt In the meantime, try this patch, which is something of a long shot. No difference. But I notice the code enables the TRB quirk only if the xhci_version is specifically 0x95. My debug messages claim that xHCI doesn't need link TRB QUIRK so I'm wondering if adding my asmedia

RE: [RFC 00/10] xhci: re-work command queue management

2014-01-13 Thread David Laight
From: Mathias Nyman This is an attempt to re-work and solve the issues in xhci command queue management that Sarah has descibed earlier: Right now, the command management in the xHCI driver is rather ad-hock. Different parts of the driver all submit commands, including interrupt handling

RE: [PATCH 3.12 033/118] usb: xhci: Link TRB must not occur within a USB payload burst [NEW HARDWARE]

2014-01-14 Thread David Laight
From: walt On 01/09/2014 03:50 PM, Sarah Sharp wrote: On Tue, Jan 07, 2014 at 03:57:00PM -0800, walt wrote: I've wondered if my xhci problems might be caused by hardware quirks, and wondering why I seem to be the only one who has this problem. Maybe I could take one for the team by

RE: [RFC 00/10] xhci: re-work command queue management

2014-01-14 Thread David Laight
From: Mathias Nyman ... The fact that you are having to allocate memory ion an ISR ought also to be ringing alarm bells. It did. Other options are as you said to use a 'software command ring'. Either just pre-allocate a full command ring (64 trbs * sizeof(struct xhci_command)), roughly

RE: [PATCH] usbnet: remove generic hard_header_len check

2014-02-13 Thread David Laight
From: Emil Goode int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) { + /* This check is no longer done by usbnet */ + if (skb-len dev-net-hard_header_len) + return 0; + Wouldn't it be better to test against ETH_HLEN, since that is a constant and

RE: [PATCH v2] usbnet: remove generic hard_header_len check

2014-02-13 Thread David Laight
From: Of Emil Goode This patch removes a generic hard_header_len check from the usbnet module that is causing dropped packages under certain circumstances for devices that send rx packets that cross urb boundaries. One example is the AX88772B which occasionally send rx packets that cross

RE: [PATCH RFC] sctp: Update HEARTBEAT timer immediately after user changed HB.interval

2014-02-18 Thread David Laight
+ + /* Update the heartbeat timer immediately. */ + if (!mod_timer(trans-hb_timer, + sctp_transport_timeout(trans))) + sctp_transport_hold(trans); This is causes

RE: [PATCH 1/2 v2] usbnet: fix bad header length bug

2014-02-10 Thread David Laight
From: Oliver Neukum censored. Oh well. But how about merging it with FLAG_MULTI_PACKET? I really don't want to add more flags. There is a point where enough flags make absurd having a common code. We are closing in on that point. Any sub-driver that supports multi-packet either has to use

RE: [PATCH 05/14] net: axienet: Service completion interrupts ASAP

2014-02-12 Thread David Laight
From: Michal Simek From: Peter Crosthwaite peter.crosthwa...@xilinx.com The packet completion interrupts for TX and RX should be serviced before the packets are consumed. This ensures against the degenerate case when a new completion interrupt is raised after the handler has exited but

RE: [PATCH v3] net: netfilter: LLVMLinux: vlais-netfilter

2014-03-19 Thread David Laight
From: beh...@converseincode.com From: Mark Charlebois charl...@gmail.com Replaced non-standard C use of Variable Length Arrays In Structs (VLAIS) in xt_repldata.h with a C99 compliant flexible array member and then calculated offsets to the other struct members. These other members aren't

RE: [PATCH v3] mac80211: LLVMLinux: Remove VLAIS usage from mac80211

2014-03-19 Thread David Laight
From: beh...@converseincode.com Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99 compliant equivalent. This is the original VLAIS struct. struct { struct aead_request req; u8 priv[crypto_aead_reqsize(tfm)]; } aead_req; This

RE: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040

2014-03-20 Thread David Laight
From: Kevin Hao Sent: 20 March 2014 11:48 To: Scott Wood Cc: linuxppc-...@lists.ozlabs.org; Chenhui Zhao; jason@freescale.com; linux-kernel@vger.kernel.org Subject: Re: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040 On Tue, Mar 18, 2014 at 06:18:54PM -0500, Scott Wood

RE: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040

2014-03-21 Thread David Laight
From: Scott Wood [mailto:scottw...@freescale.com] On Thu, 2014-03-20 at 11:59 +, David Laight wrote: I tried to work out what the 'twi, isync' instructions were for (in in_le32()). The best I could come up with was to ensure a synchronous bus-fault. But bus faults are probably only

RE: [RFC] csum experts, csum_replace2() is too expensive

2014-03-21 Thread David Laight
From: Eric Dumazet On Thu, 2014-03-20 at 18:56 -0700, Andi Kleen wrote: Eric Dumazet eric.duma...@gmail.com writes: I saw csum_partial() consuming 1% of cpu cycles in a GRO workload, that is insane... Couldn't it just be the cache miss? Or the fact that we mix 16 bit stores

RE: [PATCH 07/21] netfilter: nf_nat: remove inline marking of EXPORT_SYMBOL functions

2013-05-09 Thread David Laight
EXPORT_SYMBOL and inline directives are contradictory to each other. The patch fixes this inconsistency. ... -inline const struct nf_nat_l4proto * +const struct nf_nat_l4proto * __nf_nat_l4proto_find(u8 family, u8 protonum) { return

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread David Laight
Looks like the ptype_base[] should be per 'dev'? Or just put entries where ptype-dev != null_or_dev on a per-interface list and do two searches? Yes, but then we would have two searches instead of one in fast path. Usually it would be empty - so the search would be very quick!

RE: [PATCH v9 net-next 5/7] net: simple poll/select low latency socket poll

2013-06-05 Thread David Laight
I am a bit uneasy with this one, because an applicatio polling() on one thousand file descriptors using select()/poll(), will call sk_poll_ll() one thousand times. Anything calling poll() on 1000 fds probably has performance issues already! Which is why kevent schemes have been added. At

RE: Scaling problem with a lot of AF_PACKET sockets on different interfaces

2013-06-07 Thread David Laight
I have a Linux router with a lot of interfaces (hundreds or thousands of VLANs) and an application that creates AF_PACKET socket per interface and bind()s sockets to interfaces. ... I noticed that box has strange performance problems with most of the CPU time spent in

  1   2   3   4   5   6   7   8   9   10   >