RE: sock_create_kern() and network namespace reference counts

2017-01-31 Thread David Laight
From: Cong Wang > Sent: 31 January 2017 17:38 > On Tue, Jan 31, 2017 at 7:41 AM, David Laight <david.lai...@aculab.com> wrote: > > Commit 26abe1437 changed sock_create_kern() so that it stopped > > holding a reference to the network namespace. > > The rational

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

2017-02-01 Thread David Laight
From: Or Gerlitz > Sent: 01 February 2017 16:40 > On Wed, Feb 1, 2017 at 1:17 PM, David Laight <david.lai...@aculab.com> wrote: > > From: Saeed Mahameed > >> Sent: 31 January 2017 20:59 > >> From: Or Gerlitz <ogerl...@mellanox.com> > >> > >&

RE: sock_create_kern() and network namespace reference counts

2017-02-01 Thread David Laight
From: Cong Wang > Sent: 01 February 2017 17:20 > On Tue, Jan 31, 2017 at 9:57 AM, David Laight <david.lai...@aculab.com> wrote: > > From: Cong Wang > >> Sent: 31 January 2017 17:38 > >> On Tue, Jan 31, 2017 at 7:41 AM, David Laight <david.lai...@aculab.co

RE: [PATCH net-next 6/8] net: ethernet: annapurna: add wol helpers to the Alpine driver

2017-02-06 Thread David Laight
From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On Behalf Of Sergei Shtylyov > Sent: 03 February 2017 18:22 > On 02/03/2017 09:12 PM, Antoine Tenart wrote: > > > Implement the get_wol() and set_wol() helpers in the Annapurna Labs > > Alpine Ethernet driver. > > --- > >

RE: [PATCHv2 net-next 05/16] net: mvpp2: introduce PPv2.2 HW descriptors and adapt accessors

2017-02-06 Thread David Laight
From: Thomas Petazzoni > Sent: 04 February 2017 14:00 ... > This makes complete sense. We use the cookie to store the phys_addr_t > rather than the virtual address. I might be missing something, but it > seems like a very good solution. Thanks for the suggestion, I'll try > this! Why not just

RE: [PATCH net 1/4] pegasus: Use heap buffers for all register access

2017-02-06 Thread David Laight
From: Petko Manolov > Sent: 06 February 2017 12:51 ... > I suspect getting the buffer allocation in usb_control_msg() will help with > two > things in the same time: > > - allocate in DMA-able memory; > - code reduction; Is there code around there to do 'bounce buffer' allocation for systems

RE: [PATCH 24/27] netfilter: guarantee 8 byte minalign for template addresses

2017-02-06 Thread David Laight
From: Pablo Neira Ayuso > Sent: 03 February 2017 12:26 > The next change will merge skb->nfct pointer and skb->nfctinfo > status bits into single skb->_nfct (unsigned long) area. > > For this to work nf_conn addresses must always be aligned at least on > an 8 byte boundary since we will need the

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

2017-02-06 Thread David Laight
From: Saeed Mahameed > Sent: 05 February 2017 11:24 > On Thu, Feb 2, 2017 at 4:47 PM, Daniel Jurgens <dani...@mellanox.com> wrote: > > On 2/1/2017 5:12 AM, David Laight wrote: > >> From: Saeed Mahameed > >>> Sent: 31 January 2017 20:59 > >

RE: Disabling msix interrupts

2017-02-07 Thread David Laight
From: David Miller > Sent: 06 February 2017 19:15 > From: David Laight <david.lai...@aculab.com> > Date: Mon, 6 Feb 2017 17:23:54 + > > > Although the 'store buffer' on the sparc cpus I used to use would > > let reads overtake writes. So you did have to read ba

RE: [PATCH net-next 4/4] net: dsa: Do not clobber PHY link outside of state machine

2017-02-07 Thread David Laight
From: Andrew Lunn > Sent: 07 February 2017 00:12 > On Mon, Feb 06, 2017 at 03:55:23PM -0800, Florian Fainelli wrote: > > Calling phy_read_status() means that we may call into > > genphy_read_status() which in turn will use genphy_update_link() which > > can make changes to phydev->link outside of

RE: [PATCH net 2/4] rtl8150: Use heap buffers for all register access

2017-02-07 Thread David Laight
From: Greg KH > Sent: 07 February 2017 10:52 > To: Petko Manolov > Cc: Ben Hutchings; David Laight; netdev@vger.kernel.org; > linux-...@vger.kernel.org > Subject: Re: [PATCH net 2/4] rtl8150: Use heap buffers for all register access > > On Tue, Feb 07, 2017 at 12:34:52PM

RE: [PATCH net 2/4] rtl8150: Use heap buffers for all register access

2017-02-07 Thread David Laight
From: Petko Manolov > Sent: 07 February 2017 13:21 ... > > > Would you consider what David proposed (usb_control_msg_with_malloc()) > > > for 4.11, > > > for example? I for one will use something like that in all my drivers. > > > > Sure, but you might want to make it a bit smaller of a function

