Re: wl1251 & mac address & calibration data

2016-12-15 Thread Daniel Wagner
On 12/16/2016 03:03 AM, Luis R. Rodriguez wrote: For the new API a solution for "fallback mechanisms" should be clean though and I am looking to stay as far as possible from the existing mess. A solution to help both the old API and new API is possible for the "fallback mechanism" though -- but f

[PATCH RFC] liquidio: make timeout HZ independent

2016-12-15 Thread Nicholas Mc Guire
schedule_timeout_* takes a timeout in jiffies but the code currently is passing in a constant which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. Fixes: commit b0d66369edcd ("liquidio VF error handling") Signed-off-by: Nicholas Mc Guire --- Problem found

Re: [PATCH] net: wan: Use dma_pool_zalloc

2016-12-15 Thread Souptick Joarder
On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches wrote: > On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote: >> On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder >> wrote: >> > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa wrote: >> > > Souptick Joarder writes: >> > > >> > > > We shou

Re: [PATCH] net: wan: Use dma_pool_zalloc

2016-12-15 Thread Joe Perches
On Fri, 2016-12-16 at 11:33 +0530, Souptick Joarder wrote: > On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches wrote: > > On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote: > > > On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder > > > wrote: > > > > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof

Re: [RFC v2 03/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) netdev

2016-12-15 Thread Jason Gunthorpe
On Thu, Dec 15, 2016 at 06:59:47PM -0800, Vishwanathapura, Niranjana wrote: > We have made the hfi_vnic driver dependent on CONFIG_X86_64. Er, don't do that either? > >>+struct __hfi_vesw_info { > >>+ u16 fabric_id; > >>+ u16 vesw_id; > >>+ > >>+ u8 rsvd0[6]; > >>+ u16 def_port_mask;

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Jason Gunthorpe
On Thu, Dec 15, 2016 at 08:24:05PM -0500, ira.weiny wrote: > > The main share is the 'skb send' part, we've talked about hoisting > > that out of ipoib in the past anyhow. A generic verb along those lines > > would probably allow the sdma optimization for hfi for both this new > > ulp and ipoib wit

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Vishwanathapura, Niranjana
On Thu, Dec 15, 2016 at 09:56:11AM -0700, Jason Gunthorpe wrote: On Wed, Dec 14, 2016 at 11:59:32PM -0800, Vishwanathapura, Niranjana wrote: create mode 100644 drivers/infiniband/sw/intel/hfi_vnic/Kconfig create mode 100644 drivers/infiniband/sw/intel/hfi_vnic/Makefile Stil NAK on these path

[PATCH v3 net] r6040: move spinlock in r6040_close as SOFTIRQ-unsafe lock order detected

2016-12-15 Thread Manuel Bessler
'ifconfig eth0 down' makes r6040_close() trigger: INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue() to outside of the module's private spin_lock_irq block. Found on a Versalogic Tomcat SBC with a Vortex86 SoC s1660e_

Re: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-15 Thread George Spelvin
Jean-Philippe Aumasson wrote: > If a halved version of SipHash can bring significant performance boost > (with 32b words instead of 64b words) with an acceptable security level > (64-bit enough?) then we may design such a version. It would be fairly significant, a 2x speed benefit on a lot of 32-b

Re: [PATCH] net: ipv4: tcp_offload: check segs for NULL

2016-12-15 Thread Eric Dumazet
On Thu, 2016-12-15 at 14:17 +0530, shakya@samsung.com wrote: > From: Shakya Sundar Das > > This patch will check segs for being NULL in tcp_gso_segment() > before calling skb_shinfo(segs) from skb_is_gso(segs), otherwise > kernel can run into a NULL-pointer dereference. > > Signed-off-by: Sh

[PATCH v6 0/5] The SipHash Patchset

2016-12-15 Thread Jason A. Donenfeld
Hey again, This keeps getting more ambitious, which is good I suppose. If the frequency of new versioned patchsets is too high for LKML and not customary, please let me know. Otherwise, read on to see what's new this time... With Hannes' suggestion, there is now only one siphash() function, which

[PATCH v6 4/5] md5: remove from lib and only live in crypto

2016-12-15 Thread Jason A. Donenfeld
The md5_transform function is no longer used any where in the tree, except for the crypto api's actual implementation of md5, so we can drop the function from lib and put it as a static function of the crypto file, where it belongs. There should be no new users of md5_transform, anyway, since there

[PATCH v6 5/5] syncookies: use SipHash in place of SHA1

