Re: [PATCH 1/2] bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

2018-03-22 Thread Daniel Borkmann
On 03/21/2018 07:37 PM, Jiri Olsa wrote: > On Wed, Mar 21, 2018 at 05:25:33PM +, Quentin Monnet wrote: >> 2018-03-21 16:02 UTC+0100 ~ Jiri Olsa >>> We use print_bpf_insn in user space (bpftool and soon perf), >>> so it'd be nice to keep it generic and strip it off the kernel

[PATCH net-next v3 4/5] net: Make ip_ra_chain per struct net

2018-03-22 Thread Kirill Tkhai
This is optimization, which makes ip_call_ra_chain() iterate less sockets to find the sockets it's looking for. Signed-off-by: Kirill Tkhai --- include/net/ip.h | 13 +++-- include/net/netns/ipv4.h |1 + net/ipv4/ip_input.c |5 ++---

[PATCH net-next v3 3/5] net: Revert "ipv4: fix a deadlock in ip_ra_control"

2018-03-22 Thread Kirill Tkhai
This reverts commit 1215e51edad1. Since raw_close() is used on every RAW socket destruction, the changes made by 1215e51edad1 scale sadly. This clearly seen on endless unshare(CLONE_NEWNET) test, and cleanup_net() kwork spends a lot of time waiting for rtnl_lock() introduced by this commit.

[PATCH net-next v3 0/5] Rework ip_ra_chain protection

2018-03-22 Thread Kirill Tkhai
Commit 1215e51edad1 "ipv4: fix a deadlock in ip_ra_control" made rtnl_lock() be used in raw_close(). This function is called on every RAW socket destruction, so that rtnl_mutex is taken every time. This scales very sadly. I observe cleanup_net() spending a lot of time in rtnl_lock() and

[PATCH net-next v3 5/5] net: Replace ip_ra_lock with per-net mutex

2018-03-22 Thread Kirill Tkhai
Since ra_chain is per-net, we may use per-net mutexes to protect them in ip_ra_control(). This improves scalability. Signed-off-by: Kirill Tkhai --- include/net/netns/ipv4.h |1 + net/core/net_namespace.c |1 + net/ipv4/ip_sockglue.c | 15 ++- 3

RE: [PATCH v4 11/17] bnx2x: Eliminate duplicate barriers on weakly-ordered archs

2018-03-22 Thread Kalluru, Sudarsana
-Original Message- From: Sinan Kaya [mailto:ok...@codeaurora.org] Sent: 20 March 2018 08:12 To: netdev@vger.kernel.org; ti...@codeaurora.org; sulr...@codeaurora.org Cc: linux-arm-...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; Sinan Kaya ; Elior, Ariel

Re: [PATCH][next] net: mvpp2: use correct index on array mvpp2_pools

2018-03-22 Thread Antoine Tenart
Hi Colin, On Wed, Mar 21, 2018 at 05:31:15PM +, Colin King wrote: > From: Colin Ian King > > Array mvpp2_pools is being indexed by long_log_pool, however this > looks like a cut-n-paste bug and in fact should be short_log_pool. > > Detected by CoverityScan,

Re: [PATCH v2 2/2] i40e: add support for XDP_REDIRECT

