RE: [RFC PATCH v1 5/5] wave: Added basic version of TCP Wave

2017-07-31 Thread David Laight
From: Natale Patriciello > Sent: 28 July 2017 20:59 .. > +static __always_inline bool test_flag(u8 value, const u8 *flags) > +{ > + return (*flags & value) == value; > +} ... > + if (!test_flag(FLAG_INIT, >flags)) > + return; ... That is a completely unnecessary 'helper'. It

RE: [PATCH] netfilter: fix stringop-overflow warning with UBSAN

2017-08-01 Thread David Laight
From: Arnd Bergmann > Sent: 31 July 2017 11:09 > Using gcc-7 with UBSAN enabled, we get this false-positive warning: > > net/netfilter/ipset/ip_set_core.c: In function 'ip_set_sockfn_get': > net/netfilter/ipset/ip_set_core.c:1998:3: error: 'strncpy' writing 32 bytes > into a region of size 2 >

RE: [PATCH v2] iwlwifi: Demote messages about fw flags size to info

2017-08-03 Thread David Laight
From: João Paulo Rechi Vita > Sent: 03 August 2017 15:30 > These messages are not reporting a real error, just the fact that the > firmware knows about more flags then the driver. than > > Currently these messages are presented to the user during boot if there >

RE: [PATCH v4 iproute2 2/7] rdma: Add dev object