2016-12-15 Thread Jason A. Donenfeld
SHA1 is slower and less secure than SipHash, and so replacing syncookie generation with SipHash makes natural sense. Some BSDs have been doing this for several years in fact. Signed-off-by: Jason A. Donenfeld --- net/ipv4/syncookies.c | 20 net/ipv6/syncookies.c | 37 +++

[PATCH v6 3/5] random: use SipHash in place of MD5

2016-12-15 Thread Jason A. Donenfeld
This duplicates the current algorithm for get_random_int/long, but uses siphash instead. This comes with several benefits. It's certainly faster and more cryptographically secure than MD5. This patch also separates hashed fields into three values instead of one, in order to increase diffusion. The

[PATCH v6 2/5] secure_seq: use SipHash in place of MD5

2016-12-15 Thread Jason A. Donenfeld
This gives a clear speed and security improvement. Siphash is both faster and is more solid crypto than the aging MD5. Rather than manually filling MD5 buffers, for IPv6, we simply create a layout by a simple anonymous struct, for which gcc generates rather efficient code. For IPv4, we pass the va

[PATCH v6 1/5] siphash: add cryptographically secure PRF

2016-12-15 Thread Jason A. Donenfeld
SipHash is a 64-bit keyed hash function that is actually a cryptographically secure PRF, like HMAC. Except SipHash is super fast, and is meant to be used as a hashtable keyed lookup function, or as a general PRF for short input use cases, such as sequence numbers or RNG chaining. For the first usa

Re: [RFC v2 03/10] IB/hfi-vnic: Virtual Network Interface Controller (VNIC) netdev