RE: [patch net-next] spectrum: acl_tcam: Fix catchall prio value

2017-02-07 Thread David Laight
From: Jiri Pirko > Sent: 07 February 2017 14:27 > From: Jiri Pirko > > This fixes an issue reported by smatch: > mlxsw_sp_acl_tcam_chunk_create() warn: impossible condition '(priority == > (-1)) => (0-u32max == > u64max)' ... > diff --git

RE: KASAN+netlink, was: [PATCH] [net-next?] hns: avoid stack overflow with CONFIG_KASAN

2017-02-08 Thread David Laight
> From: Johannes Berg > Sent: 08 February 2017 12:24 ... > Btw, what's causing this to start with? Can't the compiler reuse the > stack places? Only if it realises they've gone out of scope - which probably doesn't happen when the functions are inlined. The address of the parameter can be saved

Disabling msix interrupts

2017-02-06 Thread David Laight
netdev probably isn't the right list for this, but I suspect people reading it understand what happens. I'm fairly sure that an msix interrupt can get raised after the kernel thinks it has masked it. When an msix interrupt is disabled I think msi_set_mask_bit() (in drivers/pci/msi.c) is called

RE: [PATCH net 2/4] rtl8150: Use heap buffers for all register access

2017-02-06 Thread David Laight
From: Ben Hutchings > Sent: 04 February 2017 16:57 > Allocating USB buffers on the stack is not portable, and no longer > works on x86_64 (with VMAP_STACK enabled as per default). > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Ben Hutchings > --- >

RE: Disabling msix interrupts

2017-02-06 Thread David Laight
From: Alexander > Sent: 06 February 2017 16:27 > To: David Laight > On Mon, Feb 6, 2017 at 7:33 AM, David Laight <david.lai...@aculab.com> wrote: > > netdev probably isn't the right list for this, but I suspect people > > reading it understand what happens. > >

RE: [PATCH 1/2] libceph: Remove unneeded stddef.h include

2017-02-06 Thread David Laight
From: Stafford Horne > Sent: 05 February 2017 07:08 > This was causing a build failure for openrisc when using musl and > gcc 5.4.0 since the file is not available in the toolchain. > > It doesnt seem this is needed and removing it does not cause any build > warnings for me. Hmmm... stddef.h is

