RE: [net-next 06/16] i40e: Properly cast type for arithmetic

2015-11-25 Thread David Laight
From: Jeff Kirsher > Sent: 25 November 2015 10:47 > On Tue, 2015-11-24 at 16:43 -0800, Joe Perches wrote: > > On Tue, 2015-11-24 at 16:04 -0800, Jeff Kirsher wrote: > > > From: Helin Zhang > > > > > > Pointer of type void * shouldn't be used in arithmetic, which may > > >

RE: [PATCH] sctp: use GFP_USER for user-controlled kmalloc

2015-12-01 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 30 November 2015 16:33 > Dmitry Vyukov reported that the user could trigger a kernel warning by > using a large len value for getsockopt SCTP_GET_LOCAL_ADDRS, as that > value directly affects the value used as a kmalloc() parameter. > > This patch thus

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

2015-11-18 Thread David Laight
From: Will Deacon > Sent: 18 November 2015 10:14 > On Tue, Nov 17, 2015 at 08:17:17PM +0100, Arnd Bergmann wrote: > > On Tuesday 17 November 2015 17:12:37 Will Deacon wrote: > > > On Tue, Nov 17, 2015 at 06:03:40PM +0100, Arnd Bergmann wrote: > > > > On Tuesday 17 November 2015 16:44:53 Will

RE: Add a SOCK_DESTROY operation to close sockets from userspace

2015-11-18 Thread David Laight
From: Maciej Zenczykowski > Sent: 18 November 2015 03:57 > I don't know what the right fix is... > > However, speaking as an end user with laptops on wifi and/or home > gateways on dialup connections where the IP address occasionally (or > constantly) changes, I find it very frustrating that by

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

2015-11-18 Thread David Laight
From: Arnd Bergmann > Sent: 17 November 2015 19:17 > On Tuesday 17 November 2015 17:12:37 Will Deacon wrote: > > On Tue, Nov 17, 2015 at 06:03:40PM +0100, Arnd Bergmann wrote: > > > On Tuesday 17 November 2015 16:44:53 Will Deacon wrote: > > > > > 8< > > > > > Subject: ARM64: make

RE: [PATCH 9/9] netfilter: implement xt_cgroup cgroup2 path match