2018-03-22 Thread Jesper Dangaard Brouer
On Thu, 22 Mar 2018 10:03:07 +0100 Björn Töpel wrote: > +/** > + * i40e_xdp_xmit - Implements ndo_xdp_xmit > + * @dev: netdev > + * @xdp: XDP buffer > + * > + * Returns Zero if sent, else an error code > + **/ > +int i40e_xdp_xmit(struct net_device *dev, struct xdp_buff

Re: [PATCH v2 2/2] i40e: add support for XDP_REDIRECT

2018-03-22 Thread Björn Töpel
2018-03-22 12:58 GMT+01:00 Jesper Dangaard Brouer : > > On Thu, 22 Mar 2018 10:03:07 +0100 Björn Töpel wrote: > >> +/** >> + * i40e_xdp_xmit - Implements ndo_xdp_xmit >> + * @dev: netdev >> + * @xdp: XDP buffer >> + * >> + * Returns Zero if sent, else an

Re: [PATCH net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-22 Thread Boris Pismenny
... Can't we move this check in tls_dev_event() and use it for all types of events? Then we avoid duplicate code. No. Not all events require this check. Also, the result is different for different events. No. You always return NOTIFY_DONE, in case of !(netdev->features &

Re: [v2] vhost: add vsock compat ioctl

2018-03-22 Thread Stefan Hajnoczi
On Fri, Mar 16, 2018 at 7:30 PM, David Miller wrote: > Although the top level ioctls are probably size and layout compatible, > I do not think that the deeper ioctls can be called by compat binaries > without some translations in order for them to work. I audited the vhost

[patch net-next RFC 12/12] nfp: flower: set sysfs link to device for representors

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Do this so the sysfs has "device" link correctly set. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/flower/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c

[patch net-next RFC 11/12] nfp: use devlink helper to generate physical port name

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Since devlink knows the info needed to generate the physical port name in a generic way for all devlink users, use the helper to do the job. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/nfp_port.c | 30

[patch net-next RFC 10/12] nfp: flower: create port for flower vnic

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/flower/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c

[patch net-next RFC 06/12] mlxsw: use devlink helper to generate physical port name

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Since devlink knows the info needed to generate the physical port name in a generic way for all devlink users, use the helper to do the job. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/core.c | 11 +++

Re: [RFC PATCH 0/3] kernel: add support for 256-bit IO access

2018-03-22 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Wed, Mar 21, 2018 at 6:32 AM, Ingo Molnar wrote: > > > > * Linus Torvalds wrote: > > > >> And even if you ignore that "maintenance problems down the line" issue > >> ("we can fix them when they

Re: [PATCH V2 net-next 07/14] net/tls: Support TLS device offload with IPv6

2018-03-22 Thread Sergei Shtylyov
Hello! On 3/22/2018 12:01 AM, Saeed Mahameed wrote: From: Ilya Lesokhin Previously get_netdev_for_sock worked only with IPv4. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: Saeed Mahameed

Re: [PATCH net-next v3 0/5] Rework ip_ra_chain protection

2018-03-22 Thread Kirill Tkhai
On 22.03.2018 12:44, Kirill Tkhai wrote: > Commit 1215e51edad1 "ipv4: fix a deadlock in ip_ra_control" > made rtnl_lock() be used in raw_close(). This function is called > on every RAW socket destruction, so that rtnl_mutex is taken > every time. This scales very sadly. I observe cleanup_net() >

Re: [PATCH net] virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

2018-03-22 Thread Michael S. Tsirkin
On Thu, Mar 22, 2018 at 09:05:52AM +, Jay Vosburgh wrote: > The operstate update logic will leave an interface in the > default UNKNOWN operstate if the interface carrier state never changes > from the default carrier up state set at creation. This includes the > case of an explicit

Re: [PATCH net] virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

2018-03-22 Thread Jay Vosburgh
Michael S. Tsirkin wrote: >On Thu, Mar 22, 2018 at 09:05:52AM +, Jay Vosburgh wrote: >> The operstate update logic will leave an interface in the >> default UNKNOWN operstate if the interface carrier state never changes >> from the default carrier up state set at

RE: [RFC PATCH 0/3] kernel: add support for 256-bit IO access

2018-03-22 Thread David Laight
From: David Laight > Sent: 22 March 2018 10:36 ... > Any code would need to be in memcpy_fromio(), not in every driver that > might benefit. > Then fallback code can be used if the registers aren't available. > > > (b) we can't guarantee that %ymm register write will show up on any > > bus as a

RE: [RFC PATCH 0/3] kernel: add support for 256-bit IO access

2018-03-22 Thread David Laight
From: Sent: 21 March 2018 18:16 > To: Ingo Molnar ... > All this to do a 32-byte PIO access, with absolutely zero data right > now on what the win is? > > Yes, yes, I can find an Intel white-paper that talks about setting WC > and then using xmm and ymm instructions to write a single 64-byte >

RE: [RFC PATCH 2/3] x86/io: implement 256-bit IO read and write

2018-03-22 Thread David Laight
From: Linus Torvalds > Sent: 22 March 2018 01:27 > On Tue, Mar 20, 2018 at 7:42 AM, Alexander Duyck > wrote: > > > > Instead of framing this as an enhanced version of the read/write ops > > why not look at replacing or extending something like the > > memcpy_fromio or

Re: [PATCH/RFC 2/3] net/sched: act_tunnel_key: add extended ack support

2018-03-22 Thread Simon Horman
On Fri, Mar 09, 2018 at 12:22:48PM +0100, Jiri Benc wrote: > On Tue, 6 Mar 2018 18:08:04 +0100, Simon Horman wrote: > > - if (!tb[TCA_TUNNEL_KEY_PARMS]) > > + if (!tb[TCA_TUNNEL_KEY_PARMS]) { > > + NL_SET_ERR_MSG(extack, "Missing tunnel key parameter"); > > "parameters" (it's not

Re: [PATCH V2 net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-22 Thread Boris Pismenny
On 3/21/2018 11:10 PM, Eric Dumazet wrote: On 03/21/2018 02:01 PM, Saeed Mahameed wrote: From: Ilya Lesokhin This patch adds a generic infrastructure to offload TLS crypto to a ... + +static inline int tls_push_record(struct sock *sk, +

RE: DTS for our Configuration

2018-03-22 Thread Alayev Michael
Hi Andrew, >I think this is a problem with the macb driver. To me, it looks like you are >going to have to >make some changes to the driver to make this work. Normally >the MDIO bus children are >placed within a container node, often called >'mdio-bus' or simply 'mdio'. See for example

Re: [bug, bisected] pfifo_fast causes packet reordering

2018-03-22 Thread Jakob Unterwurzacher
On 21.03.18 21:52, John Fastabend wrote: Can you try this, diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d4907b5..1e596bd 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -30,6 +30,7 @@ struct qdisc_rate_table { enum qdisc_state_t {

Drop count for VLAN tagged packets when interface is in promiscuous mode

2018-03-22 Thread Mikael Arvids
Hi, I have questions regarding how packet drops are counted in net/core/dev.c. We open a raw socket (with ETH_P_ALL) in promiscuous mode to capture all packets we receive from a mirrored port on a switch, and in order to ensure that we are not missing any packets we check the rx_dropped

Re: [PATCH net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-22 Thread Kirill Tkhai
On 22.03.2018 15:38, Boris Pismenny wrote: > ... Can't we move this check in tls_dev_event() and use it for all types of events? Then we avoid duplicate code. >>> >>> No. Not all events require this check. Also, the result is different for >>> different events. >> >> No.

Re: [RFC PATCH 0/3] kernel: add support for 256-bit IO access

2018-03-22 Thread Ingo Molnar
* Linus Torvalds wrote: > And the real worry is things like AVX-512 etc, which is exactly when > things like "save and restore one ymm register" will quite likely > clear the upper bits of the zmm register. Yeah, I think the only valid save/restore pattern is to

[patch net-next RFC 03/12] devlink: introduce a helper to generate physical port names

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Each driver implements physical port name generation by itself. However as devlink has all needed info, it can easily do the job for all its users. So implement this helper in devlink. Signed-off-by: Jiri Pirko --- include/net/devlink.h |

[patch net-next RFC 07/12] nfp: flower: fix error path during representor creation

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Don't store repr pointer to reprs array until the representor is successfully created. This avoids message about "representor destruction" even when it was never created. Also it cleans-up the flow. Also, check return value after port alloc. Signed-off-by:

[patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Set the attrs and allow to expose port flavour to user via devlink. Signed-off-by: Jiri Pirko --- net/dsa/dsa2.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index

[patch net-next RFC 01/12] devlink: introduce devlink_port_attrs_set

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Change existing setter for split port information into more generic attrs setter. Alongside with that, allow to set port number and subport number for split ports. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/core.c

[patch net-next RFC 05/12] dsa: use devlink helper to generate physical port name

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Since devlink knows the info needed to generate the physical port name in a generic way for all devlink users, use the helper to do the job. Signed-off-by: Jiri Pirko --- net/dsa/slave.c | 6 ++ 1 file changed, 2 insertions(+), 4

[patch net-next RFC 02/12] devlink: extend attrs_set for setting port flavours

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Devlink ports can have specific flavour according to the purpose of use. This patch extend attrs_set so the driver can say which flavour port has. Initial flavours are: physical, pf_rep, vf_rep, cpu, dsa User can query this to see right away what is the

[patch net-next RFC 09/12] nfp: register devlink port for VF/PF representors

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Drivers should always register devlink port instance for all their ports. So fix nfp and register devlink port for VF and PF representors. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 8 1

[patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko This patchset resolves 2 issues we have right now: 1) There are many netdevices / ports in the system, for port, pf, vf represenatation but the user has no way to see which is which 2) The ndo_get_phys_port_name is implemented in each driver separatelly,

[patch net-next RFC 08/12] nfp: set eth_id for representors to avoid port index conflict

2018-03-22 Thread Jiri Pirko
From: Jiri Pirko Incorrect, need to be done differently Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c

Re: [PATCH/RFC 3/3] net/sched: add tunnel option support to act_tunnel_key

2018-03-22 Thread Simon Horman
On Fri, Mar 09, 2018 at 12:53:17PM +0100, Jiri Benc wrote: > On Tue, 6 Mar 2018 18:08:05 +0100, Simon Horman wrote: > > +static int > > +tunnel_key_copy_geneve_opt(const struct nlattr *nla, int dst_len, void > > *dst, > > + struct netlink_ext_ack *extack) > > +{ > > +

Re: [PATCH v2 bpf-next 5/8] bpf: introduce BPF_RAW_TRACEPOINT

2018-03-22 Thread Daniel Borkmann
On 03/21/2018 07:54 PM, Alexei Starovoitov wrote: [...] > @@ -546,6 +556,53 @@ extern void ftrace_profile_free_filter(struct perf_event > *event); > void perf_trace_buf_update(void *record, u16 type); > void *perf_trace_buf_alloc(int size, struct pt_regs **regs, int *rctxp); > > +void

[PATCH net-next v3 1/5] net: Revert "ipv4: get rid of ip_ra_lock"

2018-03-22 Thread Kirill Tkhai
This reverts commit ba3f571d5dde. The commit was made after 1215e51edad1 "ipv4: fix a deadlock in ip_ra_control", and killed ip_ra_lock, which became useless after rtnl_lock() made used to destroy every raw ipv4 socket. This scales very bad, and next patch in series reverts 1215e51edad1.

[PATCH net-next v3 2/5] net: Move IP_ROUTER_ALERT out of lock_sock(sk)

2018-03-22 Thread Kirill Tkhai
ip_ra_control() does not need sk_lock. Who are the another users of ip_ra_chain? ip_mroute_setsockopt() doesn't take sk_lock, while parallel IP_ROUTER_ALERT syscalls are synchronized by ip_ra_lock. So, we may move this command out of sk_lock. Signed-off-by: Kirill Tkhai ---

Re: [PATCH 1/2] r8169: reinstate ALDPS for power saving

2018-03-22 Thread Kai-Heng Feng
Kai Heng Feng wrote: Hopefully Hayes (or Realtek) can shed more lights on the issue. Apparently ALDPS and ASPM for r8169 is enabled in different commercial products, just not in Linux mainline. Hayes and Realtek folks, How do we make this patch going forward? Do

Re: [PATCH nf] netfilter: drop template ct when conntrack is skipped.

2018-03-22 Thread Florian Westphal
Paolo Abeni wrote: > The ipv4 nf_ct code currently skips the nf_conntrak_in() call > for fragmented packets. As a results later matches/target can end > up manipulating template ct entry instead of 'real' ones. > > Exploiting the above, syzbot found a way to trigger the

Re: [PATCH nf] netfilter: drop template ct when conntrack is skipped.

2018-03-22 Thread Pablo Neira Ayuso
On Thu, Mar 22, 2018 at 11:08:50AM +0100, Paolo Abeni wrote: > The ipv4 nf_ct code currently skips the nf_conntrak_in() call > for fragmented packets. As a results later matches/target can end > up manipulating template ct entry instead of 'real' ones. > > Exploiting the above, syzbot found a way

Re: [PATCH v2 bpf-next 4/8] tracepoint: compute num_args at build time

2018-03-22 Thread Steven Rostedt
On Wed, 21 Mar 2018 15:05:46 -0700 Alexei Starovoitov wrote: > Like the only reason my patch is counting till 17 is because of > trace_iwlwifi_dev_ucode_error(). > The next offenders are using 12 arguments: > trace_mc_event() > trace_mm_vmscan_lru_shrink_inactive() > > Clearly not

Re: [PATCH 28/28] random: convert to ->poll_mask

2018-03-22 Thread Theodore Y. Ts'o
On Wed, Mar 21, 2018 at 08:40:32AM +0100, Christoph Hellwig wrote: > The big change is that random_read_wait and random_write_wait are merged > into a single waitqueue that uses keyed wakeups. Because wait_event_* > doesn't know about that this will lead to occassional spurious wakeups > in

Re: WARNING: CPU: 3 PID: 0 at net/sched/sch_hfsc.c:1388 hfsc_dequeue+0x319/0x350 [sch_hfsc]

2018-03-22 Thread Marco Berizzi
Il 19 marzo 2018 alle 11.07 Jamal Hadi Salim ha scritto: > > On 18-03-15 08:48 PM, Cong Wang wrote: > > > On Wed, Mar 14, 2018 at 1:10 AM, Marco Berizzi wrote: > > > > > > Il 9 marzo 2018 alle 0.14 Cong Wang ha > > > > scritto:

[PATCH net-next 6/9] net: hns3: Add support to re-initialize the hclge device

2018-03-22 Thread Salil Mehta
After the hardware reset we should re-fetch the configuration from PF like queue info and tc info. This might have impact on allocations made like that of TQPs. Hence, we should release all such allocations and re-allocate fresh according to new fetched configuration after reset. Signed-off-by:

[PATCH net-next 0/9] Add support of VF Reset to HNS3 VF driver

2018-03-22 Thread Salil Mehta
This patch-set adds the support of VF reset to the existing VF driver. VF Reset can be triggered due to TX watchdog firing as a result of TX data-path not working. VF reset could also be a result of some internal configuration changes if that requires reset, or as a result of the

Re: [PATCH 0/3] pull request for net-next: batman-adv 2018-03-19

2018-03-22 Thread David Miller
From: Simon Wunderlich Date: Mon, 19 Mar 2018 17:41:50 +0100 > here is another late feature/cleanup pull request of batman-adv to go into > net-next. > > Please pull or let me know of any problem! Also pulled, thanks Simon.

Re: [PATCH 1/2] bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

2018-03-22 Thread Quentin Monnet
2018-03-22 14:32 UTC+0100 ~ Jiri Olsa > On Thu, Mar 22, 2018 at 10:34:18AM +0100, Daniel Borkmann wrote: >> On 03/21/2018 07:37 PM, Jiri Olsa wrote: >>> On Wed, Mar 21, 2018 at 05:25:33PM +, Quentin Monnet wrote: 2018-03-21 16:02 UTC+0100 ~ Jiri Olsa

[bpf-next V4 PATCH 09/15] mlx5: register a memory model when XDP is enabled

2018-03-22 Thread Jesper Dangaard Brouer
Now all the users of ndo_xdp_xmit have been converted to use xdp_return_frame. This enable a different memory model, thus activating another code path in the xdp_return_frame API. V2: Fixed issues pointed out by Tariq. Signed-off-by: Jesper Dangaard Brouer ---

[bpf-next V4 PATCH 14/15] xdp: transition into using xdp_frame for return API

2018-03-22 Thread Jesper Dangaard Brouer
Changing API xdp_return_frame() to take struct xdp_frame as argument, seems like a natural choice. But there are some subtle performance details here that needs extra care, which is a deliberate choice. When de-referencing xdp_frame on a remote CPU during DMA-TX completion, result in the

[bpf-next V4 PATCH 07/15] virtio_net: convert to use generic xdp_frame and xdp_return_frame API

2018-03-22 Thread Jesper Dangaard Brouer
The virtio_net driver assumes XDP frames are always released based on page refcnt (via put_page). Thus, is only queues the XDP data pointer address and uses virt_to_head_page() to retrieve struct page. Use the XDP return API to get away from such assumptions. Instead queue an xdp_frame, which

[bpf-next V4 PATCH 13/15] mlx5: use page_pool for xdp_return_frame call

2018-03-22 Thread Jesper Dangaard Brouer
This patch shows how it is possible to have both the driver local page cache, which uses elevated refcnt for "catching"/avoiding SKB put_page. And at the same time, have pages getting returned to the page_pool from ndp_xdp_xmit DMA completion. Performance is surprisingly good. Tested DMA-TX

[bpf-next V4 PATCH 11/15] page_pool: refurbish version of page_pool code

2018-03-22 Thread Jesper Dangaard Brouer
Need a fast page recycle mechanism for ndo_xdp_xmit API for returning pages on DMA-TX completion time, which have good cross CPU performance, given DMA-TX completion time can happen on a remote CPU. Refurbish my page_pool code, that was presented[1] at MM-summit 2016. Adapted page_pool code to

[bpf-next V4 PATCH 15/15] xdp: transition into using xdp_frame for ndo_xdp_xmit

2018-03-22 Thread Jesper Dangaard Brouer
Changing API ndo_xdp_xmit to take a struct xdp_frame instead of struct xdp_buff. This brings xdp_return_frame and ndp_xdp_xmit in sync. This builds towards changing the API further to become a bulk API, because xdp_buff is not a queue-able object while xdp_frame is. V4: Adjust for commit

[bpf-next V4 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-22 Thread Jesper Dangaard Brouer
Use the IDA infrastructure for getting a cyclic increasing ID number, that is used for keeping track of each registered allocator per RX-queue xdp_rxq_info. Instead of using the IDR infrastructure, which uses a radix tree, use a dynamic rhashtable, for creating ID to pointer lookup table, because

[bpf-next V4 PATCH 12/15] xdp: allow page_pool as an allocator type in xdp_return_frame

2018-03-22 Thread Jesper Dangaard Brouer
New allocator type MEM_TYPE_PAGE_POOL for page_pool usage. The registered allocator page_pool pointer is not available directly from xdp_rxq_info, but it could be (if needed). For now, the driver should keep separate track of the page_pool pointer, which it should use for RX-ring page

[bpf-next V4 PATCH 08/15] bpf: cpumap convert to use generic xdp_frame

2018-03-22 Thread Jesper Dangaard Brouer
The generic xdp_frame format, was inspired by the cpumap own internal xdp_pkt format. It is now time to convert it over to the generic xdp_frame format. The cpumap needs one extra field dev_rx. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h |1 +

Re: [PATCH net-next 1/1] net/ipv4: disable SMC TCP option with SYN Cookies

2018-03-22 Thread Eric Dumazet
On 03/22/2018 06:23 AM, Ursula Braun wrote: > We moved the clear to cookie_v4_check()/cookie_v6_check. However, this does > not seem to > be sufficient to prevent the SYNACK from containing the SMC experimental > option. > We found that an additional check in tcp_conn_request() helps: > >

[PATCH net-next 7/9] net: hns3: Changes to support ARQ(Asynchronous Receive Queue)

2018-03-22 Thread Salil Mehta
Current mailbox CRQ could consists of both synchronous and async responses from the PF. Synchronous responses are time critical and should be handed over to the waiting tasks/context as quickly as possible otherwise timeout occurs. Above problem gets accentuated if CRQ consists of even single

Re: [PATCH net] virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

2018-03-22 Thread Jay Vosburgh
Michael S. Tsirkin wrote: >On Thu, Mar 22, 2018 at 12:02:10PM +, Jay Vosburgh wrote: >> Michael S. Tsirkin wrote: >> >> >On Thu, Mar 22, 2018 at 09:05:52AM +, Jay Vosburgh wrote: >> >> The operstate update logic will leave an interface in the >> >>

[PATCH v2 net-next] virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

2018-03-22 Thread Jay Vosburgh
The operstate update logic will leave an interface in the default UNKNOWN operstate if the interface carrier state never changes from the default carrier up state set at creation. This includes the case of an explicit call to netif_carrier_on, as the carrier on to on transition has no

Re: [PATCH v2 2/2] i40e: add support for XDP_REDIRECT

2018-03-22 Thread Alexander Duyck
On Thu, Mar 22, 2018 at 5:20 AM, Björn Töpel wrote: > 2018-03-22 12:58 GMT+01:00 Jesper Dangaard Brouer : >> >> On Thu, 22 Mar 2018 10:03:07 +0100 Björn Töpel wrote: >> >>> +/** >>> + * i40e_xdp_xmit - Implements ndo_xdp_xmit >>> +

Re: [PATCH 0/5] pull request for net: batman-adv 2018-03-19

2018-03-22 Thread David Miller
From: Simon Wunderlich Date: Mon, 19 Mar 2018 17:37:21 +0100 > here are some more bugfixes for net. > > Please pull or let me know of any problem! Pulled, thanks Simon.

[PATCH v2 6/8] page_frag_cache: Use a mask instead of offset

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox By combining 'va' and 'offset' into 'addr' and using a mask instead, we can save a compare-and-branch in the fast-path of the allocator. This removes 4 instructions on x86 (both 32 and 64 bit). We can avoid storing the mask at all if we know that

[PATCH v2 2/8] page_frag_cache: Move slowpath code from page_frag_alloc

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox Put all the unlikely code in __page_frag_cache_refill to make the fastpath code more obvious. Signed-off-by: Matthew Wilcox --- mm/page_alloc.c | 70 - 1 file changed,

[PATCH net-next] bridge: Allow max MTU when multiple VLANs present

2018-03-22 Thread Chas Williams
If the bridge is allowing multiple VLANs, some VLANs may have different MTUs. Instead of choosing the minimum MTU for the bridge interface, choose the maximum MTU of the bridge members. With this the user only needs to set a larger MTU on the member ports that are participating in the large MTU

Re: [PATCH net-next 0/2] Fixes to allow mv88e6xxx module to be reloaded

2018-03-22 Thread David Miller
From: Andrew Lunn Date: Mon, 19 Mar 2018 22:16:19 +0100 > As reported by Uwe Kleine-K�nig, the interrupt trigger is first > configured by DT and then reconfigured to edge. This results in a > failure on EPROBE_DEFER, or if the module is unloaded and reloaded. > > A second crash

[PATCH v2 4/8] page_frag_cache: Rename fragsz to size

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox The 'size' variable name used to be used for the page size. Signed-off-by: Matthew Wilcox --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index

[PATCH v2 1/8] page_frag_cache: Remove pfmemalloc bool

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox Save 4/8 bytes by moving the pfmemalloc indicator from its own bool to the top bit of pagecnt_bias. This has no effect on the fastpath of the allocator since the pagecnt_bias cannot go negative. It's a couple of extra instructions in the slowpath.

RE: [PATCH net 1/1] qede: Fix barrier usage after tx doorbell write.

2018-03-22 Thread Chopra, Manish
> -Original Message- > From: Elior, Ariel > Sent: Wednesday, March 21, 2018 7:10 PM > To: da...@davemloft.net > Cc: netdev@vger.kernel.org; Kalderon, Michal ; > Chopra, Manish > Subject: RE: [PATCH net 1/1] qede: Fix barrier usage

[PATCH net-next 4/9] net: hns3: Add support to request VF Reset to PF

2018-03-22 Thread Salil Mehta
VF driver depends upon PF to eventually reset the hardware. This request is made using the mailbox command. This patch adds the required function to acheive above. Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 19

[PATCH net-next 8/9] net: hns3: Add *Asserting Reset* mailbox message & handling in VF

2018-03-22 Thread Salil Mehta
Reset Asserting message is forwarded by PF to inform VF about the hardware reset which is about to happen. This might be due to the earlier VF reset request received by the PF or because PF for any reason decides to undergo reset. This message results in VF to go in pending state in which it polls

[PATCH net-next 2/9] net: hns3: Add VF Reset Service Task to support event handling

2018-03-22 Thread Salil Mehta
VF reset would involve handling of different reset related events from the stack, physical function, mailbox etc. Reset service task would be used in servicing such reset event requests and later handling the hardware completions waits and initiating the stack resets. Signed-off-by: Salil Mehta

[PATCH net-next 9/9] net: hns3: Changes required in PF mailbox to support VF reset

2018-03-22 Thread Salil Mehta
PF needs to assert the VF reset when it receives the request to reset from VF. After receiving request PF ackknowledges the request by replying back MBX_ASSERTING_RESET message to VF. VF then goes to pending state and wait for hardware to complete the reset. This patch contains code to handle the

Re: [RFC PATCH 1/5] net: macb: Check MDIO state before read/write and use timeouts

2018-03-22 Thread Andrew Lunn
On Thu, Mar 22, 2018 at 07:21:36PM +0530, harinikatakamli...@gmail.com wrote: > From: Harini Katakam > > Replace the while loop in MDIO read/write functions with a timeout. > In addition, add a check for MDIO bus busy before initiating a new > operation as well to make sure

Re: [PATCH net-next 2/2] net: Convert nf_ct_net_ops

2018-03-22 Thread David Miller
From: Kirill Tkhai Date: Mon, 19 Mar 2018 14:45:46 +0300 > These pernet_operations register and unregister sysctl. > Also, there is inet_frags_exit_net() called in exit method, > which has to be safe after a560002437d3 "net: Fix hlist > corruptions in inet_evict_bucket()".

Re: [PATCH net-next 1/2] net: Convert lowpan_frags_ops

2018-03-22 Thread David Miller
From: Kirill Tkhai Date: Mon, 19 Mar 2018 14:45:37 +0300 > These pernet_operations register and unregister sysctl. > Also, there is inet_frags_exit_net() called in exit method, > which has to be safe after a560002437d3 "net: Fix hlist > corruptions in inet_evict_bucket()".

Re: [PATCH net-next] rds: tcp: remove register_netdevice_notifier infrastructure.

2018-03-22 Thread David Miller
From: Sowmini Varadhan Date: Mon, 19 Mar 2018 06:52:48 -0700 > The netns deletion path does not need to wait for all net_devices > to be unregistered before dismantling rds_tcp state for the netns > (we are able to dismantle this state on module unload even when >

[PATCH v2 0/8] page_frag_cache improvements

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox Version 1 was completely wrong-headed and I have repented of the error of my ways. Thanks for educating me. I still think it's possible to improve on the current state of the page_frag allocator, and here are eight patches, each of which I think

[PATCH v2 7/8] page_frag: Update documentation

2018-03-22 Thread Matthew Wilcox
From: Matthew Wilcox - Rename Documentation/vm/page_frags to page_frags.rst - Change page_frags.rst to be a user's guide rather than implementation detail. - Add kernel-doc for the page_frag allocator - Move implementation details to the comments in page_alloc.c

Re: [PATCH net-next 1/1] net/ipv4: disable SMC TCP option with SYN Cookies

2018-03-22 Thread Ursula Braun
On 03/20/2018 05:43 PM, Eric Dumazet wrote: > > > On 03/20/2018 09:21 AM, Eric Dumazet wrote: >> >> >> On 03/20/2018 08:53 AM, Ursula Braun wrote: >>> From: Hans Wippel >>> >>> Currently, the SMC experimental TCP option in a SYN packet is lost on >>> the server

[PATCH net-next 5/9] net: hns3: Add support to reset the enet/ring mgmt layer

2018-03-22 Thread Salil Mehta
After VF driver knows that hardware reset has been performed successfully, it should proceed ahead and reset the enet layer. This primarily consists of bringing down interface, clearing TX/RX rings, disassociating vectors from ring etc. Signed-off-by: Salil Mehta ---

Re: [PATCH 1/2] bpf: Remove struct bpf_verifier_env argument from print_bpf_insn

2018-03-22 Thread Jiri Olsa
On Thu, Mar 22, 2018 at 10:34:18AM +0100, Daniel Borkmann wrote: > On 03/21/2018 07:37 PM, Jiri Olsa wrote: > > On Wed, Mar 21, 2018 at 05:25:33PM +, Quentin Monnet wrote: > >> 2018-03-21 16:02 UTC+0100 ~ Jiri Olsa > >>> We use print_bpf_insn in user space (bpftool and soon

Re: [PATCH net] virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS

2018-03-22 Thread Michael S. Tsirkin
On Thu, Mar 22, 2018 at 12:02:10PM +, Jay Vosburgh wrote: > Michael S. Tsirkin wrote: > > >On Thu, Mar 22, 2018 at 09:05:52AM +, Jay Vosburgh wrote: > >>The operstate update logic will leave an interface in the > >> default UNKNOWN operstate if the interface carrier

RE: [PATCH v5 0/2] Remove false-positive VLAs when using max()

2018-03-22 Thread David Laight
From: Kees Cook > Sent: 22 March 2018 15:01 ... > > /* Glory to Martin Uecker */ > > #define __is_constant(a) \ > > (sizeof(int) == sizeof(*(1 ? ((void*)((a) * 0l)) : (int*)1))) ... > So, this time it's not a catastrophic failure with gcc 4.4.

[RFC PATCH 5/5] net: macb: Add WOL support with ARP

2018-03-22 Thread harinikatakamlinux
From: Harini Katakam This patch enables ARP wake event support in GEM through the following: -> WOL capability can be selected based on the SoC/GEM IP version rather than a devictree property alone. Hence add a new capability property and set device as "wakeup capable" in

[RFC PATCH 4/5] net: macb: Add support for suspend/resume with full power down

2018-03-22 Thread harinikatakamlinux
From: Harini Katakam When macb device is suspended and system is powered down, the clocks are removed and hence macb should be closed gracefully and restored upon resume. This patch does the same by switching off the net device, suspending phy and performing necessary cleanup

[iproute PATCH] man: ip-route.8: ssthresh parameter is NUMBER

2018-03-22 Thread Phil Sutter
Synopsis section was inconsistent with regards to help text and later description of ssthresh parameter. Signed-off-by: Phil Sutter --- man/man8/ip-route.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index

[bpf-next V4 PATCH 03/15] ixgbe: use xdp_return_frame API

2018-03-22 Thread Jesper Dangaard Brouer
Extend struct ixgbe_tx_buffer to store the xdp_mem_info. Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/intel/ixgbe/ixgbe.h |1 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

[bpf-next V4 PATCH 02/15] xdp: introduce xdp_return_frame API and use in cpumap

2018-03-22 Thread Jesper Dangaard Brouer
Introduce an xdp_return_frame API, and convert over cpumap as the first user, given it have queued XDP frame structure to leverage. V3: Cleanup and remove C99 style comments, pointed out by Alex Duyck. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h | 28

[bpf-next V4 PATCH 04/15] xdp: move struct xdp_buff from filter.h to xdp.h

2018-03-22 Thread Jesper Dangaard Brouer
This is done to prepare for the next patch, and it is also nice to move this XDP related struct out of filter.h. Signed-off-by: Jesper Dangaard Brouer --- include/linux/filter.h | 24 +--- include/net/xdp.h | 22 ++ 2 files

[bpf-next V4 PATCH 05/15] xdp: introduce a new xdp_frame type

2018-03-22 Thread Jesper Dangaard Brouer
This is needed to convert drivers tuntap and virtio_net. This is a generalization of what is done inside cpumap, which will be converted later. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h | 40 1 file changed, 40

[bpf-next V4 PATCH 06/15] tun: convert to use generic xdp_frame and xdp_return_frame API

2018-03-22 Thread Jesper Dangaard Brouer
The tuntap driver invented it's own driver specific way of queuing XDP packets, by storing the xdp_buff information in the top of the XDP frame data. Convert it over to use the more generic xdp_frame structure. The main problem with the in-driver method is that the xdp_rxq_info pointer cannot be

[bpf-next V4 PATCH 00/15] XDP redirect memory return API

2018-03-22 Thread Jesper Dangaard Brouer
This patchset works towards supporting different XDP RX-ring memory allocators. As this will be needed by the AF_XDP zero-copy mode. The patchset uses mlx5 as the sample driver, which gets implemented XDP_REDIRECT RX-mode, but not ndo_xdp_xmit (as this API is subject to change thought the

[bpf-next V4 PATCH 01/15] mlx5: basic XDP_REDIRECT forward support

2018-03-22 Thread Jesper Dangaard Brouer
This implements basic XDP redirect support in mlx5 driver. Notice that the ndo_xdp_xmit() is NOT implemented, because that API need some changes that this patchset is working towards. The main purpose of this patch is have different drivers doing XDP_REDIRECT to show how different memory models

  1   2   3   4   >