2017-08-15 Thread David Laight
From: Stephen Hemminger > Sent: 15 August 2017 17:12 > On Tue, 15 Aug 2017 16:00:15 +0300 > Leon Romanovsky wrote: > > > + > > +static const char *dev_caps_to_str(uint32_t idx) > > +{ > > + uint64_t cap = 1 << idx; > > + > > + switch (cap) { > > + case

RE: [PATCH v4 iproute2 2/7] rdma: Add dev object

2017-08-15 Thread David Laight
From: Leon Romanovsky > Sent: 15 August 2017 17:47 > On Tue, Aug 15, 2017 at 04:23:11PM +, David Laight wrote: > > From: Stephen Hemminger > > > Sent: 15 August 2017 17:12 > > > On Tue, 15 Aug 2017 16:00:15 +0300 > > > Leon

RE: [PATCH] New Chapter on CodingStyle .

2017-08-15 Thread David Laight
From: Stephen Hemminger > Sent: 15 August 2017 17:21 > On Tue, 15 Aug 2017 10:42:39 +0000 > David Laight <david.lai...@aculab.com> wrote: > > > From: Jonathan Corbet > > > Sent: 12 August 2017 15:55 > > ... > > > > + Chapt

RE: [PATCH net-next 3/3 v4] drivers: net: ethernet: qualcomm: rmnet: Initial implementation

2017-08-16 Thread David Laight
From: David Miller > Sent: 16 August 2017 05:24 > From: Subash Abhinov Kasiviswanathan > Date: Tue, 15 Aug 2017 22:15:53 -0600 > > > +static int rmnet_unregister_real_device(struct net_device *dev) > > +{ > > + int config_id = RMNET_LOCAL_LOGICAL_ENDPOINT; > > +

RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context

2017-08-16 Thread David Laight
From: Greg Edwards > Sent: 15 August 2017 20:32 > On Mon, Aug 14, 2017 at 10:17:31AM +, David Laight wrote: > > From: Jeff Kirsher > >> Sent: 09 August 2017 22:48 > >> From: Greg Edwards <gedwa...@ddn.com> > >> > >

RE: [patch net-next 0/3] net/sched: Improve getting objects by indexes

2017-08-16 Thread David Laight
From: Christian König > Sent: 16 August 2017 09:32 > Am 16.08.2017 um 10:16 schrieb Jiri Pirko: > > Wed, Aug 16, 2017 at 09:49:07AM CEST, christian.koe...@amd.com wrote: > >> Am 16.08.2017 um 04:12 schrieb Chris Mi: ... > >>> - ret = idr_alloc(_minor_idr, bcd, 0, BSG_MAX_DEVS, GFP_KERNEL); > >>> -

RE: [PATCH] New Chapter on CodingStyle .

2017-08-15 Thread David Laight
From: Jonathan Corbet > Sent: 12 August 2017 15:55 ... > > + Chapter 20: Put values on initialisers without exception > > + > > +When declaring variables on functions must put values: > > Thanks for sending a patch for the kernel's documentation. > Unfortunately, I can't accept this

RE: [PATCH] of_mdio: merge branch tails in of_phy_register_fixed_link()

2017-08-15 Thread David Laight
From: David Miller > Sent: 14 August 2017 04:09 > From: Sergei Shtylyov > Date: Sun, 13 Aug 2017 00:03:06 +0300 > > > Looks like gcc isn't always able to figure out that 3 *if* branches in > > of_phy_register_fixed_link() calling fixed_phy_register() at

RE: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-15 Thread David Laight
From: Phil Sutter > Sent: 12 August 2017 13:05 > This is merely to silence the compiler warning. If write to stderr > failed, assume that printing an error message will fail as well so don't > even try. > > Signed-off-by: Phil Sutter > --- > lib/bpf.c | 3 ++- > 1 file changed, 2

RE: [net-next 08/15] i40e/i40evf: organize and re-number feature flags

2017-08-15 Thread David Laight
From: Keller, Jacob E > Sent: 14 August 2017 23:11 > > From: David Miller [mailto:da...@davemloft.net] > > Sent: Saturday, August 12, 2017 1:04 PM > > From: Jeff Kirsher > > Date: Sat, 12 Aug 2017 04:08:41 -0700 > > > > > Also ensure that the flags variable is

RE: [net-next 11/12] igbvf: convert msleep to mdelay in atomic context

2017-08-14 Thread David Laight
From: Jeff Kirsher > Sent: 09 August 2017 22:48 > From: Greg Edwards > > This fixes a "scheduling while atomic" splat seen with > CONFIG_DEBUG_ATOMIC_SLEEP enabled. > > Signed-off-by: Greg Edwards > Tested-by: Aaron Brown >

RE: [RFC PATCH 2/2] bpf: Initialise mod[] in bpf_trace_printk

2017-08-14 Thread David Laight
From: Daniel Borkmann > Sent: 11 August 2017 17:47 > On 08/09/2017 10:34 PM, Daniel Borkmann wrote: > > On 08/09/2017 09:39 AM, James Hogan wrote: > > [...] > >> time (but please consider looking at the other patch which is certainly > >> a more real issue). > > > > Sorry for the delay, started

RE: [PATCH net] datagram: When peeking datagrams with offset < 0 don't skip empty skbs

2017-08-17 Thread David Laight
From: Willem de Bruijn > Sent: 17 August 2017 00:27 > Actually, it is safe even without the check. Overflow of the signed integer > is benign here. IIRC the C language states that 'signed integer overflow' is undefined. So 'MAXINT + 1' doesn't have to equal '-MAXINT - 1' (as one would expect on a

RE: [PATCH 04/22] scsi: fusion: fix string overflow warning

2017-07-17 Thread David Laight
From: Arnd Bergmann > Sent: 14 July 2017 13:07 > gcc points out a theorerical string overflow: > > drivers/message/fusion/mptbase.c: In function 'mpt_detach': > drivers/message/fusion/mptbase.c:2103:17: error: '%s' directive writing up to > 31 bytes into a region > of size 28

RE: [PATCH iproute2] ip: change flag names to an array

2017-07-10 Thread David Laight
From: Stephen Hemminger > Sent: 07 July 2017 16:40 > For the most of the address flags, use a table of bit values rather > than open coding every value. This allows for easier inevitable > expansion of flags. > > This also fixes the missing stable-privacy flag. > > Signed-off-by: Stephen

RE: [PATCH v2 RFC 0/13] Remove UDP Fragmentation Offload support

2017-07-07 Thread David Laight
From: Michal Kubecek > Sent: 07 July 2017 13:46 > On Fri, Jul 07, 2017 at 10:43:26AM +0100, David Miller wrote: > > > > This is an RFC patch series, based upon some discussions with > > various developers, that removes UFO offloading. > > > > Very few devices support this operation, it's

RE: [PATCH V4 net-next 7/8] net: hns3: Add Ethtool support to HNS3 driver

2017-07-25 Thread David Laight
From: Rustad, Mark D > Sent: 24 July 2017 21:32 > > On Jul 23, 2017, at 10:05 AM, Florian Fainelli wrote: > >> + > >> + strncpy(drvinfo->version, HNAE_DRIVER_VERSION, > >> + sizeof(drvinfo->version)); > >> + drvinfo->version[sizeof(drvinfo->version) - 1] = '\0'; >

RE: [PATCH] netns: more input validation

2017-07-25 Thread David Laight
From: Matteo Croce > Sent: 25 July 2017 14:31 > ip netns accepts invalid input as namespace name like an empty string or a > string longer than the maximum file name length. > Check that the netns name is not empty and less than or equal to NAME_MAX. > > Signed-off-by: Matteo Croce

RE: [PATCH net-next 2/3] nfp: look for firmware image by device serial number and PCI name

2017-07-27 Thread David Laight
From: Jakub Kicinski > Sent: 26 July 2017 19:10 > We generally look up firmware by card type, but that doesn't allow > users who have more than one card of the same type in their system > to select firmware per adapter. > > Unfortunately user space firmware helper seems fraught with >

RE: [PATCH net-next 2/3] nfp: look for firmware image by device serial number and PCI name

2017-07-27 Thread David Laight
From: Jakub Kicinski > Sent: 27 July 2017 10:26 ... > > - use snprintf(). > > To effectively print an integer into an amply sized array? I need to > guarantee that the string will fit otherwise I would request a FW image > with a wrong name. snprintf() would only mask such a bug. Eh? If, for

RE: [PATCH 25/29] netfilter, kbuild: use canonical method to specify objs.

2017-06-30 Thread David Laight
From: Pablo Neira Ayuso > Sent: 29 June 2017 23:53 > Should use ":=" instead of "+=". ... > diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile > index c9b78e7b342f..913380919301 100644 > --- a/net/netfilter/Makefile > +++ b/net/netfilter/Makefile > @@ -70,10 +70,9 @@

RE: [PATCH net-next v2 9/9] nfp: add control message passing capabilities to flower offloads

2017-06-29 Thread David Laight
From: Or Gerlitz > Sent: 29 June 2017 14:47 ... > > + nfp_flow->meta.key_len /= NFP_FL_LW_SIZ; > > + nfp_flow->meta.mask_len /= NFP_FL_LW_SIZ; > > + nfp_flow->meta.act_len /= NFP_FL_LW_SIZ; > > better to use use x >>= 2 instead x /= 4 > > I saw it in other places across the

RE: [PATCH 1/1] net sched: Added the TC_LINKLAYER_CUSTOM linklayer type

2017-07-06 Thread David Laight
From: McCabe, Robert J > Sent: 04 July 2017 01:14 > + if (nla_put(skb, TCA_STAB_DATA, sizeof(stab->szopts)*sizeof(u16), > >data)) > + goto nla_put_failure; Multiplying sizeof(a) by sizeof(b) really doesn't look right at all. David

RE: [PATCH v2 0/9] Remove spin_unlock_wait()

2017-07-06 Thread David Laight
From: Paul E. McKenney > Sent: 06 July 2017 00:30 > There is no agreed-upon definition of spin_unlock_wait()'s semantics, > and it appears that all callers could do just as well with a lock/unlock > pair. This series therefore removes spin_unlock_wait() and changes > its users to instead use a

RE: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

2017-06-29 Thread David Laight
From: Jakub Kicinski > Sent: 29 June 2017 07:48 > On Thu, 29 Jun 2017 14:18:07 +0800, Yunsheng Lin wrote: > > > + if (mask_basic->n_proto) { > > cpu_to_be16(mask_basic->n_proto) Should be be16_to_cpu() > > remove cpu_to_be16 in case. > > Thanks, but this is incorrect. Byte swapping constants

RE: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow

2017-04-27 Thread David Laight
From: Jason A. Donenfeld > On Thu, Apr 27, 2017 at 1:30 PM, Sabrina Dubroca wrote: > > Hmm, I think this can actually happen: > > Alright, perhaps better to err on the side of caution, then. You only need to recurse if both pointers are set. David

RE: [PATCH net-next 8/9] ipvlan: improve compiler hints

2017-04-27 Thread David Laight
From: Duyck, Alexander H > Sent: 27 April 2017 16:21 ... > > -unsigned int ipvlan_mac_hash(const unsigned char *addr) > > +inline unsigned int ipvlan_mac_hash(const unsigned char *addr) > > { > > u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2), > >

RE: [PATCH] macsec: avoid heap overflow in skb_to_sgvec

2017-04-24 Thread David Laight
From: Jason A. Donenfeld > Sent: 21 April 2017 22:15 > While this may appear as a humdrum one line change, it's actually quite > important. An sk_buff stores data in three places: > > 1. A linear chunk of allocated memory in skb->data. This is the easiest >one to work with, but it precludes

RE: [PATCH net-next 3/3] samples/bpf: check before defining offsetof

2017-04-25 Thread David Laight
From: Daniel Borkmann > Sent: 24 April 2017 15:41 > To: Alexander Alemayhu; netdev@vger.kernel.org > Cc: a...@fb.com > Subject: Re: [PATCH net-next 3/3] samples/bpf: check before defining offsetof > > On 04/24/2017 03:31 PM, Alexander Alemayhu wrote: > > Fixes the following warning > > > >

RE: [PATCH] iov_iter: don't revert if csum error

2017-04-28 Thread David Laight
From: Sabrina Dubroca > Sent: 28 April 2017 14:17 ... > > if (__skb_checksum_complete(skb)) > > - goto csum_error; > > + goto fault; > > With this patch, skb_copy_and_csum_datagram_msg() will return -EFAULT > for an incorrect checksum, that doesn't

RE: [PATCH net] tcp: avoid bogus gcc-7 array-bounds warning

2017-07-28 Thread David Laight
From: Arnd Bergmann > Sent: 28 July 2017 15:42 ... > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -2202,9 +2202,10 @@ static bool tcp_small_queue_check(struct sock *sk, > const struct sk_buff *skb, > static void tcp_chrono_set(struct tcp_sock *tp, const enum tcp_chrono new) >

RE: [PATCH RFC, iproute2] tc/mirred: Extend the mirred/redirect action to accept additional traffic class parameter

2017-08-01 Thread David Laight
From: Stephen Hemminger > Sent: 01 August 2017 04:52 > On Mon, 31 Jul 2017 17:40:50 -0700 > Amritha Nambiar wrote: > The concept is fine, bu t the code looks different than the rest which > is never a good sign. > > > > + if ((argc > 0) &&

RE: [PATCH net-next 00/10] net: l3mdev: Support for sockets bound to enslaved device

2017-08-01 Thread David Laight
From: David Ahern > Sent: 01 August 2017 04:13 ... > Existing code for socket lookups already pass in 6+ arguments. Rather > than add another for the enslaved device index, the existing lookups > are converted to use a new sk_lookup struct. From there, the enslaved > device index becomes another

RE: [PATCH] ss: Enclose IPv6 address in brackets

2017-08-01 Thread David Laight
From: Florian Lehner > Sent: 29 July 2017 13:29 > This patch adds support for RFC2732 IPv6 address format with brackets > for the tool ss. So output for ss changes from > 2a00:1450:400a:804::200e:443 to [2a00:1450:400a:804::200e]:443 for IPv6 > addresses with attached port number. > >

RE: [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default

2017-08-02 Thread David Laight
From: Timur Tabi > Sent: 02 August 2017 15:22 > On 8/2/17 8:48 AM, David Laight wrote: > > If the nearby switches cannot handle pause frames, then the MAC shouldn't > > be sending them at all. > > There's no way for me to know whether the switches can handle the pause >

RE: [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default

2017-08-02 Thread David Laight
From: Timur Tabi > Sent: 02 August 2017 16:09 > On 08/02/2017 09:51 AM, David Laight wrote: > > Sending pause frames just tells the adjacent switch not to send you packets > > (because you'll discard them). > > Since the idea is to avoid the discards, the switch wil

RE: [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default

2017-08-02 Thread David Laight
From: Timur Tabi > Sent: 01 August 2017 22:38 > The EMAC has a curious qwirk when RX flow control is enabled and the > kernel hangs. With the kernel hung, the EMAC's RX queue soon fills. > If RX flow control is enabled, the EMAC will then send a non-stop > stream of pause frames until the system

RE: [PATCH] Adding Agile-SD TCP module and modifying Kconfig and Makefile

2017-08-02 Thread David Laight
From: mohamedalrshah > Sent: 02 August 2017 05:44 > Published: > Alrshah, M.A., Othman, M., Ali, B. and Hanapi, Z.M., 2015. Agile-SD: a > Linux-based > TCP congestion control algorithm for supporting high-speed and short-distance > networks. > Journal of Network and Computer Applications, 55,

RE: [RFC PATCH v2 0/2] nb8800 suspend/resume support

2017-08-02 Thread David Laight
From: Måns Rullgård > Sent: 02 August 2017 17:10 ... > ping -f is limited to 100 packets per second. Use something like iperf > in UDP mode instead. Or break a MAC driver so it just saturates the network. You might actually need bursts of traffic - otherwise the receiver will be continuously

RE: [PATCH] PCI: Update ACS quirk for more Intel 10G NICs

2017-08-04 Thread David Laight
From: Bjorn Helgaas > Sent: 03 August 2017 22:49 > On Thu, Jul 20, 2017 at 02:41:01PM -0700, Roland Dreier wrote: > > From: Roland Dreier > > > > Add one more variant of the 82599 plus the device IDs for X540 and X550 > > variants. Intel has confirmed that none of these

RE: [PATCH] net: phy: marvell: logical vs bitwise OR typo

2017-08-04 Thread David Laight
From: Dan Carpenter > Sent: 04 August 2017 09:17 > This was supposed to be a bitwise OR but there is a || vs | typo. > > Fixes: 864dc729d528 ("net: phy: marvell: Refactor m88e1121 RGMII delay > configuration") > Signed-off-by: Dan Carpenter > > diff --git

RE: [PATCH v7 2/3] PCI: Enable PCIe Relaxed Ordering if supported

2017-08-07 Thread David Laight
From: Casey Leedom > Sent: 04 August 2017 21:49 ... > Whenever our Hardware Designers implement new functionality in our hardware, > they almost always put in A. several "knobs" which can control fundamental > parameters of the new Hardware Feature, and B. a mechanism of completely > disabling it

RE: [PATCH net-next 03/14] sctp: remove the typedef sctp_scope_policy_t

2017-08-07 Thread David Laight
From: Xin Long > Sent: 05 August 2017 13:00 > This patch is to remove the typedef sctp_scope_policy_t and keep > it's members as an anonymous enum. > > It is also to define SCTP_SCOPE_POLICY_MAX to replace the num 3 > in sysctl.c to make codes clear. > > Signed-off-by: Xin Long

RE: [iproute PATCH v2 2/2] ifcfg: Quote left-hand side of [ ] expression

2017-08-18 Thread David Laight
From: Phil Sutter > Sent: 18 August 2017 12:24 ... > > > -if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then > > > +if [ "`ip link ls $dev | grep -c MULTICAST`" -ge 1 ]; then > > > > You could drag all these scripts into the 1990's by using $(...) > > instead of `...`. > > That's a

RE: [net-next 11/15] net/mlx5e: Properly indent within conditional statements

2017-08-17 Thread David Laight
From: Saeed Mahameed > Sent: 17 August 2017 14:30 > To: David S. Miller > Cc: netdev@vger.kernel.org; Leon Romanovsky; Or Gerlitz; Saeed Mahameed > Subject: [net-next 11/15] net/mlx5e: Properly indent within conditional > statements > > From: Or Gerlitz > > To fix these

RE: [iproute PATCH v2 1/7] ipntable: Make sure filter.name is NULL-terminated

2017-08-18 Thread David Laight
From: Phil Sutter > Sent: 17 August 2017 18:09 > To: Stephen Hemminger > Cc: netdev@vger.kernel.org > Subject: [iproute PATCH v2 1/7] ipntable: Make sure filter.name is > NULL-terminated > > Signed-off-by: Phil Sutter > --- > ip/ipntable.c | 3 ++- > 1 file changed, 2

RE: [iproute PATCH v2 2/3] iproute_lwtunnel: Argument to strerror must be positive

2017-08-18 Thread David Laight
From: Phil Sutter > Sent: 17 August 2017 18:10 > Signed-off-by: Phil Sutter > --- > ip/iproute_lwtunnel.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c > index 398ab5e077ed8..1a3dc4d4c0ed9 100644 > ---

RE: [iproute PATCH v2 4/5] tc/tc_filter: Make sure filter name is not empty

2017-08-18 Thread David Laight
From: Phil Sutter > Sent: 17 August 2017 18:10 > The later check for 'k[0] != 0' requires a non-empty filter name, > otherwise NULL pointer dereference in 'q' might happen. > > Signed-off-by: Phil Sutter > --- > tc/tc_filter.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff

RE: [iproute PATCH v2 2/2] ifcfg: Quote left-hand side of [ ] expression

2017-08-18 Thread David Laight
From: Phil Sutter > Sent: 17 August 2017 18:10 > This prevents word-splitting and therefore leads to more accurate error > message in case 'grep -c' prints something other than a number. > > Signed-off-by: Phil Sutter > --- > ip/ifcfg | 2 +- > 1 file changed, 1 insertion(+), 1

RE: [PATCH 1/3] Fix ERROR: trailing statements should be on next line

2017-05-15 Thread David Laight
From: Alex Williamson > Sent: 15 May 2017 04:21 ... > > > /* Find end of list, sew whole thing into vi->rq.pages. */ > > > - for (end = page; end->private; end = (struct page *)end->private); > > > + for (end = page; end->private; end = (struct page *)end->private) > > > + ; > > FWIW, I

RE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()

2017-05-10 Thread David Laight
From: SF Markus Elfring > Sent: 09 May 2017 15:22 > A bit of data was put into a sequence by two separate function calls. > Print the same data by a single function call instead. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring

RE: bpf pointer alignment validation

2017-05-10 Thread David Laight
From: Alexei Starovoitov > Sent: 10 May 2017 06:58 > > +static u32 calc_align(u32 imm) > > +{ > > + u32 align = 1; > > + > > + if (!imm) > > + return 1U << 31; > > + > > + while (!(imm & 1)) { > > + imm >>= 1; > > + align <<= 1; > > + } > > + return align; >

RE: [PATCH net-next 9/9] nfp: eliminate an if statement in calculation of completed frames

2017-05-17 Thread David Laight
From: Jakub Kicinski > Sent: 16 May 2017 01:55 > Given that our rings are always a power of 2, we can simplify the > calculation of number of completed TX descriptors by using masking > instead of if statement based on whether the index have wrapped > or not. > > Signed-off-by: Jakub Kicinski

RE: sky2: Use seq_putc() in sky2_debug_show()

2017-05-09 Thread David Laight
From: Stephen Hemminger > Sent: 09 May 2017 06:50 > On Mon, 8 May 2017 19:42:46 +0200 > SF Markus Elfring wrote: > > > > Which issue do you mean? I dont see any issue you fix here. > > > > Are the run time characteristics a bit nicer for the function seq_putc > >

RE: [PATCH net-next 1/8] qed: LL2 to use packed information for tx

2017-06-09 Thread David Laight
From: David Miller > Sent: 09 June 2017 00:24 > > From: Yuval Mintz > Date: Thu, 8 Jun 2017 19:13:16 +0300 > > > @@ -67,6 +79,21 @@ struct qed_ll2_stats { > > u64 sent_bcast_pkts; > > }; > > > > +struct qed_ll2_tx_pkt_info { > > + u8 num_of_bds; > > + u16 vlan;

RE: [PATCH net-next 1/8] qed: LL2 to use packed information for tx

2017-06-09 Thread David Laight
From: Mintz, Yuval > Sent: 09 June 2017 08:52 > > From: David Laight [mailto:david.lai...@aculab.com] > > Sent: Friday, June 09, 2017 10:28 AM > > To: 'David Miller' <da...@davemloft.net>; Mintz, Yuval > > <yuval.mi...@cavium.com> > > Cc: netde

RE: [PATCH net-next 09/10] net/mlx4_en: Replace TXBB_SIZE multiplications with shift operations

2017-06-20 Thread David Laight
From: Tariq Toukan > Sent: 15 June 2017 12:36 > Define LOG_TXBB_SIZE, log of TXBB_SIZE, and use it with a shift > operation instead of a multiplication with TXBB_SIZE. > Operations are equivalent as TXBB_SIZE is a power of two. > > Performance tests: > Tested on ConnectX3Pro, Intel(R) Xeon(R) CPU

RE: [PATCH 00/51] rtc: stop using rtc deprecated functions

2017-06-21 Thread David Laight
From: Russell King - ARM Linux > Sent: 20 June 2017 22:16 .. > Consider that at the moment, we define the 32-bit RTC representation to > start at a well known epoch. We _could_ decide that when it wraps to > 0x8000 seconds, we'll define the lower 0x4000 seconds to mean > dates in the

RE: [net-next 11/15] net/mlx5e: Reduce number of heap allocated buffers for update stats

2017-06-20 Thread David Laight
From: Saeed Mahameed > Sent: 15 June 2017 22:43 > Allocating buffers on the heap every 200ms is something we should avoid, > let's use buffers located on the stack instead. ... > + u32 in[MLX5_ST_SZ_DW(ppcnt_reg)] = {0}; How big is that? Allocating large on-stack buffers is even worse. One

RE: remove dma_alloc_noncoherent

2017-06-20 Thread David Laight
From: Christoph Hellwig > Sent: 16 June 2017 08:17 > > For many years we've had the dma_alloc_attrs API that is more flexible > than dma_alloc_noncoherent. This series moves the remaining users over > to the attrs API. And most of the callers probably only want to specify 'noncoherent'. Grepping

RE: Faster TCP keepalive

2017-06-26 Thread David Laight
> From: Stephen Suryaputra Lin > Sent: 23 June 2017 20:58 ... > Suggestions on other ways to quickly tearing down TCP connections to a > rebooted host in the application above are welcomed. Arrange to send an RST for each connection during shutdown. David

RE: [PATCH] net: usb: asix88179_178a: Add support for the Belkin B2B128

2017-06-27 Thread David Laight
From: Andrew F. Davis > Sent: 26 June 2017 18:41 > The Belkin B2B128 is a USB 3.0 Hub + Gigabit Ethernet Adapter, the > Ethernet adapter uses the ASIX AX88179 USB 3.0 to Gigabit Ethernet > chip supported by this driver, add the USB ID for the same. ... I've just had a look at the current version

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Jim Baxter > Sent: 16 May 2017 18:41 > > The CDC-NCM driver can require large amounts of memory to create > skb's and this can be a problem when the memory becomes fragmented. > > This especially affects

RE: [PATCH net-next 9/9] nfp: eliminate an if statement in calculation of completed frames

2017-05-19 Thread David Laight
From: Jakub Kicinski > Sent: 17 May 2017 18:37 .. > > > while (todo--) { > > > idx = D_IDX(tx_ring, tx_ring->rd_p++); > > > > That '++' looks suspicious. > > I think you need to decide whether you are incrementing pointers into the > > ring > > or indexes into it. > > Sometimes it is

RE: [PATCH net-next] cxgb4: fix incorrect cim_la output for T6

2017-05-19 Thread David Laight
From: Ganesh Goudar > Sent: 19 May 2017 11:12 T6 > > take care of UpDbgLaRdPtr[0-3] restriction for T6 > > Signed-off-by: Ganesh Goudar > --- > drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: Bjørn Mork > Sent: 19 May 2017 14:56 ... > Unless someone has a nice way to just collect a list of skbs and have > them converted to proper framing on the fly when transmitting, without > having to care about USB packet boundaries. skb can be linked into arbitrary chains (or even trees),

RE: [PATCH nf-next] netns: add and use net_ns_barrier

2017-06-02 Thread David Laight
From: Florian Westphal > Sent: 30 May 2017 10:38 > > Quoting Joe Stringer: > If a user loads nf_conntrack_ftp, sends FTP traffic through a network > namespace, destroys that namespace then unloads the FTP helper module, > then the kernel will crash. > > Events that lead to the crash: > 1.

RE: [PATCH net-next 10/12] nfp: fix print format for ring pointers in ring dumps

2017-05-31 Thread David Laight
From: Jakub Kicinski > Sent: 28 May 2017 01:34 > Ring pointers are unsigned. Fix the print formats to avoid > showing users negative values. ... > > - seq_printf(file, "RX[%02d,%02d]: cnt=%d dma=%pad host=%p H_RD=%d > H_WR=%d FL_RD=%d FL_WR=%d\n", > + seq_printf(file, "RX[%02d,%02d]:

RE: [patch net-next 3/3] mlxsw: spectrum_router: Align RIF index allocation with existing code

2017-06-06 Thread David Laight
From: Jiri Pirko > Sent: 04 June 2017 15:54 > The way we usually allocate an index is by letting the allocation > function return an error instead of an invalid index. ... > -static int mlxsw_sp_avail_rif_get(struct mlxsw_sp *mlxsw_sp) > +static int mlxsw_sp_rif_index_alloc(struct mlxsw_sp

RE: [PATCH v4 03/11] net: mvmdio: use GENMASK for masks

2017-06-19 Thread David Laight
From: Antoine Tenart > Sent: 14 June 2017 16:49 > Cosmetic patch to use the GENMASK helper for masks. ... > - ret = val & 0x; > + ret = val & GENMASK(15, 0); My 2c: It isn't at all clear to me that changes like this in anyway improve the code readability. In some sense the '15' should

RE: sock_create_kern() and (lack of) get_net()

2017-05-04 Thread David Laight
From: Cong Wang > Sent: 03 May 2017 17:33 > On Wed, May 3, 2017 at 4:39 AM, David Laight <david.lai...@aculab.com> wrote: > > I suspect that many of the sockets created with 'kern=1' are not 'special' > > and should hold a reference to the namespace. > > They a

RE: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-04 Thread David Laight
From: Gavin Shan > Sent: 04 May 2017 07:16 > On Wed, May 03, 2017 at 10:19:44PM -0700, Stephen Hemminger wrote: > >On Wed, 3 May 2017 14:44:35 +1000 > >Gavin Shan wrote: ... > >> +{ > >> + struct ethtool_ncsi_channels *enc; > >> + short nr_channels; > >Should be

RE: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-08 Thread David Laight
From: Christophe JAILLET > Sent: 06 May 2017 06:30 > If 'devm_kzalloc' fails, a NULL pointer will be dereferenced. > Return -ENOMEM instead, as done for some other memory allocation just a > few lines above. ... > --- a/drivers/net/dsa/dsa_loop.c > +++ b/drivers/net/dsa/dsa_loop.c > @@ -256,6

sock_create_kern() and (lack of) get_net()

2017-05-03 Thread David Laight
sock_create_kern() passes 'kern=1' to __sock_create(). sock_create() passes 'kern=0' and uses current->nsproxy->ns_net. The 'kern' parameter is passed to security_socket_create() and security_socket_post_create() - I think this is just checking whether the call is allowed. The 'kern' parameter

RE: Question about SOCK_SEQPACKET

2017-05-05 Thread David Laight
From: Steven Whitehouse > Sent: 05 May 2017 11:34 ... > Just before the part that you've quoted, the description for > SOCK_SEQPACKET says: > "The SOCK_SEQPACKET socket type is similar to the SOCK_STREAM type, and > is also connection-oriented. The only difference between these types is > that

RE: SSE instructions for fast packet copy?

2017-05-05 Thread David Laight
From: Tom Herbert > Sent: 05 May 2017 06:51 > To: Linux Kernel Network Developers > Subject: SSE instructions for fast packet copy? > > Hi, > > I am thinking about the possibility of using SSE in kernel for > speeding up the kernel memcpy particularly for copy to userspace > emeory, and maybe

RE: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-08 Thread David Laight
From: Gavin Shan > Sent: 08 May 2017 01:20 ... > >Why 16 bits? > >You are just making life hard for the compiler and possibly generating > >random padding. > > > > It's because there are 256 NCSI channels to maximal degree. So 16-bits > is the minial data width to hold it in signed format. Yes, I

RE: [PATCH] x86/asm: Don't use rbp as temp register in csum_partial_copy_generic()

2017-05-04 Thread David Laight
From: Josh Poimboeuf > Sent: 04 May 2017 15:52 > Andrey Konovalov reported the following warning while fuzzing the kernel > with syzkaller: > > WARNING: kernel stack regs at 8800686869f8 in a.out:4933 has bad 'bp' > value c3fc855a10167ec0 > > The unwinder dump revealed that rbp had a bad

RE: [PATCH] net_sched: use explicit size of struct tcmsg, remove need to declare tcm

2017-09-18 Thread David Laight
From: Eric Dumazet > Sent: 18 September 2017 16:01 ... > > > - err = nlmsg_parse(nlh, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); > > > + err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX, NULL, NULL); > > > > Would sizeof(*nlmsg_data(nlh)) be cleaner?? > > Not really, since > > static

RE: [PATCH] net_sched: use explicit size of struct tcmsg, remove need to declare tcm

2017-09-18 Thread David Laight
From: Colin King > Sent: 18 September 2017 12:41 > Pointer tcm is being initialized and is never read, it is only being used > to determine the size of struct tcmsg. Clean this up by removing > variable tcm and explicitly using the sizeof struct tcmsg rather than *tcm. > Cleans up clang warning:

RE: [PATCH net-next 05/12] net: dsa: b53: Use a macro to define I/O operations

2017-09-19 Thread David Laight
From: Florian Fainelli > Sent: 18 September 2017 22:41 > Instead of repeating the same pattern: acquire mutex, read/write, release > mutex, define a macro: b53_build_op() which takes the type (read|write), I/O > size, and value (scalar or pointer). This helps with fixing bugs that could > exit

RE: [PATCH net-next 05/12] net: dsa: b53: Use a macro to define I/O operations

2017-09-19 Thread David Laight
> >>> +#define b53_build_op(type, op_size, val_type)\ > >>> +static inline int b53_##type##op_size(struct b53_device *dev, u8 > >page,\ > >>> + u8 reg, val_type val) > >>> \ > >>> +{

RE: [PATCH iproute2 1/3] ss: allow AF_FAMILY constants >32

2017-10-04 Thread David Laight
From: Stefan Hajnoczi > Sent: 04 October 2017 16:01 ... > > > --- a/misc/ss.c > > > +++ b/misc/ss.c > > > @@ -170,55 +170,57 @@ enum { > > > struct filter { > > > int dbs; > > > int states; > > > - int families; > > > + __u64 families; > > > > Since this isn't a value that is coming from

RE: [PATCH net-next v2 1/2] libbpf: parse maps sections of varying size

2017-10-04 Thread David Laight
From: Craig Gallek > Sent: 04 October 2017 14:58 > >> + obj->maps[map_idx].def = *def; > > > > I'm not too happy/comfortable with this way of copying the memory of > > "def" (the type-cased struct bpf_map_def). I guess it works, and is > > part of the C-standard(?). > > I

RE: [patch net-next 2/4] net: sched: introduce per-egress action device callbacks

2017-10-10 Thread David Laight
From: Jiri Pirko > Sent: 10 October 2017 08:30 > Introduce infrastructure that allows drivers to register callbacks that > are called whenever tc would offload inserted rule and specified device > acts as tc action egress device. How does a driver safely unregister a callback? (to avoid a race

RE: [net-next 05/14] i40e/i40evf: always set the CLEARPBA flag when re-enabling interrupts

2017-10-10 Thread David Laight
From: Jeff Kirsher > Sent: 09 October 2017 23:39 > In the past we changed driver behavior to not clear the PBA when > re-enabling interrupts. This change was motivated by the flawed belief > that clearing the PBA would cause a lost interrupt if a receive > interrupt occurred while interrupts were

RE: [patch net-next 2/4] net: sched: introduce per-egress action device callbacks

2017-10-10 Thread David Laight
From: Jiri Pirko > Sent: 10 October 2017 15:32 > To: David Laight > Cc: netdev@vger.kernel.org; da...@davemloft.net; j...@mojatatu.com; > xiyou.wangc...@gmail.com; > sae...@mellanox.com; mat...@mellanox.com; leo...@mellanox.com; > ml...@mellanox.com > Subject: Re: [patch net

RE: [PATCH net-next v2 2/4] net: dsa: mv88e6060: setup random mac address

2017-10-16 Thread David Laight
From: woojung@microchip.com > Sent: 13 October 2017 18:59 > > >> > + REG_WRITE(REG_GLOBAL, GLOBAL_MAC_01, (addr[0] << 9) | > > >> addr[1]); > > >> > > >> Is that supposed to be 9 ? > > > > > > Looks like it. > > > Check > >

RE: [PATCH net-next v3 3/5] net: dsa: mv88e6060: setup random mac address

2017-10-16 Thread David Laight
From: Vivien Didelot > Sent: 13 October 2017 19:18 > As for mv88e6xxx, setup the switch from within the mv88e6060 driver with > a random MAC address, and remove the .set_addr implementation. > > Signed-off-by: Vivien Didelot > --- >

RE: [next-queue PATCH v7 4/6] net/sched: Introduce Credit Based Shaper (CBS) qdisc

2017-10-16 Thread David Laight
From: Ivan Khoronzhuk > Sent: 13 October 2017 20:59 > On Thu, Oct 12, 2017 at 05:40:03PM -0700, Vinicius Costa Gomes wrote: > > This queueing discipline implements the shaper algorithm defined by > > the 802.1Q-2014 Section 8.6.8.2 and detailed in Annex L. > > > > It's primary usage is to apply

RE: [net-next 6/9] e1000e: fix buffer overrun while the I219 is processing DMA transactions

2017-10-16 Thread David Laight
From: Neftin, Sasha > Sent: 16 October 2017 11:40 > On 10/11/2017 12:07, David Laight wrote: > > From: Jeff Kirsher > >> Sent: 10 October 2017 18:22 > >> Intel 100/200 Series Chipset platforms reduced the round-trip > >> latency for the LAN Contro

RE: [PATCH net-next 00/10] korina cleanups/optimizations

2017-10-16 Thread David Laight
From: Roman Yeryomin > Sent: 15 October 2017 17:22 > TX optimizations have led to ~15% performance increase (35->40Mbps) > in local tx usecase (tested with iperf v3.2). Indicate which patches give the improvement. IIRC some just changed the source without changing what the code really did. (Not a

RE: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-05 Thread David Laight
From: William Tu > Sent: 05 October 2017 01:14 > Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device > is the length of the whole ether packet. So skb->len should subtract > the dev->hard_header_len. > > Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") >

RE: [PATCH] rsi: fix integer overflow warning

2017-10-05 Thread David Laight
From: Joe Perches > Sent: 05 October 2017 13:19 > On Thu, 2017-10-05 at 14:05 +0200, Arnd Bergmann wrote: > > gcc produces a harmless warning about a recently introduced > > signed integer overflow: > > > > drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_prepare_mgmt_desc': > >

RE: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread David Laight
From: William Tu > Sent: 05 October 2017 22:21 ... > >> - if (skb->len > dev->mtu) { > >> + if (skb->len - dev->hard_header_len > dev->mtu) { > > > > Can you guarantee that skb->len > dev_hard_header_len? > > It is probably safer to check skb->len > dev->hard_header_len + dev->mtu > >

RE: [PATCH net-next v3 0/5] net: dsa: remove .set_addr

2017-10-16 Thread David Laight
From: Andrew Lunn > Sent: 16 October 2017 17:10 ... > So, received Pause frames never leave the MAC. They don't get bridged, > nor do they get passed up for host processing. They are purely point > to point between two MAC peers. The destination is unambiguous. It is > simple the other MAC peer.

RE: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-17 Thread David Laight
From: Daniel Borkmann > Sent: 17 October 2017 15:56 > > The set fixes a splat in devmap percpu allocation when we alloc > the flush bitmap. Patch 1 is a prerequisite for the fix in patch 2, > patch 1 is rather small, so if this could be routed via -net, for > example, with Tejun's Ack that would

<    1   2   3   4   5   6   7   >