2016-12-15 Thread Vishwanathapura, Niranjana
On Thu, Dec 15, 2016 at 10:01:09AM -0700, Jason Gunthorpe wrote: On Wed, Dec 14, 2016 at 11:59:35PM -0800, Vishwanathapura, Niranjana wrote: +/** + * union hfi_vnic_bypass_hdr - VNIC bypass header + * @slid: source lid + * @length: length of packet + * @becn: backward explicit congestion notific

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Vishwanathapura, Niranjana
On Thu, Dec 15, 2016 at 10:07:13AM -0700, Jason Gunthorpe wrote: On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote: 1) Since your intent is to make this work with multiple versions of the hfi drivers, I disagree with Jason that just because there is only one driver today that we shou

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Vishwanathapura, Niranjana
On Thu, Dec 15, 2016 at 08:24:05PM -0500, ira.weiny wrote: On Thu, Dec 15, 2016 at 11:48:37AM -0700, Jason Gunthorpe wrote: On Thu, Dec 15, 2016 at 01:19:18PM -0500, Doug Ledford wrote: > On 12/15/2016 12:07 PM, Jason Gunthorpe wrote: > > On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wr

Re: [PULL] virtio, vhost: new device, fixes, speedups

2016-12-15 Thread Linus Torvalds
On Thu, Dec 15, 2016 at 3:05 PM, Michael S. Tsirkin wrote: > > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus Pulled, but I wonder... > Documentation/translations/zh_CN/sparse.txt| 7 +- > arch/arm/plat-samsung/include/plat/gpio-cfg.h | 2 +- > dri

Re: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-15 Thread kbuild test robot
Hi Jason, [auto build test ERROR on linus/master] [also build test ERROR on v4.9 next-20161215] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Jason-A-Donenfeld/siphash-add-cryptographically

Re: [PATCH v2 net-next 1/2] phy: add phy fixup unregister functions

2016-12-15 Thread Dongpo Li
On 2016/12/14 23:34, woojung@microchip.com wrote: >> I just want to commit the unregister patch and found this patch. Good job! >> But I consider this patch may miss something. >> If one SoC has 2 MAC ports and each port uses the different network driver, >> the 2 drivers may register fixup fo

Re: wl1251 & mac address & calibration data

2016-12-15 Thread Luis R. Rodriguez
On Thu, Dec 15, 2016 at 2:12 PM, Arend Van Spriel wrote: > On 15-12-2016 16:33, Pali Rohár wrote: >> On Thu Dec 15 09:18:44 2016 Kalle Valo wrote: >>> (Adding Luis because he has been working on request_firmware() lately) >>> >>> Pali Rohár writes: >>> >> So no, there is no argument against.

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Joe Stringer
On 15 December 2016 at 14:00, Joe Stringer wrote: > On 15 December 2016 at 10:34, Arnaldo Carvalho de Melo > wrote: >> Em Thu, Dec 15, 2016 at 03:29:18PM -0300, Arnaldo Carvalho de Melo escreveu: >>> Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu: >>> > Em Wed, Dec 1

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread ira.weiny
On Thu, Dec 15, 2016 at 11:48:37AM -0700, Jason Gunthorpe wrote: > On Thu, Dec 15, 2016 at 01:19:18PM -0500, Doug Ledford wrote: > > On 12/15/2016 12:07 PM, Jason Gunthorpe wrote: > > > On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote: > > > > > >> 1) Since your intent is to make this

Re: [PATCH 3/3] nfc: trf7970a: Prevent repeated polling from crashing the kernel

2016-12-15 Thread Mark Greer
On Thu, Dec 15, 2016 at 05:30:44PM -0500, Geoff Lansberry wrote: > From: Jaret Cantu > > Repeated polling attempts cause a NULL dereference error to occur. > This is because the curent state of the trf7970a is reading but > a request has been made to send a command. > > The solution is to proper

Re: [PATCH 2/3] NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage

2016-12-15 Thread Mark Greer
On Thu, Dec 15, 2016 at 05:30:43PM -0500, Geoff Lansberry wrote: > From: Geoff Lansberry Missing commit description. > diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c > index 2d2a077..b4c37ab 100644 > --- a/drivers/nfc/trf7970a.c > +++ b/drivers/nfc/trf7970a.c > @@ -1048,6 +1049,11

Re: [PATCH 1/3] NFC: trf7970a: add device tree option for 27MHz clock

2016-12-15 Thread Mark Greer
Hi Geoff. On Thu, Dec 15, 2016 at 05:30:42PM -0500, Geoff Lansberry wrote: > From: Geoff Lansberry Please add an informative commit description to all of your commits. No matter how trivial this patch may seem to you now, it may not be to others (or to you in a few years). > diff --git a/driver

Re: Soft lockup in inet_put_port on 4.6

2016-12-15 Thread Hannes Frederic Sowa
Hi Josef, On 15.12.2016 19:53, Josef Bacik wrote: > On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert wrote: >> On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek >> wrote: >>> On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert >>> wrote: I think there may be some suspicious code in inet_csk_get_port. A

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Hannes Frederic Sowa
On 16.12.2016 00:43, Jason A. Donenfeld wrote: > Hi Hannes, > > Good news. > > On Thu, Dec 15, 2016 at 10:45 PM, Hannes Frederic Sowa > wrote: >>> How's that sound? >> >> I am still very much concerned about the API. > > Thanks for pushing me and putting up with my daftness... the constant > fo

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
On Thu, Dec 15, 2016 at 10:45 PM, Hannes Frederic Sowa wrote: > By the way, if you target net-next, it is currently closed. So no need > to hurry. Honestly I have no idea what I'm targeting. The hash function touches lib/. The secure_seq stuff touches net/. The rng stuff touches random.c. Shall t

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
Hi Hannes, Good news. On Thu, Dec 15, 2016 at 10:45 PM, Hannes Frederic Sowa wrote: >> How's that sound? > > I am still very much concerned about the API. Thanks for pushing me and putting up with my daftness... the constant folding works absolutely perfectly. I've run several tests. When gcc k

Re: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-15 Thread George Spelvin
> If a halved version of SipHash can bring significant performance boost > (with 32b words instead of 64b words) with an acceptable security level > (64-bit enough?) then we may design such a version. I was thinking if the key could be pushed to 80 bits, that would be nice, but honestly 64 bits is

Re: Soft lockup in inet_put_port on 4.6

2016-12-15 Thread Craig Gallek
On Thu, Dec 15, 2016 at 5:39 PM, Tom Herbert wrote: > On Thu, Dec 15, 2016 at 10:53 AM, Josef Bacik wrote: >> On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert wrote: >>> >>> On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek >>> wrote: On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert wrote:

Re: [net-next PATCH v6 0/5] XDP for virtio_net

2016-12-15 Thread Michael S. Tsirkin
On Thu, Dec 15, 2016 at 12:12:04PM -0800, John Fastabend wrote: > This implements virtio_net for the mergeable buffers and big_packet > modes. I tested this with vhost_net running on qemu and did not see > any issues. For testing num_buf > 1 I added a hack to vhost driver > to only but 100 bytes pe

Re: [PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-15 Thread George Spelvin
> While SipHash is extremely fast for a cryptographically secure function, > it is likely a tiny bit slower than the insecure jhash, and so replacements > will be evaluated on a case-by-case basis based on whether or not the > difference in speed is negligible and whether or not the current jhash u

Re: Soft lockup in inet_put_port on 4.6

2016-12-15 Thread Tom Herbert
On Thu, Dec 15, 2016 at 10:53 AM, Josef Bacik wrote: > On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert wrote: >> >> On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek >> wrote: >>> >>> On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert >>> wrote: I think there may be some suspicious code in inet_

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
On 15.12.2016 22:32, Lino Sanfilippo wrote: > Ah ok. Then maybe priv->hw->dma->stop_tx() does not do the job correctly > (stop the > tx path properly) and the HW is still active on the tx path while the tx > buffers are > freed. OTOH stmmac_release() also stops the phy before the tx (and rx) pat

[PATCH 3/3] nfc: trf7970a: Prevent repeated polling from crashing the kernel

2016-12-15 Thread Geoff Lansberry
From: Jaret Cantu Repeated polling attempts cause a NULL dereference error to occur. This is because the curent state of the trf7970a is reading but a request has been made to send a command. The solution is to properly kill the waiting reading (workqueue) before failing on the send. --- driver

[PATCH 1/3] NFC: trf7970a: add device tree option for 27MHz clock

2016-12-15 Thread Geoff Lansberry
From: Geoff Lansberry --- .../devicetree/bindings/net/nfc/trf7970a.txt | 3 ++ drivers/nfc/trf7970a.c | 42 -- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documen

[PATCH 2/3] NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage

2016-12-15 Thread Geoff Lansberry
From: Geoff Lansberry --- Documentation/devicetree/bindings/net/nfc/trf7970a.txt | 2 ++ drivers/nfc/trf7970a.c | 13 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documentat

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Peter Zijlstra
On Thu, Dec 15, 2016 at 09:43:04PM +0100, Jason A. Donenfeld wrote: > On Thu, Dec 15, 2016 at 9:31 PM, Hannes Frederic Sowa > wrote: > > ARM64 and x86-64 have memory operations that are not vector operations > > that operate on 128 bit memory. > > Fair enough. imull I guess. imull is into rdx:ra

Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-15 Thread Pavel Machek
Hi! > >> The driver uses a private lock for synchronization of the xmit function and > >> the xmit completion handler, but since the NETIF_F_LLTX flag is not set, > >> the xmit function is also called with the xmit_lock held. > >> > >> On the other hand the completion handler uses the reverse loc

Re: [PATCH net] ibmveth: calculate gso_segs for large packets

2016-12-15 Thread Jonathan Maxwell
On Wed, Dec 14, 2016 at 11:15 AM, Thomas Falcon wrote: > Include calculations to compute the number of segments > that comprise an aggregated large packet. > > Signed-off-by: Thomas Falcon Reviewed-by: Jonathan Maxwell > --- > drivers/net/ethernet/ibm/ibmveth.c | 12 ++-- > 1 file cha

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Joe Stringer
On 15 December 2016 at 10:34, Arnaldo Carvalho de Melo wrote: > Em Thu, Dec 15, 2016 at 03:29:18PM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu: >> > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: >> > >

Re: [PATCH] net: sfc: use new api ethtool_{get|set}_link_ksettings

2016-12-15 Thread Philippe Reynes
Hi Jarod, On 12/15/16, Jarod Wilson wrote: > On 2016-12-14 6:12 PM, Philippe Reynes wrote: >> The ethtool api {get|set}_settings is deprecated. >> We move this driver to new api {get|set}_link_ksettings. >> >> Signed-off-by: Philippe Reynes >> --- >> drivers/net/ethernet/sfc/ethtool.c| 35

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Hannes Frederic Sowa
On 15.12.2016 22:25, Jason A. Donenfeld wrote: > On Thu, Dec 15, 2016 at 10:17 PM, Hannes Frederic Sowa > wrote: >> And I was exactly questioning this. >> >> static unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, >> const struct in6_addr *d

[PATCH 2/2] gtp: Fix initialization of Flags octet in GTPv1 header

2016-12-15 Thread Pablo Neira Ayuso
From: Harald Welte When generating a GTPv1 header in gtp1_push_header(), initialize the 'reserved' bit to zero. All 3GPP specifications for GTPv1 from Release 99 through Release 13 agree that a transmitter shall set this bit to zero, see e.g. Note 0 of Figure 2 in Section 6 of 3GPP TS 29.060 v13

[PATCH 0/2] GTP tunneling fixes for net

2016-12-15 Thread Pablo Neira Ayuso
Hi David, The following patchset contains two GTP tunneling fixes for your net tree, they are: 1) Offset to IPv4 header in gtp_check_src_ms_ipv4() is incorrect, thus this function always succeeds and therefore this defeats this sanity check. This allows packets that have no PDP to go though

[PATCH 1/2] gtp: gtp_check_src_ms_ipv4() always return success

2016-12-15 Thread Pablo Neira Ayuso
From: Lionel Gauthier gtp_check_src_ms_ipv4() did not find the PDP context matching with the UE IP address because the memory location is not right, but the result is inverted by the Boolean "not" operator. So whatever is the PDP context, any call to this function is successful. Signed-off-by:

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
On 15.12.2016 22:03, Pavel Machek wrote: > > I actually did experiment with adding locking there, too, and no, no > luck. It seems stmmac_tx_err() is more broken than just locking. > Ah ok. Then maybe priv->hw->dma->stop_tx() does not do the job correctly (stop the tx path properly) and the HW

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
On Thu, Dec 15, 2016 at 10:17 PM, Hannes Frederic Sowa wrote: > And I was exactly questioning this. > > static unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, > const struct in6_addr *daddr) > { > net_get_random_once(&ip6_frags.rnd,

[net-next PATCH v6 4/5] virtio_net: add XDP_TX support

2016-12-15 Thread John Fastabend
This adds support for the XDP_TX action to virtio_net. When an XDP program is run and returns the XDP_TX action the virtio_net XDP implementation will transmit the packet on a TX queue that aligns with the current CPU that the XDP packet was processed on. Before sending the packet the header is ze

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Hannes Frederic Sowa
On 15.12.2016 21:43, Jason A. Donenfeld wrote: > On Thu, Dec 15, 2016 at 9:31 PM, Hannes Frederic Sowa > wrote: >> ARM64 and x86-64 have memory operations that are not vector operations >> that operate on 128 bit memory. > > Fair enough. imull I guess. > >> How do you know that the compiler for

Re: [kernel-hardening] Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
On Thu, Dec 15, 2016 at 10:14 PM, Linus Torvalds wrote: > I think you can/should just use the natural alignment for "u64". > > For architectures that need 8-byte alignment, u64 will already be > properly aligned. For architectures (like x86-32) that only need > 4-byte alignment, you get it. I sho

Re: [kernel-hardening] Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Linus Torvalds
On Thu, Dec 15, 2016 at 1:11 PM, Jason A. Donenfeld wrote: > > Indeed, I stand corrected. But in any case, the use of __aligned(8) in > the patchset ensures that things are fixed and that we don't have this > issue. I think you can/should just use the natural alignment for "u64". For architectur

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Pavel Machek
Hi! > sorry for the late reply. No problem. Thanks for the help. > On 11.12.2016 21:11, Pavel Machek wrote: > > > > Do you understand what stmmac_tx_err(priv); is supposed to do? In > > particular, if it is called while the driver is working ok -- should > > the driver survive that? > > As far

Re: [kernel-hardening] Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
On Thu, Dec 15, 2016 at 10:09 PM, Peter Zijlstra wrote: > On Thu, Dec 15, 2016 at 07:50:36PM +0100, Jason A. Donenfeld wrote: >> There's no 32-bit platform >> that will trap on a 64-bit unaligned access because there's no such >> thing as a 64-bit access there. In short, we're fine. > > ARMv7 LPAE

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Hannes Frederic Sowa
On 15.12.2016 22:04, Peter Zijlstra wrote: > On Thu, Dec 15, 2016 at 09:43:04PM +0100, Jason A. Donenfeld wrote: >> On Thu, Dec 15, 2016 at 9:31 PM, Hannes Frederic Sowa >> wrote: >>> ARM64 and x86-64 have memory operations that are not vector operations >>> that operate on 128 bit memory. >> >> F

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Peter Zijlstra
On Thu, Dec 15, 2016 at 07:50:36PM +0100, Jason A. Donenfeld wrote: > There's no 32-bit platform > that will trap on a 64-bit unaligned access because there's no such > thing as a 64-bit access there. In short, we're fine. ARMv7 LPAE is a 32bit architecture that has 64bit load/stores IIRC. x86 ha

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
On Thu, Dec 15, 2016 at 9:31 PM, Hannes Frederic Sowa wrote: > ARM64 and x86-64 have memory operations that are not vector operations > that operate on 128 bit memory. Fair enough. imull I guess. > How do you know that the compiler for some architecture will not chose a > more optimized instruct

[PATCH v5 1/4] siphash: add cryptographically secure PRF

2016-12-15 Thread Jason A. Donenfeld
SipHash is a 64-bit keyed hash function that is actually a cryptographically secure PRF, like HMAC. Except SipHash is super fast, and is meant to be used as a hashtable keyed lookup function, or as a general PRF for short input use cases, such as sequence numbers or RNG chaining. For the first usa

[net-next PATCH v6 2/5] virtio_net: Add XDP support

2016-12-15 Thread John Fastabend
From: John Fastabend This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. Second the MTU must be less than a page size to avoid having t

[net-next PATCH v6 3/5] virtio_net: add dedicated XDP transmit queues

2016-12-15 Thread John Fastabend
XDP requires using isolated transmit queues to avoid interference with normal networking stack (BQL, NETDEV_TX_BUSY, etc). This patch adds a XDP queue per cpu when a XDP program is loaded and does not expose the queues to the OS via the normal API call to netif_set_real_num_tx_queues(). This way th

[PATCH v5 2/4] siphash: add Nu{32,64} helpers

2016-12-15 Thread Jason A. Donenfeld
These restore parity with the jhash interface by providing high performance helpers for common input sizes. Signed-off-by: Jason A. Donenfeld Cc: Tom Herbert --- include/linux/siphash.h | 33 ++ lib/siphash.c | 157 +--- lib/test_si

[PATCH v5 3/4] secure_seq: use SipHash in place of MD5

2016-12-15 Thread Jason A. Donenfeld
This gives a clear speed and security improvement. Siphash is both faster and is more solid crypto than the aging MD5. Rather than manually filling MD5 buffers, for IPv6, we simply create a layout by a simple anonymous struct, for which gcc generates rather efficient code. For IPv4, we pass the va

[net-next PATCH v6 1/5] net: xdp: add invalid buffer warning

2016-12-15 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend --- includ

[PATCH net] sfc: skip ptp allocations on secondary interfaces

2016-12-15 Thread Jarod Wilson
Rather than allocating efx_ptp_data, a buffer, a workqueue, etc., and then ultimately deciding not to call ptp_clock_register() for non-primary interfaces, just exit out of efx_ptp_prober() earlier. Saves a little memory and speeds up init and teardown slightly. CC: linux-net-driv...@solarflare.co

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Hannes Frederic Sowa
Hello, On 15.12.2016 19:50, Jason A. Donenfeld wrote: > Hi David & Hannes, > > This conversation is veering off course. Why? > I think this doesn't really > matter at all. Gcc converts u64 into essentially a pair of u32 on > 32-bit platforms, so the alignment requirements for 32-bit is at a > m

[PATCH v5 4/4] random: use SipHash in place of MD5

2016-12-15 Thread Jason A. Donenfeld
This duplicates the current algorithm for get_random_int/long, but uses siphash instead. This comes with several benefits. It's certainly faster and more cryptographically secure than MD5. This patch also separates hashed fields into three values instead of one, in order to increase diffusion. The

[PATCH v5 0/4] The SipHash Patchset

2016-12-15 Thread Jason A. Donenfeld
Hey folks, I think we're approaching the end of the review for this patchset and we're getting somewhat close to being ready for it being queued up. At this point, I've incorporated all of the extremely helpful and instructive suggestions from the list. For this v5, we now accept u64[2] as the ke

Re: [PATCH 8/8] Makefile: drop -D__CHECK_ENDIAN__ from cflags

2016-12-15 Thread Arend Van Spriel
On 15-12-2016 6:15, Michael S. Tsirkin wrote: > That's the default now, no need for makefiles to set it. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/bluetooth/Makefile| 2 -- > drivers/net/can/Makefile | 1 - > drivers/ne

[net-next PATCH v6 5/5] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-12-15 Thread John Fastabend
virtio_net XDP support expects receive buffers to be contiguous. If this is not the case we enable a slowpath to allow connectivity to continue but at a significan performance overhead associated with linearizing data. To make it painfully aware to users that XDP is running in a degraded mode we th

[net-next PATCH v6 0/5] XDP for virtio_net

2016-12-15 Thread John Fastabend
This implements virtio_net for the mergeable buffers and big_packet modes. I tested this with vhost_net running on qemu and did not see any issues. For testing num_buf > 1 I added a hack to vhost driver to only but 100 bytes per buffer. There are some restrictions for XDP to be enabled and work we

Re: wl1251 & mac address & calibration data

2016-12-15 Thread Arend Van Spriel
On 15-12-2016 16:33, Pali Rohár wrote: > On Thu Dec 15 09:18:44 2016 Kalle Valo wrote: >> (Adding Luis because he has been working on request_firmware() lately) >> >> Pali Rohár writes: >> > So no, there is no argument against... request_firmware() in > fallback mode with userspace helper

[PATCH iproute2 2/4] ip vrf: Refactor ipvrf_identify

2016-12-15 Thread David Ahern
Split ipvrf_identify into arg processing and a function that does the actual cgroup file parsing. The latter function is used in a follow on patch. In the process, convert the reading of the cgroups file to use fopen and fgets just in case the file ever grows beyond 4k. Move printing of any error

[PATCH iproute2 1/4] ip vrf: Move kernel config hint to prog_load failure

2016-12-15 Thread David Ahern
Move the hint about CGROUP_BPF enabled to prog_load failure since it fails before the attach. Update the existing error message to print to stderr. Signed-off-by: David Ahern --- ip/ipvrf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ip/ipvrf.c b/ip/ipvrf.c index 4d5

[PATCH iproute2 0/4] ip vrf fixups

2016-12-15 Thread David Ahern
Some minor cleanups to the 'ip vrf' command. Patch 1 moves the CGROUP_BPF hint to the failure of prog_load since it fails first. Patch 2 refactors ipvrf_identify. The action part is moved to a function that can be used standalone and in the process flipped to fopen/fgets for robustness should the

[PATCH iproute2 4/4] ip netns: Reset vrf to default VRF on namespace switch

2016-12-15 Thread David Ahern
A vrf is local to a namespace. Drop any VRF association before trying to exec a command in the new namespace. Signed-off-by: David Ahern --- ip/ip_common.h | 1 + ip/ipnetns.c | 5 + ip/ipvrf.c | 14 ++ 3 files changed, 20 insertions(+) diff --git a/ip/ip_common.h b/ip/i

[PATCH iproute2 3/4] ip vrf: Fix reset to default VRF

2016-12-15 Thread David Ahern
Path in vrf_switch for "default" VRF is supposed to be MNT/vrf not MNT/default. Also, default_vrf flag is redundant with ifindex. Remove the flag in favor of ifindex != 0. Signed-off-by: David Ahern --- ip/ipvrf.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git

Re: [PATCH] net: sfc: use new api ethtool_{get|set}_link_ksettings

2016-12-15 Thread Jarod Wilson
On 2016-12-14 6:12 PM, Philippe Reynes wrote: The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/sfc/ethtool.c| 35 --- drivers/net/ethernet/sfc/mcdi_port.c |

Re: [PATCH v2 net] rebased to master

2016-12-15 Thread Florian Fainelli
On 12/15/2016 10:21 AM, Manuel Bessler wrote: > 'ifconfig eth0 down' makes r6040_close() trigger: > INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected > > Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue() > to outside of the module's private spin_lock_irq block. > > F

Re: [PATCH 5/8] linux: drop __bitwise__ everywhere

2016-12-15 Thread Lee Duncan
On 12/14/2016 09:15 PM, Michael S. Tsirkin wrote: > __bitwise__ used to mean "yes, please enable sparse checks > unconditionally", but now that we dropped __CHECK_ENDIAN__ > __bitwise is exactly the same. > There aren't many users, replace it by __bitwise everywhere. > > Signed-off-by: Michael S.

Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi, On 15.12.2016 10:45, Pavel Machek wrote: > Hi! > >> The driver uses a private lock for synchronization of the xmit function and >> the xmit completion handler, but since the NETIF_F_LLTX flag is not set, >> the xmit function is also called with the xmit_lock held. >> >> On the other hand the

Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi, On 15.12.2016 19:52, Niklas Cassel wrote: > Since v1 of this patch has already been merged to net-next, I think that > you should create a new patch on top of that, rather than submitting a v2. > > http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/drivers/net/ethernet/stmi

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi Pavel, sorry for the late reply. On 11.12.2016 21:11, Pavel Machek wrote: > > Do you understand what stmmac_tx_err(priv); is supposed to do? In > particular, if it is called while the driver is working ok -- should > the driver survive that? As far as I understood it is supposed to fixup an

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Arnaldo Carvalho de Melo
Em Thu, Dec 15, 2016 at 10:29:19AM -0800, Joe Stringer escreveu: > On 15 December 2016 at 07:50, Arnaldo Carvalho de Melo > wrote: > > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: > >> Now that libbpf under tools/lib/bpf/* is synced with the version from > >> samples/bpf, we c

Re: Soft lockup in inet_put_port on 4.6

2016-12-15 Thread Josef Bacik
On Tue, Dec 13, 2016 at 6:32 PM, Tom Herbert wrote: On Tue, Dec 13, 2016 at 3:03 PM, Craig Gallek wrote: On Tue, Dec 13, 2016 at 3:51 PM, Tom Herbert wrote: I think there may be some suspicious code in inet_csk_get_port. At tb_found there is: if (((tb->fastreuse > 0 && r

Re: [PATCH v3 3/3] random: use siphash24 instead of md5 for get_random_int/long

2016-12-15 Thread Jason A. Donenfeld
Hi David, On Thu, Dec 15, 2016 at 11:14 AM, David Laight wrote: > From: Behalf Of Jason A. Donenfeld >> Sent: 14 December 2016 18:46 > ... >> + ret = *chaining = siphash24((u8 *)&combined, >> offsetof(typeof(combined), end), > > If you make the first argument 'const void *' you won't need th

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

2016-12-15 Thread Jason A. Donenfeld
Hi David & Hannes, This conversation is veering off course. I think this doesn't really matter at all. Gcc converts u64 into essentially a pair of u32 on 32-bit platforms, so the alignment requirements for 32-bit is at a maximum 32 bits. On 64-bit platforms the alignment requirements are related a

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Jason Gunthorpe
On Thu, Dec 15, 2016 at 01:19:18PM -0500, Doug Ledford wrote: > On 12/15/2016 12:07 PM, Jason Gunthorpe wrote: > > On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote: > > > >> 1) Since your intent is to make this work with multiple versions of the > >> hfi drivers, I disagree with Jason

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Arnaldo Carvalho de Melo
Em Thu, Dec 15, 2016 at 03:29:18PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: > > > Now that libbpf under tools/lib/bpf/* is synced with the version fro

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Arnaldo Carvalho de Melo
Em Thu, Dec 15, 2016 at 03:34:40PM -0300, Arnaldo Carvalho de Melo escreveu: > > So, I'm stopping here so that I can push what I have to Ingo, then I'll get > back to this, hopefully by then you beat me and I have just to retest 8-) Ah, I left what I have in the tmp.perf/samples-libbpf branch in

Re: [upstream-release] [PATCH net 2/4] fsl/fman: arm: call of_platform_populate() for arm64 platfrom

2016-12-15 Thread Scott Wood
On 12/15/2016 07:11 AM, Madalin Bucur wrote: > From: Igal Liberman > > Signed-off-by: Igal Liberman > --- > drivers/net/ethernet/freescale/fman/fman.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/net/ethernet/freescale/fman/fman.c > b/drivers/net/ethernet/frees

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Joe Stringer
On 15 December 2016 at 07:50, Arnaldo Carvalho de Melo wrote: > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: >> Now that libbpf under tools/lib/bpf/* is synced with the version from >> samples/bpf, we can get rid most of the libbpf library here. >> >> Signed-off-by: Joe Stringe

Re: [PATCH perf/core REBASE 2/5] samples/bpf: Switch over to libbpf

2016-12-15 Thread Arnaldo Carvalho de Melo
Em Thu, Dec 15, 2016 at 12:50:22PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Dec 14, 2016 at 02:43:39PM -0800, Joe Stringer escreveu: > > Now that libbpf under tools/lib/bpf/* is synced with the version from > > samples/bpf, we can get rid most of the libbpf library here. > > > > Signed-

[PATCH v2 net] rebased to master

2016-12-15 Thread Manuel Bessler
'ifconfig eth0 down' makes r6040_close() trigger: INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue() to outside of the module's private spin_lock_irq block. Found on a Versalogic Tomcat SBC with a Vortex86 SoC s1660e_

Re: [RFC v2 00/10] HFI Virtual Network Interface Controller (VNIC)

2016-12-15 Thread Doug Ledford
On 12/15/2016 12:07 PM, Jason Gunthorpe wrote: > On Thu, Dec 15, 2016 at 11:28:06AM -0500, Doug Ledford wrote: > >> 1) Since your intent is to make this work with multiple versions of the >> hfi drivers, I disagree with Jason that just because there is only one >> driver today that we should keep

[PATCH net] r6040: move spinlock in r6040_close as SOFTIRQ-unsafe lock order detected

2016-12-15 Thread Manuel Bessler
'ifconfig eth0 down' makes r6040_close() trigger: INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected Fixed by moving calls to phy_stop(), napi_disable(), netif_stop_queue() to outside of the module's private spin_lock_irq block. Found on a Versalogic Tomcat SBC with a Vortex86 SoC s1660e_

Re: [PATCH net-next 1/3] net:dsa:mv88e6xxx: use hashtable to store multicast entries

2016-12-15 Thread Vivien Didelot
Florian Fainelli writes: >> In all cases *if caching is really needed*, I think it won't hurt to do >> it in DSA core even if a switch support FDB dump operations on a >> per-port basis, as Andrew mentioned. > > Agreed, and there does not appear to be any need to new dsa_switch_ops > operations t

  1   2   3   >