2015-11-23 Thread David Laight
From: Florian Westphal > Sent: 21 November 2015 16:56 > > +struct xt_cgroup_info_v1 { > > + __u8has_path; > > + __u8has_classid; > > + __u8invert_path; > > + __u8invert_classid; > > + charpath[PATH_MAX]; > > + __u32

RE: What's the benefit of large Rx rings?

2015-11-23 Thread David Laight
From: Yuval Mintz > Sent: 22 November 2015 20:19 > This might be a dumb question, but I recently touched this > and felt like I'm missing something basic - > > NAPI is being scheduled from soft-interrupt contex, and it > has a ~strict quota for handling Rx packets [even though we're > allowing

RE: [PATCH net-next] nfnetlink_queue: enable PID info retrieval

2016-06-10 Thread David Laight
From: Eric Dumazet > Sent: 09 June 2016 22:17 > On Thu, 2016-06-09 at 23:50 +0300, Saeed Mahameed wrote: > > From: Matthew Finlay > > > > diff --git a/net/socket.c b/net/socket.c > > index a1bd161..67de200 100644 > > --- a/net/socket.c > > +++ b/net/socket.c > > @@ -382,6

RE: [PATCH net 4/4] net/mlx4_en: get rid of private net_device_stats

2016-05-26 Thread David Laight
From: Tariq Toukan > Sent: 26 May 2016 10:39 ... > I am aware that clearing the stats structure might be redundant today, > as the function is called only within mlx4_en_open, but we might want to > call the function in other flows in the future. My personal view is that stats should never be

RE: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-22 Thread David Laight
From: Jakub Sitnicki > Sent: 22 June 2016 12:34 ... > > - a = attrs[TCP_METRICS_ATTR_ADDR_IPV4]; > > - if (a) { > > + if ((a = attrs[TCP_METRICS_ATTR_ADDR_IPV4])) { > > Copy the pointer inside the branch? > > Same gain on indentation while keeping checkpatch happy. Or as below (hacked

RE: [PATCH net-next 1/3] net: ipv6: Move ip6_route_get_saddr to inline

2016-06-20 Thread David Laight
From: Behalf Of David Ahern > Sent: 17 June 2016 00:24 > VRF driver needs access to ip6_route_get_saddr code. Since it does > little beyond ipv6_dev_get_saddr and ipv6_dev_get_saddr is already > exported for modules move ip6_route_get_saddr to the header as an > inline. > > Code move only; no

RE: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-21 Thread David Laight
From: Of Phil Sutter > Sent: 21 June 2016 17:19 > By combining the attribute extraction and check for existence, the > additional indentation level in the 'else' clause can be avoided. > > In addition to that, common actions for 'daddr' are combined since the > function returns if neither of the

RE: [PATCH] rtlwifi: use s8 instead of char

2016-06-16 Thread David Laight
From: Arnd Bergmann > On Wednesday, June 15, 2016 5:10:51 PM CEST Jes Sorensen wrote: > > > > Arnd, > > > > rtlwifi and rtl8xxxu are two distinct drivers managed by different > > people. I'd be really nice if you could split this into a per driver > > patch. > > > > That said, the use of char in

RE: [iproute PATCH v3 6/6] misc/ifstat: simplify unsigned value comparison

2016-06-24 Thread David Laight
From: Phil Sutter > Sent: 23 June 2016 18:34 > > By directly comparing the value of both unsigned variables, casting to > signed becomes unnecessary. > > This also fixes for compiling with older versions of gcc (at least > <=3.4.6) which emit the following warning: > > | ifstat.c: In function

RE: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-24 Thread David Laight
From: Phil Sutter > Sent: 23 June 2016 18:34 > > This is v3 of my C99-style initializer related patch series. ... It would be interesting to know how this affect the kernel code size? While gcc will generate a memset() call for 'struct foo = {0}' if you initialise some members it might generate

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

2016-02-10 Thread David Laight
From: George Spelvin > Sent: 10 February 2016 14:44 ... > > I think the fastest loop is: > > 10: adcq0(%rdi,%rcx,8),%rax > > inc %rcx > > jnz 10b > > That loop looks like it will have no overhead on recent cpu. > > Well, it should execute at 1 instruction/cycle. I presume you

RE: [PATCH net-next 1/2] mpls: packet stats

2016-02-08 Thread David Laight
From: Francois Romieu > Sent: 06 February 2016 10:59 > > +void mpls_stats_inc_outucastpkts(struct net_device *dev, > > +const struct sk_buff *skb) > > +{ > > + struct mpls_dev *mdev; > > + struct inet6_dev *in6dev; > > Nit: the scope can be reduced for both

RE: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c

2016-02-04 Thread David Laight
From: Larry Finger > Sent: 03 February 2016 19:45 ... > The performance will depend on where you satisfy the condition. All switch > cases > have the same execution time, but in the if .. else if .. else form, the > earlier > tests execute more quickly. I'm not sure that one can make any blanket

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

2016-02-04 Thread David Laight
From: Tom Herbert > Sent: 03 February 2016 19:19 ... > + /* Main loop */ > +50: adcq0*8(%rdi),%rax > + adcq1*8(%rdi),%rax > + adcq2*8(%rdi),%rax > + adcq3*8(%rdi),%rax > + adcq4*8(%rdi),%rax > + adcq5*8(%rdi),%rax > + adcq6*8(%rdi),%rax > +

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

2016-02-09 Thread David Laight
From: George Spelvin [mailto:li...@horizon.com] > Sent: 08 February 2016 20:13 > David Laight wrote: > > I'd need convincing that unrolling the loop like that gives any significant > > gain. > > You have a dependency chain on the carry flag so have delays between the >

RE: [PATCH] net: ti: netcp: restore get/set_pad_info() functionality

2016-02-09 Thread David Laight
From: Grygorii Strashko > Sent: 09 February 2016 13:58 > From: Arnd Bergmann > > The commit 899077791403 ("netcp: try to reduce type confusion in descriptors") > introduces a regression in Kernel 4.5-rc1 and it breaks > get/set_pad_info() functionality. > > The TI NETCP driver

RE: [PATCH] net: ti: netcp: restore get/set_pad_info() functionality

2016-02-09 Thread David Laight
From: Karicheri, Muralidharan > Sent: 09 February 2016 16:10 ... > >In reality the 'pad' fields ought to be renamed - since they aren't pads. > >Perhaps they should be a union? > No. At the end of the descriptor, host software can add scratchpad which is > not modified by the hardware, but is

RE: [PATCH] net: ti: netcp: restore get/set_pad_info() functionality

2016-02-09 Thread David Laight
From: Karicheri, Muralidharan > Sent: 09 February 2016 16:19 > >... > >> >In reality the 'pad' fields ought to be renamed - since they aren't pads. > >> >Perhaps they should be a union? > > > >> No. At the end of the descriptor, host software can add scratchpad > >> which is not modified by the

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

2016-02-04 Thread David Laight
From: Tom Herbert ... > > If nothing else reducing the size of this main loop may be desirable. > > I know the newer x86 is supposed to have a loop buffer so that it can > > basically loop on already decoded instructions. Normally it is only > > something like 64 or 128 bytes in size though. You

RE: [PATCH v2 2/4] lib: update single-char callers of strtobool

2016-02-05 Thread David Laight
From: Kees Cook > Sent: 04 February 2016 21:01 > Some callers of strtobool were passing a pointer to unterminated strings. > In preparation of adding multi-character processing to kstrtobool, update > the callers to not pass single-character pointers, and switch to using the > new

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

2016-02-05 Thread David Laight
From: Ingo Molnar ... > As Linus noticed, data lookup tables are the intelligent solution: if you > manage > to offload the logic into arithmetics and not affect the control flow then > that's > a big win. The inherent branching will be hidden by executing on massively > parallel arithmetics

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

2016-02-10 Thread David Laight
From: George Spelvin > Sent: 10 February 2016 00:54 > To: David Laight; linux-ker...@vger.kernel.org; li...@horizon.com; > netdev@vger.kernel.org; > David Laight wrote: > > Since adcx and adox must execute in parallel I clearly need to re-remember > > how dependencies ag

RE: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c

2016-02-04 Thread David Laight
From: Larry Finger > Sent: 04 February 2016 15:44 > On 02/04/2016 03:48 AM, David Laight wrote: > > From: Larry Finger > >> Sent: 03 February 2016 19:45 > > ... > >> The performance will depend on where you satisfy the condition. All switch > >

RE: [RFC PATCH net-next 0/3] sctp: add GSO support

2016-01-29 Thread David Laight
From: 'Marcelo Ricardo Leitner' > Sent: 28 January 2016 20:56 > On Thu, Jan 28, 2016 at 05:30:24PM +, David Laight wrote: > > From: 'Marcelo Ricardo Leitner' > > > Sent: 28 January 2016 15:53 > > > On Thu, Jan 28, 2016 at 01:51:02PM +, David Laight wrote: .

RE: [RFC PATCH net-next 0/3] sctp: add GSO support

2016-01-29 Thread David Laight
> From: 'Marcelo Ricardo Leitner' [mailto:marcelo.leit...@gmail.com] > Sent: 28 January 2016 20:56 ... > > > But yes, agreed, MSG_MORE is at least a welcomed compliment here, > > > specially for applications generating a train of chunks. Will put that in > > > my ToDo here, thanks. > > > > I've

RE: [RFC PATCH net-next 0/3] sctp: add GSO support

2016-01-29 Thread David Laight
From: 'Marcelo Ricardo Leitner' > Sent: 28 January 2016 20:56 ... > > > > I did wonder whether the queued data could actually be picked up > > > > be a Heartbeat chunk that is probing a different remote address > > > > (which would be bad news). > > > > > > I don't follow. You mean if a heartbeat

RE: [PATCH 4/9] net: moxart: use correct accessors for DMA memory

2016-01-28 Thread David Laight
From: Arnd Bergmann > Sent: 27 January 2016 14:05 > The moxart ethernet driver confuses coherent DMA buffers with > MMIO registers. > > moxart_ether.c: In function 'moxart_mac_setup_desc_ring': > moxart_ether.c:146:428: error: passing argument 1 of '__fswab32' makes > integer from pointer

RE: [PATCH 3/4] netfilter: ipv4: use preferred kernel types

2016-02-01 Thread David Laight
From: Lucas Tanure > Sent: 30 January 2016 13:18 > As suggested by checkpatch.pl: > CHECK: Prefer kernel type 'uX' over 'uintX_t' One might ask why? The kernel types are older, but the uintX_t ones are now part of the C standard. Writing header files (eg for ioctl buffers) that have to be parsed

RE: [PATCH net-next] netfilter: nf_conntrack: remove the unneed check for *bucket

2016-02-01 Thread David Laight
From: Florian Westphal > Sent: 30 January 2016 21:30 > Weidong Wang wrote: > > In the 'for(...) {}', the *bucket alwasy < net->ct.htable_size, > > so remove the check > > @@ -1383,14 +1383,12 @@ get_next_corpse(struct net *net, int (*iter)(struct > > nf_conn *i, void

RE: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-02-01 Thread David Laight
From: David Miller > Sent: 31 January 2016 03:45 > To: alexander.du...@gmail.com ... > > I would really prefer to keep the pages DMA aligned, and the skb->data > > IP aligned. If nothing else it has the advantage of actually having > > the proper alignment on all the headers if I only pull the

RE: [PATCH v2] unix: properly account for FDs passed over unix sockets

2016-02-03 Thread David Laight
From: Linus Torvalds > Sent: 02 February 2016 20:45 > On Tue, Feb 2, 2016 at 12:32 PM, Hannes Frederic Sowa > wrote: > > > > Unfortunately we never transfer a scm_cookie via the skbs but merely use it > > to initialize unix_skb_parms structure in skb->cb and destroy it

RE: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c

2016-02-03 Thread David Laight
From: Byeoungwook Kim > Sent: 03 February 2016 02:00 > Conditional codes in rtl_addr_delay() were improved in readability and > performance by using switch codes. I'd like to see the performance data :-) > diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c >

RE: [RFC PATCH net-next 0/3] sctp: add GSO support

2016-01-28 Thread David Laight
From: 'Marcelo Ricardo Leitner' > Sent: 28 January 2016 15:53 > On Thu, Jan 28, 2016 at 01:51:02PM +, David Laight wrote: > > From: Marcelo Ricardo Leitner > > > Sent: 27 January 2016 17:07 > > > This patchset is merely a RFC for the moment. There are some >

RE: [net PATCH] flow_dissector: Fix unaligned access in __skb_flow_dissector when used by eth_get_headlen

2016-02-02 Thread David Laight
From: Alexander Duyck > Sent: 01 February 2016 18:18 > >> 1) Unaligned accesses > > > > Remember the even if you do a 'realignment copy' of the IP header, > > at some point the 'userdata' of the packet has to be accessed. > > Mostly this will be with memcpy() and you want that copy to be aligned.

RE: [PATCH v2 6/6] net: pch_gbe: Allow longer for resets

2016-02-03 Thread David Laight
From: Paul Burton > Sent: 03 February 2016 12:03 > Resets of the EG20T MAC on the MIPS Boston development board take longer > than the 1000 loops that pch_gbe_wait_clr_bit was performing. Bump up > the number of loops. ... > diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c >

RE: [PATCH v3] net:Add sysctl_max_skb_frags

2016-02-03 Thread David Laight
From: Herbert Xu > Sent: 03 February 2016 12:21 > On Wed, Feb 03, 2016 at 12:36:21PM +0100, Hannes Frederic Sowa wrote: > > > > Agreed that it feels like a hack, but a rather simple one. I would > > consider this to be just a performance improvement. We certainly need > > a slow-path when virtio

RE: [RFC PATCH net-next 0/3] sctp: add GSO support

2016-01-28 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 27 January 2016 17:07 > This patchset is merely a RFC for the moment. There are some > controversial points that I'd like to discuss before actually proposing > the patches. You also need to look at how a 'user' can actually get SCTP to merge data chunks in

RE: [PATCH 2/2] net, thunderx: Use bool in structs where possible

2016-02-22 Thread David Laight
From: Robert Richter > Sent: 18 February 2016 12:39 > From: Robert Richter > > Looks like the :1 notation was accidentally introduced (this still > uses 1 byte per flag). Using bool instead, which is the common use. > > Signed-off-by: Robert Richter >

RE: [net-next 13/15] i40e/i40evf: use logical operators, not bitwise

2016-02-22 Thread David Laight
From: Joe Perches > Sent: 18 February 2016 04:59 > On Wed, 2016-02-17 at 19:38 -0800, Jeff Kirsher wrote: > > From: Mitch Williams > > > > Mr. Spock would certainly raise an eyebrow to see us using bitwise > > operators, when we should clearly be relying on logic.

RE: [PATCH net] ppp: lock ppp->flags in ppp_read() and ppp_poll()

2016-02-29 Thread David Laight
From: Guillaume Nault > Sent: 26 February 2016 17:46 > > ppp_read() and ppp_poll() can be called concurrently with ppp_ioctl(). > In this case, ppp_ioctl() might call ppp_ccp_closed(), which may update > ppp->flags while ppp_read() or ppp_poll() is reading it. > The update done by

RE: [net-next PATCH 0/2] GENEVE/VXLAN: Enable outer Tx checksum by default

2016-02-24 Thread David Laight
From: David Miller > Sent: 23 February 2016 18:25 > > From: Jesse Gross > Date: Tue, 23 Feb 2016 09:31:09 -0800 > > > Most OSs (including Linux with connected TCP sockets) use non-zero IP > > IDs so requiring this would effectively disable GRO. > > +1 > > Any OS that wants

RE: [RFC] Kernel unaligned access at __skb_flow_dissect

2016-02-01 Thread David Laight
From: Eric Dumazet > Sent: 29 January 2016 22:29 ... > On modern intel cpus, this does not matter at all, sure. It took a while > before "rep movsb" finally did the right thing. Unfortunately memcpy_to_io() etc now map to 'rep movsb', and that can only be optimisied for cached addresses. So

RE: [ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-14 Thread David Laight
> > + /* ignore optional '0x' prefix */ > > + if ((slen > 2) && ( Unnecessary (). > > + (0 == memcmp(s, "0x", 2) > > +  || (0 == memcmp(s, "0X", 2) { A-about-F comparisons. > memcmp() is a really poor tool for comparing strings.  You should use >

RE: [PATCH] af_unix: closed SOCK_SEQPACKET socketpair must get SIGPIPE

2016-03-15 Thread David Laight
From: Alexander Potapenko > Sent: 15 March 2016 09:04 > According to IEEE Std 1003.1, 2013, sending data to a SOCK_SEQPACKET > socketpair with MSG_NOSIGNAL flag set must result in a SIGPIPE if the > socket is no longer connected. ... > Without the below patch the behavior is as follows: > > $

RE: [net-next PATCH] csum: Update csum_block_add to use rotate instead of byteswap

2016-03-09 Thread David Laight
From: Joe Perches > Sent: 08 March 2016 23:26 ... > > + > > + if (offset & 1) > > + sum = (sum << 24) + (sum >> 8); > > Maybe use ror32(sum, 8); > > or maybe something like: > > { > u32 sum; > > /* rotated csum2 of odd offset will be the right checksum */ > if

RE: [PATCH] mwifiex: add __GFP_REPEAT to skb allocation call

2016-04-05 Thread David Laight
From: Amitkumar Karwar > Sent: 05 April 2016 06:48 ... > Our one time allocated 64k buffer read from firmware contains multiple data > chunks. We have a feature > called single port aggregation in which firmware attaches an aggregated > buffer to single port. So > sometimes a single data chunk

RE: [PATCH net-next 1/3] net: bcmgenet: cleanup for bcmgenet_xmit()

2016-04-06 Thread David Laight
From: Petri Gynther > Sent: 05 April 2016 01:10 ... > 2. Readability: Add parentheses around nr_frags + 1. ... > - if (ring->free_bds <= nr_frags + 1) { ... > + if (ring->free_bds <= (nr_frags + 1)) { The extra () are not needed and do not improve readability. David

RE: [patch iproute2 v2 1/2] include: add linked list implementation from kernel

2016-03-23 Thread David Laight
From: Jiri Pirko > Sent: 22 March 2016 09:02 > Rename hlist.h to list.h while adding it to be aligned with kernel ... > include/hlist.h | 56 > include/list.h | 112 > I'm not sure where this gets installed,

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

2016-03-08 Thread David Laight
From: Alexander Duyck ... > One thought I had is that we may want to look into making an inline > function that we can call for compile-time defined lengths less than > 64. Maybe call it something like __csum_partial and we could then use > that in place of csum_partial for all those headers

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

2016-03-08 Thread David Laight
From: Alexander Duyck ... > >> So the loop: > >> 10: addc %rax,(%rdx,%rcx,8) > >> inc %rcx > >> jnz 10b > >> could easily be as fast as anything that doesn't use the 'new' > >> instructions that use the overflow flag. > >> That loop might be measurable faster for aligned

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

2016-03-04 Thread David Laight
From: Linus Torvalds > Sent: 03 March 2016 18:44 > > On Thu, Mar 3, 2016 at 8:12 AM, David Laight <david.lai...@aculab.com> wrote: > > > > Did you try the asm loop that used 'leax %rcx..., jcxz... jmps..' > > without any unrolling? > > Is that actually su

RE: [PATCH V3 2/4] net-next: mediatek: add support for MT7623 ethernet

2016-03-04 Thread David Laight
From: John Crispin > Sent: 03 March 2016 20:03 ... > +/* ugly macro hack to make sure hw_stats and ethtool strings are consistent > */ > +#define MTK_STAT_REG_DECLARE \ > + _FE(tx_bytes) \ > + _FE(tx_packets) \ > + _FE(tx_skip)

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

2016-03-03 Thread David Laight
From: Tom Herbert > Sent: 02 March 2016 22:19 ... > + /* Main loop using 64byte blocks */ > + for (; len > 64; len -= 64, buff += 64) { > + asm("addq 0*8(%[src]),%[res]\n\t" > + "adcq 1*8(%[src]),%[res]\n\t" > + "adcq 2*8(%[src]),%[res]\n\t" > +

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

2016-03-07 Thread David Laight
From: Alexander Duyck ... > Actually probably the easiest way to go on x86 is to just replace the > use of len with (len >> 6) and use decl or incl instead of addl or > subl, and lea instead of addq for the buff address. None of those > instructions effect the carry flag as this is how such

RE: [PATCH] sctp: avoid refreshing heartbeat timer too often

2016-03-30 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 29 March 2016 14:42 > > Currently on high rate SCTP streams the heartbeat timer refresh can > consume quite a lot of resources as timer updates are costly and it > contains a random factor, which a) is also costly and b) invalidates > mod_timer() optimization

RE: [PATCH] sctp: avoid refreshing heartbeat timer too often

2016-03-31 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 30 March 2016 13:13 > Em 30-03-2016 06:37, David Laight escreveu: > > From: Marcelo Ricardo Leitner > >> Sent: 29 March 2016 14:42 > >> > >> Currently on high rate SCTP streams the heartbeat timer refresh can > &g

RE: [PATCH v2 0/2] pegasus: correct buffer sizes

2016-04-27 Thread David Laight
From: Johannes Berg > Sent: 27 April 2016 10:44 > On Wed, 2016-04-27 at 12:33 +0300, Petko Manolov wrote: > > > > Your guess turned out to be not so wild.;)All Pegasus devices are > > configured (by the driver) to append CRC at the end of each RX > > packet.However, the driver reports packet

RE: [net-next PATCH V2 2/5] samples/bpf: Makefile verify LLVM compiler avail and bpf target is supported

2016-04-27 Thread David Laight
From: Jesper Dangaard Brouer > Sent: 26 April 2016 17:27 > Make compiling samples/bpf more user friendly, by detecting if LLVM > compiler tool 'llc' is available, and also detect if the 'bpf' target > is available in this version of LLVM. ... > diff --git a/samples/bpf/Makefile

RE: [net-next PATCH 4/4] samples/bpf: allow make to be run from samples/bpf/ directory

2016-04-27 Thread David Laight
From: Alexei Starovoitov > Sent: 26 April 2016 15:35 > On Tue, Apr 26, 2016 at 01:09:32PM +0200, Jesper Dangaard Brouer wrote: > > It is not intuitive that 'make' must be run from the top level > > directory with argument "samples/bpf/" to compile these eBPF samples. > > > > Introduce a kbuild

RE: [PATCH net-next 02/12] net/mlx5e: Statistics handling refactoring

2016-04-25 Thread David Laight
From: Saeed Mahameed > Sent: 22 April 2016 20:01 > Redesign the statistics in the driver: > 1. Move counters to a separate file (en_stats.h). > 2. Remove unnecessary dependencies between stats and strings. > 3. Use counter descriptors which hold a name and offset for each counter, >and will be

RE: [PATCH 1/1] net: hns: avoid null pointer dereference

2016-05-19 Thread David Laight
From: Heinrich Schuchardt > Sent: 17 May 2016 21:01 > In the statement > assert(priv || priv->ae_handle); > the right side of || is only evaluated if priv is null. > > Signed-off-by: Heinrich Schuchardt > --- > drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 8

RE: [RFC] net: remove busylock

2016-05-24 Thread David Laight
From: Jesper Dangaard Brouer > Sent: 20 May 2016 18:50 ... > If would be cool if you could run a test with removed busylock and > allow HTB to bulk dequeue. (Without having looked ) Could you have two queues and separate queue and dequeue locks. The enqueue code would acquire the enqueue

RE: [PATCH -next v2 3/4] net: w5100: increase TX timeout period

2016-05-16 Thread David Laight
From: netdev-ow...@vger.kernel.org Akinobu Mita > Sent: 14 May 2016 06:56 > This increases TX timeout period from one second to 5 seconds which is > the default value if the driver doesn't explicitly set > net_device->watchdog_timeo. > > The one second timeout is too short for W5100 with SPI

RE: [PATCH 2/2] mac80211_hwsim: Allow managing radios from non-initial namespaces

2016-05-05 Thread David Laight
From: Martin Willi > Sent: 03 May 2016 07:53 > While wiphys can be moved into network namespaces over nl80211, the > creation and removal of hwsim radios is currently limited to the initial > namespace. This patch allows management of namespaced radios from the > owning namespace by setting

RE: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations

2016-05-10 Thread David Laight
From: Ben Hutchings > Sent: 09 May 2016 01:17 > On Sun, 2016-05-08 at 13:55 -0700, Shrikrishna Khare wrote: > > > > On Sat, 7 May 2016, Ben Hutchings wrote: > > > > > On Fri, 2016-05-06 at 16:12 -0700, Shrikrishna Khare wrote: > > > [...] > > > > +static int > > > > +vmxnet3_set_coalesce(struct

RE: [patch net-next 05/18] mlxsw: spectrum_buffers: Push out indexes and direction out of SB structs

2016-04-15 Thread David Laight
From: Jiri Pirko > Sent: 15 April 2016 09:53 .. > >> @@ -106,10 +96,9 @@ static int mlxsw_sp_port_pb_init(struct mlxsw_sp_port > >> *mlxsw_sp_port) > >>mlxsw_reg_pbmc_pack(pbmc_pl, mlxsw_sp_port->local_port, > >>0x, 0x / 2); > >>for (i = 0; i <

RE: [PATCH nf] netfilter: ipv6: Orphan skbs in nf_ct_frag6_gather()

2016-04-14 Thread David Laight
From: Joe Stringer > Sent: 13 April 2016 19:10 > This is the IPv6 equivalent of commit 8282f27449bf ("inet: frag: Always > orphan skbs inside ip_defrag()"). > > Prior to commit 029f7f3b8701 ("netfilter: ipv6: nf_defrag: avoid/free > clone operations"), ipv6 fragments sent to nf_ct_frag6_gather()

RE: [patch net-next 05/18] mlxsw: spectrum_buffers: Push out indexes and direction out of SB structs

2016-04-15 Thread David Laight
From: Jiri Pirko > Sent: 14 April 2016 17:19 > From: Jiri Pirko > > Structs are in arrays so use array index as pool/tc/prio index. With > that, there is need to maintain separate arrays for ingress and egress. ... > +static const u16 mlxsw_sp_pbs[] = { > + 2 *

RE: [RFC PATCH v2 net-next 4/7] tcp: Make use of MSG_EOR flag in tcp_sendmsg

2016-04-19 Thread David Laight
From: Eric Dumazet > Sent: 19 April 2016 00:18 ... > MSG_EOR should not depend on SKBTX_ANY_TSTAMP > > Really, simply using send(fd, ..., len, MSG_EOR) should instruct TCP to > mark the cooked skb as a non candidate for future coalescing. Isn't that very similar to the inverse of MSG_MORE? Or a

RE: [v3] UCC_GETH/UCC_FAST: Use IS_ERR_VALUE_U32 API to avoid IS_ERR_VALUE abuses.

2016-07-26 Thread David Laight
From: Arvind Yadav > Sent: 23 July 2016 19:06 > IS_ERR_VALUE() assumes that its parameter is an unsigned long. > It can not be used to check if an 'unsigned int' reflects an error. > As they pass an 'unsigned int' into a function that takes an > 'unsigned long' argument. This happens to work

RE: [PATCH net-next 2/3] bna: change type of bna_id to atomic_t

2016-08-01 Thread David Laight
From: Ivan Vecera > Sent: 29 July 2016 18:53 > Change type of bna_id to atomic_t. The bnad_list_mutex is used to prevent > a race when bna_id is incremented. After the change the mutex can be > removed in the next step. ... > -static u32 bna_id; > +static atomic_t bna_id; ... >

RE: [PATCH 0071/1285] Replace numeric parameter like 0444 with macro

2016-08-03 Thread David Laight
From: Baole Ni > Sent: 02 August 2016 11:39 > I find that the developers often just specified the numeric value > when calling a macro which is defined with a parameter for access permission. > As we know, these numeric value for access permission have had the > corresponding macro, > and that

RE: [PATCH v2 1/3] sctp: Export struct sctp_info to userspace

2016-08-04 Thread David Laight
From: Phil Sutter > Sent: 03 August 2016 22:23 > This is required to correctly interpret INET_DIAG_INFO messages exported > by sctp_diag module. ... > diff --git a/include/linux/sctp.h b/include/linux/sctp.h > index de1f64318fc4e..fcb4c36461732 100644 > --- a/include/linux/sctp.h > +++

RE: [PATCH net-next v2 07/10] net/faraday: Read MAC address from chip

2016-07-19 Thread David Laight
From: Gavin Shan > Sent: 15 July 2016 11:44 > The device is assigned with random MAC address. It isn't reasonable. > An valid MAC address might have been provided by (uboot) firmware by > device-tree or in chip. It's reasonable to use it to maintain consistency. > > This uses the MAC address from

RE: [PATCH] rndis_host: Set random MAC for ZTE MF910

2016-07-15 Thread David Laight
From: Bjørn Mork > Sent: 13 July 2016 23:23 ... > Or how about the more generic?: > > if (bp[0] & 0x02) > eth_hw_addr_random(net); > else > ether_addr_copy(net->dev_addr, bp); > > That would catch similar screwups from other vendors too. Not really,

RE: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-13 Thread David Laight
From: Brenden Blanco > Sent: 12 July 2016 08:51 > Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver. > > In tc/socket bpf programs, helpers linearize skb fragments as needed > when the program touches the packet data. However, in the pursuit of > speed, XDP programs will not be allowed to

RE: [PATCH ethtool] ethtool.c: fix memory leaks

2016-06-27 Thread David Laight
From: Ivan Vecera > Sent: 27 June 2016 10:41 > On 26.6.2016 10:59, Ben Hutchings wrote: > > On Fri, 2016-03-18 at 13:24 +0100, Ivan Vecera wrote: > >> Memory allocated at several places is not appropriately freed. > > > > Given that ethtool is not a library or a long-running application - why > >

RE: [PATCHv3 wl-drv-next 1/2] add basic register-field manipulation macros

2016-07-05 Thread David Laight
From: Jakub Kicinski > Sent: 01 July 2016 22:27 > > C bitfields are problematic and best avoided. Developers > interacting with hardware registers find themselves searching > for easy-to-use alternatives. Common approach is to define > structures or sets of macros containing mask and shift

RE: [PATCH v2 1/2] libxt_hashlimit: Prepare libxt_hashlimit.c for revision 2

2016-07-08 Thread David Laight
From: Vishwanath Pai > Sent: 08 July 2016 00:34 > I am planning to add a revision 2 for the hashlimit xtables module to > support higher packets per second rates. This patch renames all the > functions and variables related to revision 1 by adding _v1 at the end of > the names. Sounds backwards.

RE: [PATCH 06/26] netfilter: conntrack: align nf_conn on cacheline boundary

2016-07-06 Thread David Laight
From: Pablo Neira Ayuso > Sent: 06 July 2016 15:24 > From: Florian Westphal > > increases struct size by 32 bytes (288 -> 320), but it is the right thing, > else any attempt to (re-)arrange nf_conn members by cacheline won't work. ... > nf_conntrack_cachep =

RE: [PATCH] Add support for configuring Infiniband GUIDs

2016-07-07 Thread David Laight
From: Stephen Hemminger > Sent: 07 July 2016 05:05 > On Tue, 5 Jul 2016 10:53:38 -0500 > Eli Cohen wrote: > > > > > +static int extract_guid(__u64 *guid, char *arg) > > +{ > > + __u64 ret; > > + int g[8]; > > + int err; > > + > > + err = sscanf(arg,

RE: [PATCH] Need proper type casting before assignment, Remove compilation Warning.

2016-07-08 Thread David Laight
From: Arvind Yadav > Sent: 07 July 2016 19:38 > -Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying to > assigned in ucc_fast_tx_virtual_fifo_base_offset and > ucc_fast_rx_virtual_fifo_base_offset. These variable are 'unsigned int'. > So before assginment need a proper type

RE: [v5.1] ucc_fast: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-05 Thread David Laight
From: Arvind Yadav > Sent: 04 August 2016 17:53 > IS_ERR_VALUE() assumes that parameter is an unsigned long. > It can not be used to check if 'unsigned int' is passed insted. > Which tends to reflect an error. > In 64bit architectures sizeof (int) == 4 && sizeof (long) == 8. > IS_ERR_VALUE(x) is

RE: [5.3] ucc_geth: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-08 Thread David Laight
From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On Behalf Of Arvind Yadav > IS_ERR_VALUE() assumes that parameter is an unsigned long. > It can not be used to check if 'unsigned int' is passed insted. > Which tends to reflect an error. > In 64bit architectures sizeof

RE: [5.3] ucc_geth: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-08 Thread David Laight
From: Arnd Bergmann > Sent: 08 August 2016 16:13 > > On Monday, August 8, 2016 2:49:11 PM CEST David Laight wrote: > > > > > If qe_muram_alloc will return any error, Then IS_ERR_VALUE will always > > > return 0. it'll not call ucc_fast_free for any failure. Insi

RE: [patch iproute2 1/2] devlink: write usage help messages to stderr

2016-08-09 Thread David Laight
From: Stephen Hemminger > Sent: 08 August 2016 16:57 > To: Jiri Pirko ... > > >> In order to not confuse reader, write help messages into stderr. > > >> > > >> Signed-off-by: Jiri Pirko > > > > > >This does make devlink consistent with other parts of iproute2. > > >But the most

RE: [net-next 02/16] i40e: add hw struct local variable

2016-06-29 Thread David Laight
From: Jeff Kirsher > Sent: 29 June 2016 05:41 > From: Mitch Williams > > This function uses the i40e_hw struct all over the place, so why doesn't > it keep a pointer to the struct? Add this pointer as a local variable > and use it consistently throughout the function.

RE: [PATCH 2/3] vsockmon: Add vsockmon device.

2016-08-15 Thread David Laight
From: Stefan Hajnoczi > Sent: 10 August 2016 12:52 > On Mon, Aug 08, 2016 at 06:14:41PM +0200, ggar...@abra.uab.cat wrote: > > diff --git a/include/uapi/linux/vsockmon.h b/include/uapi/linux/vsockmon.h > > new file mode 100644 > > index 000..739b4bf > > --- /dev/null > > +++

RE: [PATCH net] sctp: fix a success return may hide an error

2016-08-16 Thread David Laight
From: Xin Long > Sent: 13 August 2016 08:48 > > > > This style of error handling is dangerous. The first error can be > > lost. > > > > For example, if sctp_outq_flush_rtx() earlier in this function returns > > an error, it will be lost if any invocation of the function > > sctp_packet_transmit()

RE: [PATCH net-next v2 2/2] qede: Add driver support for PTP.

2017-01-31 Thread David Laight
From: Mintz, Yuval > Sent: 30 January 2017 17:56 > > How many different implementations of 'ops->adjfreq' are there? > > If there is only one you don't need an indirect call. > > There's only one implementation. But qed publishes its functions to > qede [and other modules] by structs of

sock_create_kern() and network namespace reference counts

2017-01-31 Thread David Laight
Commit 26abe1437 changed sock_create_kern() so that it stopped holding a reference to the network namespace. The rational seemed to be 'to allow to stop it' (presumably 'be deleted'). Prior to this change some kernel paths used sk_change_net() (etc) to change the namespace after the socket was

RE: [net-next 2/8] net/mlx5: Configure cache line size for start and end padding

2017-02-01 Thread David Laight
From: Saeed Mahameed > Sent: 31 January 2017 20:59 > From: Daniel Jurgens > > There is a hardware feature that will pad the start or end of a DMA to > be cache line aligned to avoid RMWs on the last cache line. The default > cache line size setting for this feature is 64B.

RE: [net-next 1/8] net/mlx5: Fixed static checker warnings

2017-02-01 Thread David Laight
From: Saeed Mahameed > Sent: 31 January 2017 20:59 > From: Or Gerlitz > > For some reason, sparse doesn't like using an expression of type (!x) > with a bitwise | and &. In order to mitigate that, we use a local > variable. > > Since getting a typeof(bitfield) is

RE: [net-next 5/8] net/mlx5e: Calc vlan_tag_present only once on xmit

2017-02-01 Thread David Laight
From: Saeed Mahameed > Sent: 31 January 2017 20:59 > Cache skb_vlan_tag_present(skb) and pass it wherever needed in xmit > routines. ... Does this actually generate better code? It is quite likely that your 'vlan_present' variable ends up being on stack. Whereas the 'skb' is likely to be in a

RE: [PATCH net-next 5/6] drivers: net: xgene-v2: Add transmit and receive

2017-02-01 Thread David Laight
From Florian Fainelli > Sent: 31 January 2017 20:33 > On 01/31/2017 11:03 AM, Iyappan Subramanian wrote: > > This patch adds, > > - Transmit > > - Transmit completion poll > > - Receive poll > > - NAPI handler > > > > and enables the driver. > > > > Signed-off-by: Iyappan

<    1   2   3   4   5   6   7   >