RE: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-02-02 Thread David Laight
ctly what the CHECKSUM_xxx flags actually mean. I have a good idea about what the intention is though. ... > On Tue, 2017-01-24 at 16:35 +, David Laight wrote: > > > > I can imagine horrid things happening if someone tries to encapsulate > > SCTP/IP in UDP (or worse U

RE: [PATCH v2 net-next] net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering.

2017-01-23 Thread David Laight
Alexander Duyck > Sent: 19 January 2017 15:55 ... > >> The Relaxed Ordering attribute doesn't get applied across the board. > >> It ends up being limited to a subset of the transactions if I recall > >> correctly. In this case it is the Tx descriptor write back, and the > >> Rx data write back.

RE: [PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-23 Thread David Laight
From: Xin Long > Sent: 19 January 2017 17:19 > This patch is to implement Sender-Side Procedures for the Add > Outgoing and Incoming Streams Request Parameter described in > rfc6525 section 5.1.5-5.1.6. > > It is also to add sockopt SCTP_ADD_STREAMS in rfc6525 section > 6.3.4 for users. ... > +

RE: [PATCHv3 net-next 3/4] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-23 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 20 January 2017 16:39 > To: David Laight > On Fri, Jan 20, 2017 at 02:50:01PM +0000, David Laight wrote: > > From: Xin Long > > > Sent: 19 January 2017 17:19 > > > This patch is to define Add Incoming/Outgoing Streams

RE: [PATCH 0/4] Make xfrm usable by 32-bit programs

2017-01-23 Thread David Laight
From: Kevin Cernekee > Sent: 21 January 2017 00:05 > Several of the xfrm netlink and setsockopt() interfaces are not usable > from a 32-bit binary running on a 64-bit kernel due to struct padding > differences. This has been the case for many, many years[0]. This > patch series deprecates the

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

2017-01-24 Thread David Laight
From: 'Naveen N. Rao' > Sent: 23 January 2017 19:22 > On 2017/01/15 09:00AM, Benjamin Herrenschmidt wrote: > > On Fri, 2017-01-13 at 23:22 +0530, 'Naveen N. Rao' wrote: > > > > That rather depends on whether the processor has a store to load > > > > forwarder > > > > that will satisfy the read

RE: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-01-24 Thread David Laight
From: Tom Herbert > Sent: 23 January 2017 21:00 .. > skb_checksum_help is specific to the Internet checksum. For instance, > CHECKSUM_COMPLETE can _only_ refer to Internet checksum calculation > nothing else will work. Checksums and CRCs are very different things > with very different processing.

RE: [PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-24 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 23 January 2017 18:48 > On Mon, Jan 23, 2017 at 11:25:56AM +, David Laight wrote: > > From: Xin Long > > > Sent: 19 January 2017 17:19 > > > This patch is to implement Sender-Side Procedures for the Add > > > Outgoing

RE: [PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-24 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 23 January 2017 16:03 ... > > > Does kcalloc() zero the entire area, or just the length you ask for? > > > If the latter you need to zero the rest here. > > Better still, just use krealloc. You still need to zero out any space > > beyond > > the old length,

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

2017-01-30 Thread David Laight
From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On Behalf Of Richard Cochran > Sent: 29 January 2017 15:36 ... > > +static int qede_ptp_adjfreq(struct ptp_clock_info *info, s32 ppb) > > +{ > > + struct qede_ptp *ptp = container_of(info, struct qede_ptp, clock_info); > >

RE: [PATCH 1/2] batman-adv: Fix double call of dev_queue_xmit

2017-01-30 Thread David Laight
From: Simon Wunderlich > Sent: 28 January 2017 10:57 > From: Sven Eckelmann > > The net_xmit_eval has side effects because it is not making sure that e > isn't evaluated twice. > > #define net_xmit_eval(e)((e) == NET_XMIT_CN ? 0 : (e)) It is probably worth

RE: [PATCH net-next V3 5/8] net/mlx4_en: Adding support of turning off link autonegotiation via ethtool

2017-01-30 Thread David Laight
From: Tariq Toukan > Sent: 29 January 2017 16:56 > From: Ariel Levkovich > > This feature will allow the user to disable auto negotiation > on the port for mlx4 devices while setting the speed is limited > to 1GbE speeds. > Other speeds will not be accepted in autoneg off

RE: [patch] samples/bpf: silence shift wrapping warning

2017-01-25 Thread David Laight
From: Alexei Starovoitov > Sent: 22 January 2017 22:51 > On Sat, Jan 21, 2017 at 07:51:43AM +0300, Dan Carpenter wrote: > > max_key is a value in the 0-63 range, so on 32 bit systems the shift > > could wrap. > > > > Signed-off-by: Dan Carpenter > > Looks fine. I think

RE: [PATCH 0/6 v3] kvmalloc

2017-01-26 Thread David Laight
From: Daniel Borkmann > Sent: 26 January 2017 09:37 ... > >> I assume that kvzalloc() is still the same from [1], right? If so, then > >> it would unfortunately (partially) reintroduce the issue that was fixed. > >> If you look above at flags, they're also passed to __vmalloc() to not > >> trigger

RE: [PATCH net-next V4] tc: flower: Refactor matching flags to be more user friendly

2017-01-20 Thread David Laight
From: Of Jiri Benc > Sent: 19 January 2017 14:22 > On Thu, 19 Jan 2017 16:17:48 +0200, Paul Blakey wrote: > > + while (token) { > > + if (!strncmp(token, "no", 2)) { > > + no = true; > > + token = strchr(token, '_') + 1; > > This seems to still

RE: [PATCHv3 net-next 3/4] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-20 Thread David Laight
From: Xin Long > Sent: 19 January 2017 17:19 > This patch is to define Add Incoming/Outgoing Streams Request > Parameter described in rfc6525 section 4.5 and 4.6. They can > be in one same chunk trunk as rfc6525 section 3.1-7 describes, > so make them in one function. ... > +struct

RE: [PATCH net-next] net: adjust skb->truesize in pskb_expand_head()

2017-01-27 Thread David Laight
From: Eric Dumazet > Sent: 27 January 2017 00:21 > Slava Shwartsman reported a warning in skb_try_coalesce(), when we > detect skb->truesize is completely wrong. > > In his case, issue came from IPv6 reassembly coping with malicious > datagrams, that forced various pskb_may_pull() to reallocate a

RE: [PATCH net-next] net: adjust skb->truesize in pskb_expand_head()

2017-01-27 Thread David Laight
From: Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: 27 January 2017 14:44 > On Fri, 2017-01-27 at 10:49 +, David Laight wrote: > > From: Eric Dumazet > > > Sent: 27 January 2017 00:21 > > > Slava Shwartsman reported a warning in skb_try_coalesce(), when

RE: [PATCH net-next] net: adjust skb->truesize in pskb_expand_head()

2017-01-27 Thread David Laight
From: Eric Dumazet > Sent: 27 January 2017 14:44 ... > > I'm also guessing that extra headroom can be generated by stealing unused > > tailroom. > > This is already done. > > Quoting > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=87fb4b7b533073eeeaed0b6bf7c >

RE: [net-next][PATCH] RDS: keep data type consistent in the user visible header

2017-02-21 Thread David Laight
> The entire file should use the proper "__uX" kernel types > rather than the uint* ones. The uint* ones are part of the C standard :-) David

RE: [PATCH][CFT] Saner error handling in skb_copy_datagram_iter() et.al.

2017-02-21 Thread David Laight
From: Al Viro > Sent: 18 February 2017 00:02 ... > Actually, I've a better solution. Namely, analogue of iov_iter_advance() > for going backwards. The restriction is that you should never unroll > further than where you've initially started *or* have the iovec, etc. > array modified under you

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

2017-02-21 Thread David Laight
From: Xin Long > Sent: 18 February 2017 17:53 > This patch is to add support for MSG_MORE on sctp. > > It adds force_delay in sctp_datamsg to save MSG_MORE, and sets it after > creating datamsg according to the send flag. sctp_packet_can_append_data > then uses it to decide if the chunks of this

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

2017-02-24 Thread David Laight
From: Xin Long > Sent: 24 February 2017 06:44 ... > > IIRC sctp_packet_can_append_data() is called for the first queued > > data chunk in order to decide whether to generate a message that > > consists only of data chunks. > > If it returns SCTP_XMIT_OK then a message is built collecting the > >

RE: [PATCH v3 net-next 08/14] mlx4: use order-0 pages for RX

2017-02-22 Thread David Laight
From: Alexander Duyck > Sent: 22 February 2017 17:24 ... > So there is a problem that is being overlooked here. That is the cost > of the DMA map/unmap calls. The problem is many PowerPC systems have > an IOMMU that you have to work around, and that IOMMU comes at a heavy > cost for every

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

2017-02-23 Thread David Laight
From: Xin Long > Sent: 23 February 2017 03:46 > On Tue, Feb 21, 2017 at 10:27 PM, David Laight <david.lai...@aculab.com> > wrote: > > From: Xin Long > >> Sent: 18 February 2017 17:53 > >> This patch is to add support for MSG_MORE on sctp. > >>

RE: [PATCH v3 net-next 08/14] mlx4: use order-0 pages for RX

2017-02-14 Thread David Laight
From: David Miller > Sent: 14 February 2017 17:04 ... > One path I see around all of this is full integration. Meaning that > we can free pages into the page allocator which are still DMA mapped. > And future allocations from that device are prioritized to take still > DMA mapped objects. ...

RE: [PATCH 5/7] staging: r8712u: Fix Sparse endian warning in rtl871x_recv.c

2017-02-13 Thread David Laight
From: Larry Finger > Sent: 11 February 2017 03:30 > Sparse reports the following: > CHECK drivers/staging/rtl8712/rtl871x_recv.c > drivers/staging/rtl8712/rtl871x_recv.c:657:21: warning: incorrect type in > assignment (different base > types) > drivers/staging/rtl8712/rtl871x_recv.c:657:21:

RE: [PATCH 1/7] staging: rtl8712: Fix some Sparse endian messages

2017-02-13 Thread David Laight
From: Larry Finger > Sent: 11 February 2017 03:30 > Sparse reports the following: > > CHECK drivers/staging/rtl8712/rtl8712_xmit.c > drivers/staging/rtl8712/rtl8712_xmit.c:564:42: warning: cast from restricted > __le32 ... I think you ought to do separate patches for the changes that are

RE: [PATCH 6/7] staging: r8712u: Fix Sparse warnings in rtl871x_ioctl_linux.c

2017-02-13 Thread David Laight
From: Larry Finger > Sent: 11 February 2017 03:30 > Sparse reports the following: > CHECK drivers/staging/rtl8712/rtl871x_ioctl_linux.c > drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1422:46: warning: restricted > __le16 degrades to integer >

RE: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line

2017-02-10 Thread David Laight
From: David Miller > Sent: 09 February 2017 21:31 > From: Arnd Bergmann > Date: Wed, 8 Feb 2017 22:18:26 +0100 > > > When CONFIG_KASAN is enabled, the "--param asan-stack=1" causes rather large > > stack frames in some functions. This goes unnoticed normally because > >

RE: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-16 Thread David Laight
From: Lino Sanfilippo > Sent: 15 February 2017 21:31 ... > Well, you should really try to avoid copying the tx buffers _at all_. > E.g. by passing self->buff_ring to aq_ring_tx_append_buffs() instead of > the temporary array. Copying can help for horridly fragmented frames or when iommu (etc)

RE: RE: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-16 Thread David Laight
From: Lino Sanfilippo > Sent: 16 February 2017 16:02 ... > I was referring to the copy of tx descriptors, not the frames/fragments > itself. > I wrote "tx buffers" because in this driver a descriptor is represented as > a struct "aq_ring_buff_s". I cannot see a reason why this descriptor copy >

RE: [PATCH 1/2] net: xilinx_emaclite: fix receive buffer overflow

2017-02-15 Thread David Laight
From: Anssi Hannula > Sent: 15 February 2017 08:29 ... > Looking through the product guide [1] I don't see the actual receive > packet length provided anywhere, so I guess that is why the crazy stuff > is done. If the hardware doesn't provide the receive packet length then I suggest you 'fix' the

RE: [PATCH v2 net-next] net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering.

2017-01-19 Thread David Laight
From: Alexander Duyck > Sent: 18 January 2017 17:25 > On Wed, Jan 18, 2017 at 8:22 AM, David Laight <david.lai...@aculab.com> wrote: > > From: David Miller > >> Sent: 17 January 2017 19:16 > >> > Relax ordering(RO) is one feature of 82599 NIC, to enable

RE: sctp: kernel memory overwrite attempt detected in sctp_getsockopt_assoc_stats

2017-01-16 Thread David Laight
From: Dmitry Vyukov > Sent: 16 January 2017 14:04 > >> >> I've enabled CONFIG_HARDENED_USERCOPY_PAGESPAN on syzkaller fuzzer and ... > >> The code also takes into account compound pages. As far as I > >> understand the intention of the check is to effectively find > >> out-of-bounds copies (e.g.

RE: [PATCH v2 net-next] net:add one common config ARCH_WANT_RELAX_ORDER to support relax ordering.

2017-01-18 Thread David Laight
From: David Miller > Sent: 17 January 2017 19:16 > > Relax ordering(RO) is one feature of 82599 NIC, to enable this feature can > > enhance the performance for some cpu architecure, such as SPARC and so on. > > Currently it only supports one special cpu architecture(SPARC) in 82599 > > driver to

RE: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-20 Thread David Laight
From: Michael S. Tsirkin > Sent: 19 January 2017 21:12 > > On 2017?01?18? 23:15, Michael S. Tsirkin wrote: > > > On Tue, Jan 17, 2017 at 02:22:59PM -0800, John Fastabend wrote: > > > > Add support for XDP adjust head by allocating a 256B header region > > > > that XDP programs can grow into. This

RE: [Patch net v3 5/5] net_sched: convert tcf_exts from list to pointer array

2016-08-16 Thread David Laight
From: Jamal Hadi Salim > Sent: 13 August 2016 12:34 > > Just minor comment below: > > On 16-08-11 08:41 PM, Cong Wang wrote: > > > > +static inline void > > +tcf_exts_to_list(const struct tcf_exts *exts, struct list_head *actions) > > +{ > > to: > static inline void tcf_exts_to_list(const

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

2016-08-16 Thread David Laight
From: Xin Long > Sent: 16 August 2016 12:34 > > >> Both sctp_outq_flush_rtx and sctp_packet_transmit can ONLY > >> return one error (-ENOMEM), as sctp_outq_flush_rtx also calls > >> sctp_packet_transmit. > > > > What is the effect of the error? > > If it is 'just' equivalent to a lost ethernet

RE: order-0 vs order-N driver allocation. Was: [PATCH v10 07/12] net/mlx4_en: add page recycle to prepare rx ring for tx support

2016-08-05 Thread David Laight
From: Alexander Duyck > Sent: 05 August 2016 16:15 ... > > > > interesting idea. Like dma_map 1GB region and then allocate > > pages from it only? but the rest of the kernel won't be able > > to use them? so only some smaller region then? or it will be > > a boot time flag to reserve this

RE: [PATCH v3 net] net: solve a NAPI race

2017-02-28 Thread David Laight
From: Eric Dumazet > Sent: 27 February 2017 22:35 > On Mon, 2017-02-27 at 14:14 -0800, Stephen Hemminger wrote: > > > The original design (as Davem mentioned) was that IRQ's must be disabled > > during device polling. If that was true, then the race above > > would be impossible. > > I would

RE: [PATCH v2 net] net: solve a NAPI race

2017-03-02 Thread David Laight
From: Eric Dumazet > Sent: 01 March 2017 17:33 > On Wed, 2017-03-01 at 08:14 -0800, Alexander Duyck wrote: > > > What build flags are you using? With -Os or -O2 I have seen it > > convert the /b * c into a single shift. > > > > > Because b & c are unsigned in our case. > > I presume David

RE: [PATCH v2 net] net: solve a NAPI race

2017-03-01 Thread David Laight
From: Alexander Duyck > Sent: 28 February 2017 17:20 ... > You might want to consider just using a combination AND, divide, > multiply, and OR to avoid having to have any conditional branches > being added due to this code path. Basically the logic would look > like: > new = val |

RE: [PATCH RFC net-next v2 1/4] skbuff: add stub to help computing crc32c on SCTP packets

2017-03-01 Thread David Laight
From: Alexander Duyck > Sent: 28 February 2017 22:46 ... > I don't want to see anything "checksum" or "csum" related in the > naming when it comes to dealing with SCTP unless we absolutely have to > have it. So any function names or structures with sctp in the name > should call out "crc32" or

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

2017-02-27 Thread David Laight
From: Xin Long > Sent: 27 February 2017 04:49 ... > > what I'm worried about is if the msg_more is saved in assoc: > > chk4[clear] -> chk3 [clear] -> chk2 [clear] -> chk1 [clear] > > then when you send a small chkA with MSG_MORE, > > the queue will be like: > > chkA [set] -> chk4[set] ->

RE: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-09-02 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 02 September 2016 14:47 ... > > Consider the following network: > > > > +---+--+- > > | | | > > x.x.1.1 x.x.1.2y.y.1.2 > > 10.1.1.1

RE: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-09-02 Thread David Laight
From: Of Xin Long > Sent: 25 August 2016 05:04 ... > But I still prefer the current patch. > 1. This issue only happens when server bind 'ANY' addresses. > we don't need to add any new members to struct sctp_sockaddr_entry. > especially if it's a really corner issue, we fix this as an

RE: [PATCH v3 3/6] bpf: add BPF_PROG_ATTACH and BPF_PROG_DETACH commands

2016-09-05 Thread David Laight
From: Daniel Mack > >> + > >> + struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ > >> + __u32 target_fd; /* container object to attach > >> to */ > >> + __u32 attach_bpf_fd; /* eBPF program to attach */ > >> + __u32

RE: [PATCH net-next 4/9] rxrpc: Randomise epoch and starting client conn ID values

2016-09-05 Thread David Laight
From: David Howells > Sent: 04 September 2016 22:03 > Create a random epoch value rather than a time-based one on startup and set > the top bit to indicate that this is the case. Why set the top bit? There is nothing to stop the time (in seconds) from having the top bit set. Nothing else can care

RE: [PATCH iproute2] ip route: check ftell, fseek return value

2016-09-06 Thread David Laight
From: Hangbin Liu > Sent: 06 September 2016 07:40 > ftell() may return -1 in error case, which is not handled and therefore pass a > negative offset to fseek(). The return code of fseek() is also not checked. > > Reported-by: Phil Sutter > Signed-off-by: Hangbin Liu

RE: [PATCH net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-08 Thread David Laight
From: Xin Long > Sent: 08 September 2016 10:49 > Now sctp uses the transport without holding it in sctp_hash_cmp, > it can cause a use-after-free panic. As after it get transport from > hashtable, another CPU may free it, then the members it accesses > may be unavailable memory. How old is this

RE: [RFC v3 00/22] Landlock LSM: Unprivileged sandboxing

2016-09-14 Thread David Laight
From: Mickaël Salaün > Sent: 14 September 2016 08:24 ... > ## Why does seccomp-filter is not enough? > > A seccomp filter can access to raw syscall arguments which means that it is > not > possible to filter according to pointed data as a file path. As demonstrated > the first version of this

RE: [PATCH net] tcp: fix overflow in __tcp_retransmit_skb()

2016-09-15 Thread David Laight
From: Eric Dumazet > Sent: 15 September 2016 16:13 > If a TCP socket gets a large write queue, an overflow can happen > in a test in __tcp_retransmit_skb() preventing all retransmits. ... > if (atomic_read(>sk_wmem_alloc) > > - min(sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2),

RE: [PATCH next] sctp: make use of WORD_TRUNC macro

2016-09-16 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 15 September 2016 19:13 > No functional change. Just to avoid the usage of '&~3'. ... > - max_data = (asoc->pathmtu - > - sctp_sk(asoc->base.sk)->pf->af->net_header_len - > - sizeof(struct sctphdr) - sizeof(struct sctp_data_chunk))

RE: [PATCH v2] fs/select: add vmalloc fallback for select(2)

2016-09-26 Thread David Laight
From: Vlastimil Babka > Sent: 26 September 2016 11:02 > On 09/23/2016 03:35 PM, David Laight wrote: > > From: Vlastimil Babka > >> Sent: 23 September 2016 10:59 > > ... > >> > I suspect that fdt->max_fds is an upper bound for the highest fd the > >&g

RE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

2016-09-26 Thread David Laight
From: SF Markus Elfring > Sent: 26 September 2016 16:45 ... > The script "checkpatch.pl" can point information out like the following. > > WARNING: sizeof … should be sizeof(…) ... > --- > drivers/isdn/gigaset/common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git

RE: [PATCH] fs/select: add vmalloc fallback for select(2)

2016-09-28 Thread David Laight
From: Vlastimil Babka > Sent: 27 September 2016 12:51 ... > Process name suggests it's part of db2 database. It seems it has to implement > its own interface to select() syscall, because glibc itself seems to have a > FD_SETSIZE limit of 1024, which is probably why this wasn't an issue for all >

RE: [PATCH 3/3] net: fec: align IP header in hardware

2016-09-28 Thread David Laight
From: Eric Nelson > Sent: 26 September 2016 19:40 > Hi David, > > On 09/26/2016 02:26 AM, David Laight wrote: > > From: Eric Nelson > >> Sent: 24 September 2016 15:42 > >> The FEC receive accelerator (RACC) supports shifting the data payload of > >&

RE: [PATCH 3/3] net: fec: align IP header in hardware

2016-09-30 Thread David Laight
From: Eric Nelson > Sent: 30 September 2016 14:27 > Thanks for the feedback David, > > On 09/29/2016 04:07 AM, David Laight wrote: > > From: Eric Nelson > >> Sent: 28 September 2016 18:15 > >> On 09/28/2016 09:42 AM, David Laight wrote: > >>> From:

RE: [PATCH] bluetooth.h: __ variants of u8 and friends are not neccessary inside kernel

2016-10-06 Thread David Laight
From: Of Joe Perches ... > No worries, and bool is the same size as u8. That is not guaranteed at all. One of the ARM ABI defined bool to be the size of int. David

RE: [PATCH net-next v2 2/3] net: ethernet: mediatek: get hw lro capability by the chip id instead of by the dtsi

2016-10-05 Thread David Laight
From: Nelson Chang > Sent: 05 October 2016 13:46 > > +static bool mtk_is_hwlro_supported(struct mtk_eth *eth) { > > + if (eth->chip_id == MT7623_ETH) > > + return true; > > + else > > + return false; > > return eth->chip_id == MT7623_ETH; > > => Since

RE: [net-next 08/13] fsl/fman: check pcsphy pointer before use

2016-10-04 Thread David Laight
From: Madalin Bucur > Sent: 04 October 2016 08:33 > Subject: [net-next 08/13] fsl/fman: check pcsphy pointer before use .. > --- a/drivers/net/ethernet/freescale/fman/fman_memac.c > +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c > @@ -507,6 +507,9 @@ static void

RE: [PATCH] bluetooth.h: __ variants of u8 and friends are not neccessary inside kernel

2016-10-06 Thread David Laight
From: Joe Perches > Sent: 06 October 2016 12:39 > On Thu, 2016-10-06 at 09:41 +, David Laight wrote: > > From: Joe Perches > > > No worries, and bool is the same ,size as u8. > > That is not guaranteed at all. > > One of the ARM ABI defined bool to be the size

RE: [PATCH v4 net-next 13/16] tcp: allow congestion control to expand send buffer differently

2016-09-21 Thread David Laight
From: Stephen Hemminger > Sent: 20 September 2016 18:48 ... > > - sndmem = 2 * nr_segs * per_mss; > > + sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2; > > You could avoid the conditional (if it mattered) by inheriting a default value > that would mean changing all existing

RE: [PATCH next 1/2] sctp: fix the handling of SACK Gap Ack blocks

2016-09-21 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 20 September 2016 22:19 > sctp_acked() is using 32bit arithmetics on 16bits vars, via TSN_lte() > macros, which is weird and confusing. > > Once the offset to ctsn is calculated, all wrapping is already handled > and thus to verify the Gap Ack blocks we can

RE: [PATCH net] qed: Fix stack corruption on probe

2016-09-19 Thread David Laight
From: Yuval Mintz > Sent: 18 September 2016 09:15 > Commit fe56b9e6a8d95 ("qed: Add module with basic common support") > has introduced a stack corruption during probe, where filling a > local struct with data to be sent to management firmware is incorrectly > filled; The data is written outside

RE: [PATCH net v2] qed: Fix stack corruption on probe

2016-09-19 Thread David Laight
e data is written outside of the struct and corrupts > the stack. > > Changes from v1: > > - Correct the value written [Caught by David Laight] > > Fixes: fe56b9e6a8d95 ("qed: Add module with basic common support") > Signed-off-by: Yuval Mintz &l

RE: [PATCH net-next 2/2] bnx2x: allocate mac filtering pending list in PAGE_SIZE increments

2016-09-20 Thread David Laight
From: Jason Baron > Sent: 19 September 2016 19:34 ... > > sizeof(struct bnx2x_mcast_list_elem) = 24. So there are 170 per > page on x86. So if we want to fit 2,048 elements, we need 12 pages. If you only need to save the mcast addresses you could use a 'heap' that requires no overhead per entry

RE: [PATCH v2] fs/select: add vmalloc fallback for select(2)

2016-09-23 Thread David Laight
From: Vlastimil Babka > Sent: 22 September 2016 18:55 ... > So in the case of select() it seems like the memory we need 6 bits per file > descriptor, multiplied by the highest possible file descriptor (nfds) as > passed > to the syscall. According to the man page of select: > > EINVAL

RE: [PATCH RFC 05/11] skbuff: Extend gso_type to unsigned int.

2016-09-23 Thread David Laight
From: Steffen Klassert > Sent: 23 September 2016 08:54 > All available gso_type flags are currently in use, > so extend gso_type to be able to add further flags. > > Signed-off-by: Steffen Klassert > --- > include/linux/skbuff.h | 2 +- > 1 file changed, 1

RE: [PATCH v2] fs/select: add vmalloc fallback for select(2)

2016-09-23 Thread David Laight
From: Vlastimil Babka > Sent: 23 September 2016 10:59 ... > > I suspect that fdt->max_fds is an upper bound for the highest fd the > > process has open - not the RLIMIT_NOFILE value. > > I gathered that the highest fd effectively limits the number of files, > so it's the same. I might be wrong.

RE: [PATCH net-next] tcp: add tcp_add_backlog()

2016-09-23 Thread David Laight
From: Eric Dumazet > Sent: 23 September 2016 15:37 > On Fri, 2016-09-23 at 11:09 -0300, Marcelo Ricardo Leitner wrote: > > On Fri, Sep 23, 2016 at 06:42:51AM -0700, Eric Dumazet wrote: > > > On Fri, 2016-09-23 at 09:45 -0300, Marcelo Ricardo Leitner wrote: > > > > > > > Aye. In that case, what

RE: [PATCH net] ipmr, ip6mr: return lastuse relative to now

2016-09-20 Thread David Laight
From: Nikolay Aleksandrov > Sent: 20 September 2016 10:06 > When I introduced the lastuse member I made a subtle error because it was > returned as an absolute value but that is meaningless to user-space as it > doesn't allow to see how old exactly an entry is. Let's make it similar to > how the

RE: UBSAN reports issue in ip_idents_reserve

2016-09-20 Thread David Laight
From: Eric Dumazet > Sent: 20 September 2016 14:29 ... > > [ 47.565420] -2117905507 + -695755206 cannot be represented in type 'int' ... > I do not think we have to worry here. > > These is best effort, and unfortunately atomic_t are int. Not until we compile on a cpu where int arithmetic

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

2016-08-17 Thread David Laight
From: Marcelo Ricardo Leitner > Sent: 16 August 2016 18:25 ... > > That doesn't seem a good idea. > > You don't want to abort the association if there is a transient > > memory allocation failure. > > You also can't drop data chunks. > > From a system-wise POV, this behavior - to free the new

RE: [PATCH] fs/select: add vmalloc fallback for select(2)

2016-09-27 Thread David Laight
From: Nicholas Piggin > Sent: 27 September 2016 12:25 > On Tue, 27 Sep 2016 10:44:04 +0200 > Vlastimil Babka wrote: > > > On 09/23/2016 06:47 PM, Jason Baron wrote: > > > Hi, > > > > > > On 09/23/2016 03:24 AM, Nicholas Piggin wrote: > > >> On Fri, 23 Sep 2016 14:42:53 +0800 > >

RE: [PATCH 3/3] net: fec: align IP header in hardware

2016-09-29 Thread David Laight
From: Eric Nelson > Sent: 28 September 2016 18:15 > On 09/28/2016 09:42 AM, David Laight wrote: > > From: Eric Nelson > >> Sent: 26 September 2016 19:40 > >> Hi David, > >> > >> On 09/26/2016 02:26 AM, David Laight wrote: > >>> From: Eri

RE: [PATCH v5 13/16] IB/pvrdma: Add the main driver module for PVRDMA

2016-09-27 Thread David Laight
From: Adit Ranadive > Sent: 26 September 2016 19:15 > On Mon, Sep 26, 2016 at 00:27:40AM -0700, Yuval Shaia wrote: > > On Sat, Sep 24, 2016 at 04:21:37PM -0700, Adit Ranadive wrote: > > > + > > > + /* Currently, the driver only supports RoCE mode. */ > > > + if (dev->dsr->caps.mode !=

RE: [RFC PATCH net-next 2/2] sfc: report 4-tuple UDP hashing to ethtool, if it's enabled

2016-09-28 Thread David Laight
From: Edward Cree > Sent: 27 September 2016 17:36 ... > + case UDP_V4_FLOW: > + if (efx->rx_hash_udp_4tuple) > + /* fall through */ > + /* else fall further! */ If you invert the above and add a goto...

RE: [PATCH 3/3] net: fec: align IP header in hardware

2016-10-03 Thread David Laight
From: Russell King - ARM Linux > Sent: 01 October 2016 20:52 > On Fri, Sep 30, 2016 at 07:16:12AM -0700, Eric Nelson wrote: > > On ARM, the CPU can't handle misaligned memory cycles without > > taking an alignment fault and NET_IP_ALIGN is set to 2. > > Let's get this right... With Linux on MMU

RE: [PATCH 3/3] net: fec: align IP header in hardware

2016-09-26 Thread David Laight
From: Eric Nelson > Sent: 24 September 2016 15:42 > The FEC receive accelerator (RACC) supports shifting the data payload of > received packets by 16-bits, which aligns the payload (IP header) on a > 4-byte boundary, which is, if not required, at least strongly suggested > by the Linux networking

RE: [PATCH] realtek: Add switch variable to 'switch case not processed' messages

2016-09-26 Thread David Laight
> If you want to create enum->#ENUM structs and > "const char *" lookup functions, please be my guest. > > otherwise, hex is at least a consistent way to display > what should be infrequent output. If I've typed it right: #define tags(x) x(A) x(B) x(C) #define x(t) t, enum {tags(x) tag_count};

<    1   2   3   4   5   6   7   >