[PATCH net-next V3 1/3] net/skbuff: Introduce skb_mac_offset()

2017-02-06 Thread Amir Vadai
Introduce skb_mac_offset() that could be used to get mac header offset. Signed-off-by: Amir Vadai Reviewed-by: Or Gerlitz --- include/linux/skbuff.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c6a78e1892b6..a1b73b794a38 100644 -

[PATCH net-next V3 2/3] net/act_pedit: Support using offset relative to the conventional network headers

2017-02-06 Thread Amir Vadai
Extend pedit to enable the user setting offset relative to network headers. This change would enable to work with more complex header schemes (vs the simple IPv4 case) where setting a fixed offset relative to the network header is not enough. After this patch, the action has information about the

[PATCH net-next V3 0/3] net/sched: act_pedit: Use offset relative to conventional network headers

2017-02-06 Thread Amir Vadai
Hi Dave, Some FW/HW parser APIs are such that they need to get the specific header type (e.g IPV4 or IPV6, TCP or UDP) and not only the networking level (e.g network or transport). Enhancing the UAPI to allow for specifying that, would allow the same flows to be set into both SW and HW. This

[PATCH net-next V3 3/3] net/act_pedit: Introduce 'add' operation

2017-02-06 Thread Amir Vadai
This command could be useful to inc/dec fields. For example, to forward any TCP packet and decrease its TTL: $ tc filter add dev enp0s9 protocol ip parent : \ flower ip_proto tcp \ action pedit munge ip ttl add 0xff pipe \ action mirred egress redirect dev veth0 In the example abo

Re: [PATCH iproute2/net-next 0/7] tc: flower: Masked ICMP match and ND match

2017-02-06 Thread Simon Horman
On Mon, Feb 6, 2017 at 11:28 PM, Stephen Hemminger wrote: > On Thu, 2 Feb 2017 11:38:33 +0100 > Simon Horman wrote: > >> Hi, >> >> this series have several related parts. >> >> * tc: flower: Update documentation to indicate ARP takes IPv4 prefixes >> >> Enhance documentation for consistency wi

[PATCH] vhost: try avoiding avail index access when getting descriptor

2017-02-06 Thread Jason Wang
If last avail idx is not equal to cached avail idx, we're sure there's still available buffers in the virtqueue so there's no need to re-read avail idx. So let's skip this to avoid unnecessary userspace memory access and memory barrier. Pktgen test show about 3% improvement on rx pps. Signed-off-b

[patch v2 net-next] sfc: fix an off by one bug

2017-02-06 Thread Dan Carpenter
This bug is harmless because it's just a sanity check and we always pass valid values for "encap_type" but the test is off by one. Fixes: 9b4108012517 ("sfc: insert catch-all filters for encapsulated traffic") Signed-off-by: Dan Carpenter --- v2: Rebased against last linux-next diff --git a/driv

Re: [PATCH net-next 6/7] openvswitch: Add force commit.

2017-02-06 Thread Joe Stringer
On 6 February 2017 at 09:08, Pravin Shelar wrote: > On Thu, Feb 2, 2017 at 5:10 PM, Jarno Rajahalme wrote: >> Stateful network admission policy may allow connections to one >> direction and reject connections initiated in the other direction. >> After policy change it is possible that for a new c

Re: [PATCH net-next 7/7] openvswitch: Pack struct sw_flow_key.

2017-02-06 Thread Joe Stringer
On 2 February 2017 at 17:10, Jarno Rajahalme wrote: > struct sw_flow_key has two 16-bit holes. Move the most matched > conntrack match fields there. In some typical cases this reduces the > size of the key that needs to be hashed into half and into one cache > line. > > Signed-off-by: Jarno Rajah

Re: [PATCH net-next 5/7] openvswitch: Add original direction conntrack tuple to sw_flow_key.

2017-02-06 Thread Joe Stringer
On 2 February 2017 at 17:10, Jarno Rajahalme wrote: > Add the fields of the conntrack original direction 5-tuple to struct > sw_flow_key. The new fields are initially zeroed, and are populated > whenever a conntrack action is executed and either finds or generates > a conntrack entry. This means

RE: [PATCH net-next v3 1/2] qed: Add infrastructure for PTP support.

2017-02-06 Thread Mintz, Yuval
> On Mon, Feb 06, 2017 at 10:41:44AM +, Mintz, Yuval wrote: > > Richard - we're planning on sending v4 with the existing algorithm > > [but without iterating on 'val == 0']; If you have any suggestion for > > improving this, please share it. > > Sorry, haven't had the time to look at your issu

Re: [PATCH v2 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Alexei Starovoitov
On Mon, Feb 06, 2017 at 06:57:45PM -0800, Andy Lutomirski wrote: > On Mon, Feb 6, 2017 at 5:42 PM, Alexei Starovoitov > wrote: > > On Sat, Feb 04, 2017 at 08:17:57PM -0800, Andy Lutomirski wrote: > >> On Sat, Feb 4, 2017 at 8:05 PM, Alexei Starovoitov > >> wrote: > >> > On Sat, Feb 04, 2017 at 07

Re: [PATCH net-next v3 1/2] qed: Add infrastructure for PTP support.

2017-02-06 Thread Richard Cochran
On Mon, Feb 06, 2017 at 10:41:44AM +, Mintz, Yuval wrote: > Richard - we're planning on sending v4 with the existing algorithm > [but without iterating on 'val == 0']; If you have any suggestion for > improving this, please share it. Sorry, haven't had the time to look at your issue. BTW, you

linux-next: manual merge of the akpm tree with the net-next tree

2017-02-06 Thread Stephen Rothwell
Hi Andrew, Today's linux-next merge of the akpm tree got a conflict in: drivers/net/can/flexcan.c between commits: 9eb7aa891101 ("can: flexcan: add quirk FLEXCAN_QUIRK_ENABLE_EACEN_RRS") b3cf53e988ce ("can: flexcan: add support for timestamp based rx-offload") from the net-next tree and

[PATCH v3 1/3] Documentation: devicetree: Add PHY no lane swap binding

2017-02-06 Thread Lukasz Majewski
Add the documentation to avoid PHY lane swapping. This is a boolean entry to notify the phy device drivers that the TX/RX lanes NO need to be swapped. The use case for this binding mostly happens after wrong HW configuration of PHY IC during bootstrap. Signed-off-by: Lukasz Majewski --- Changes

[PATCH] Make EN2 pin optional in the TRF7970A driver

2017-02-06 Thread Heiko Schocher
From: Guan Ben Make the EN2 pin optional. This is useful for boards, which have this pin fix wired, for example to ground. Signed-off-by: Guan Ben Signed-off-by: Mark Jonas Signed-off-by: Heiko Schocher --- .../devicetree/bindings/net/nfc/trf7970a.txt | 4 ++-- drivers/nfc/trf7970a.

[PATCH v3 2/3] net: phy: dp83867: Add lane swapping support in the DP83867 TI's PHY driver

2017-02-06 Thread Lukasz Majewski
This patch adds support for enabling or disabling the lane swapping (called "port mirroring" in PHY's CFG4 register) feature of the DP83867 TI's PHY device. One use case is when bootstrap configuration enables this feature (because of e.g. LED_0 wrong wiring) so then one needs to disable it in sof

[PATCH v3 3/3] net: phy: dp83867: Recover from "port mirroring" N/A MODE4

2017-02-06 Thread Lukasz Majewski
The DP83867 when not properly bootstrapped - especially with LED_0 pin - can enter N/A MODE4 for "port mirroring" feature. To provide normal operation of the PHY, one needs not only to explicitly disable the port mirroring feature, but as well stop some IC internal testing (which disables RGMII co

RE: [PATCH net-next/iproute 2/5] tc: bash-completion: Prepare action autocomplete to support several actions

2017-02-06 Thread Yotam Gigi
>-Original Message- >From: Stephen Hemminger [mailto:step...@networkplumber.org] >Sent: Tuesday, February 07, 2017 12:11 AM >To: Yotam Gigi >Cc: netdev@vger.kernel.org; Elad Raz ; Ido Schimmel >; Jiri Pirko ; j...@mojatatu.com; >m...@mojatatu.com >Subject: Re: [PATCH net-next/iproute 2/5]

Re: [net-next PATCH v2 0/5] XDP adjust head support for virtio

2017-02-06 Thread Michael S. Tsirkin
On Thu, Feb 02, 2017 at 07:14:05PM -0800, John Fastabend wrote: > This series adds adjust head support for virtio. The following is my > test setup. I use qemu + virtio as follows, > > ./x86_64-softmmu/qemu-system-x86_64 \ > -hda /var/lib/libvirt/images/Fedora-test0.img \ > -m 4096 -enable-kv

Re: [PATCH net-next 0/4] bridge: improve cache utilization

2017-02-06 Thread David Miller
From: Nikolay Aleksandrov Date: Sat, 4 Feb 2017 18:05:05 +0100 > This is the first set which begins to deal with the bad bridge cache > access patterns. The first patch rearranges the bridge and port structs > a little so the frequently (and closely) accessed members are in the same > cache line

Re: [PATHv3 net-next] bpf: enable verifier to add 0 to packet ptr

2017-02-06 Thread David Miller
From: William Tu Date: Sat, 4 Feb 2017 08:37:29 -0800 > The patch fixes the case when adding a zero value to the packet > pointer. The zero value could come from src_reg equals type > BPF_K or CONST_IMM. The patch fixes both, otherwise the verifer > reports the following error: > [...] >

Re: [PATCH net 0/2] read vnet_hdr_sz once

2017-02-06 Thread David Miller
From: Willem de Bruijn Date: Fri, 3 Feb 2017 18:20:47 -0500 > Tuntap devices allow concurrent use and update of field vnet_hdr_sz. > Read the field once to avoid TOCTOU. Series applied and queued up for -stable, thanks.

Re: [PATCH net] tcp: avoid infinite loop in tcp_splice_read()

2017-02-06 Thread David Miller
From: Eric Dumazet Date: Fri, 03 Feb 2017 14:59:38 -0800 > From: Eric Dumazet > > Splicing from TCP socket is vulnerable when a packet with URG flag is > received and stored into receive queue. > > __tcp_splice_read() returns 0, and sk_wait_data() immediately > returns since there is the probl

Re: [PATCH net-next][v2] bpf: test for AND edge cases

2017-02-06 Thread David Miller
From: Josef Bacik Date: Fri, 3 Feb 2017 16:25:23 -0500 > These two tests are based on the work done for f23cc643f9ba. The first test > is > just a basic one to make sure we don't allow AND'ing negative values, even if > it > would result in a valid index for the array. The second is a cleaned

Re: [RFC] igmp: address pmc kmemleak from on igmpv3_del_delrec()

2017-02-06 Thread David Miller
From: Cong Wang Date: Mon, 6 Feb 2017 16:32:14 -0800 > On Fri, Feb 3, 2017 at 1:20 PM, Luis R. Rodriguez wrote: >> When we igmpv3_add_delrec() we kzalloc the pmc, but when users >> calligmpv3_del_delrec() we never free the pmc. This was caught >> by the following kmemleak splat: >> >> unrefe

[PATCH net-next 1/9] mlx4: use __skb_fill_page_desc()

2017-02-06 Thread Eric Dumazet
Or we might miss the fact that a page was allocated from memory reserves. Fixes: dceeab0e5258 ("mlx4: support __GFP_MEMALLOC for rx") Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net

[PATCH net-next 7/9] mlx4: removal of frag_sizes[]

2017-02-06 Thread Eric Dumazet
We will soon use order-0 pages, and frag truesize will more precisely match real sizes. In the new model, we prefer to use <= 2048 bytes fragments, so that we can use page-recycle technique on PAGE_SIZE=4096 arches. We will still pack as much frames as possible on arches with big pages, like Powe

[PATCH net-next 9/9] mlx4: add page recycling in receive path

2017-02-06 Thread Eric Dumazet
Same technique than some Intel drivers, for arches where PAGE_SIZE = 4096 In most cases, pages are reused because they were consumed before we could loop around the RX ring. This brings back performance, and is even better, a single TCP flow reaches 30Gbit on my hosts. Signed-off-by: Eric Dumaze

[PATCH net-next 8/9] mlx4: use order-0 pages for RX

2017-02-06 Thread Eric Dumazet
Use of order-3 pages is problematic in some cases. This patch might add three kinds of regression : 1) a CPU performance regression, but we will add later page recycling and performance should be back. 2) TCP receiver could grow its receive window slightly slower, because skb->len/skb->truesi

[PATCH net-next 6/9] mlx4: reduce rx ring page_cache size

2017-02-06 Thread Eric Dumazet
We only need to store the page and dma address. Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 17 ++--- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 -- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 6 +- 3 files changed, 15 insertions(+),

[PATCH net-next 5/9] mlx4: rx_headroom is a per port attribute

2017-02-06 Thread Eric Dumazet
No need to duplicate it per RX queue / frags. Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 6 +++--- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b

[PATCH net-next 3/9] mlx4: remove order field from mlx4_en_frag_info

2017-02-06 Thread Eric Dumazet
This is really a port attribute, no need to duplicate it per RX queue and per frag. Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 6 +++--- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH net-next 2/9] mlx4: dma_dir is a mlx4_en_priv attribute

2017-02-06 Thread Eric Dumazet
No need to duplicate it for all queues and frags. num_frags & log_rx_info become u8 to save space. u8 accesses are a bit faster than u16 anyway. Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 16 drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2

[PATCH net-next 4/9] mlx4: get rid of frag_prefix_size

2017-02-06 Thread Eric Dumazet
Using per frag storage for frag_prefix_size is really silly. mlx4_en_complete_rx_desc() has all needed info already. Signed-off-by: Eric Dumazet --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 27 --- drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 3 +-- 2 files chan

[PATCH net-next 0/9] mlx4: order-0 allocations and page recycling

2017-02-06 Thread Eric Dumazet
As mentioned half a year ago, we better switch mlx4 driver to order-0 allocations and page recycling. This reduces vulnerability surface thanks to better skb->truesize tracking and provides better performance in most cases. Worth noting this patch series deletes more than 100 lines of code ;) Er

Re: [PATCH v2 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Andy Lutomirski
On Mon, Feb 6, 2017 at 5:42 PM, Alexei Starovoitov wrote: > On Sat, Feb 04, 2017 at 08:17:57PM -0800, Andy Lutomirski wrote: >> On Sat, Feb 4, 2017 at 8:05 PM, Alexei Starovoitov >> wrote: >> > On Sat, Feb 04, 2017 at 07:33:14PM -0800, Andy Lutomirski wrote: >> >> What does "bpf programs are glob

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

2017-02-06 Thread Stafford Horne
On Mon, Feb 06, 2017 at 04:16:55PM +, David Laight wrote: > From: Stafford Horne > > Sent: 05 February 2017 07:08 > > This was causing a build failure for openrisc when using musl and > > gcc 5.4.0 since the file is not available in the toolchain. > > > > It doesnt seem this is needed and remo

[PATCH v2 0/2] Fixes for sierra_net driver

2017-02-06 Thread Stefan Brüns
When trying to initiate a dual-stack (ipv4v6) connection, a MC7710, FW version SWI9200X_03.05.24.00ap answers with an unsupported LSI. Add support for this LSI. Also the link_type should be ignored when going idle, otherwise the modem is stuck in a bad link state. Tested on MC7710, T-Mobile DE, APN

[PATCH v2 2/2] sierra_net: Skip validating irrelevant fields for IDLE LSIs

2017-02-06 Thread Stefan Brüns
When the context is deactivated, the link_type is set to 0xff, which triggers a warning message, and results in a wrong link status, as the LSI is ignored. Signed-off-by: Stefan Brüns --- drivers/net/usb/sierra_net.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --gi

[PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications

2017-02-06 Thread Stefan Brüns
If a context is configured as dualstack ("IPv4v6"), the modem indicates the context activation with a slightly different indication message. The dual-stack indication omits the link_type (IPv4/v6) and adds additional address fields. IPv6 LSIs are identical to IPv4 LSIs, but have a different link ty

Re: [net-next PATCH v2 5/5] virtio_net: XDP support for adjust_head

2017-02-06 Thread Jason Wang
On 2017年02月07日 03:29, John Fastabend wrote: On 17-02-05 11:08 PM, Jason Wang wrote: On 2017年02月03日 11:16, John Fastabend wrote: Add support for XDP adjust head by allocating a 256B header region that XDP programs can grow into. This is only enabled when a XDP program is loaded. In order to

[PATCH v4 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Alexei Starovoitov
in cases where bpf programs are looking at sockets and packets that belong to different netns, it could be useful to get an id that uniquely identify a netns within the whole system. Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns unique value that identifies netns of given socke

Re: [PATCH v2 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Alexei Starovoitov
On Sat, Feb 04, 2017 at 08:17:57PM -0800, Andy Lutomirski wrote: > On Sat, Feb 4, 2017 at 8:05 PM, Alexei Starovoitov > wrote: > > On Sat, Feb 04, 2017 at 07:33:14PM -0800, Andy Lutomirski wrote: > >> On Sat, Feb 4, 2017 at 7:25 PM, Alexei Starovoitov > >> wrote: > >> > On Sat, Feb 04, 2017 at 09

Re: [PATCH net-next v3 00/12] bnxt_en: Add XDP support.

2017-02-06 Thread Jakub Kicinski
On Mon, 6 Feb 2017 16:55:31 -0500, Michael Chan wrote: > The first 10 patches refactor the code (rx/tx code paths and ring logic) > and add the basic infrastructure to support XDP. The 11th patch adds > basic ndo_xdp to support XDP_DROP and XDP_PASS only. The 12th patch > completes the series wi

Re: [PATCH net] bpf: expose netns inode to bpf programs

2017-02-06 Thread Alexei Starovoitov
On Sat, Feb 04, 2017 at 09:05:29PM -0800, Andy Lutomirski wrote: > > I'm not saying that at all. I'm saying that this use case sounds > valid, but maybe it could be solved differently. Here are some ideas: Great. Combining multiple threads. Replied in bpf_sk_netns_id thread.

Re: [PATCH net-next 1/7] openvswitch: Use inverted tuple in ovs_ct_find_existing() if NATted.

2017-02-06 Thread Joe Stringer
On 5 February 2017 at 14:28, David Miller wrote: > From: Jarno Rajahalme > Date: Thu, 2 Feb 2017 17:10:00 -0800 > >> This does not match either of the conntrack tuples above. Normally >> this does not matter, as the conntrack lookup was already done using >> the tuple (B,A), but if the current

Re: [RFC] igmp: address pmc kmemleak from on igmpv3_del_delrec()

2017-02-06 Thread Cong Wang
On Fri, Feb 3, 2017 at 1:20 PM, Luis R. Rodriguez wrote: > When we igmpv3_add_delrec() we kzalloc the pmc, but when users > calligmpv3_del_delrec() we never free the pmc. This was caught > by the following kmemleak splat: > > unreferenced object 0x99666ff43b40 (size 192): > comm "systemd

Re: [PATCH net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Florian Fainelli
On 02/06/2017 04:21 PM, Russell King - ARM Linux wrote: > On Mon, Feb 06, 2017 at 04:11:12PM -0800, Florian Fainelli wrote: >> Introduce a new configuration symbol: MDIO_DEVICE which allows building >> the MDIO devices and bus code, without pulling in the entire Ethernet >> PHY library and devices

Re: [PATCH net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Russell King - ARM Linux
On Mon, Feb 06, 2017 at 04:11:12PM -0800, Florian Fainelli wrote: > Introduce a new configuration symbol: MDIO_DEVICE which allows building > the MDIO devices and bus code, without pulling in the entire Ethernet > PHY library and devices code. > > PHYLIB nows select MDIO_DEVICE and the relevant Ma

Re: [RFC net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Russell King - ARM Linux
On Mon, Feb 06, 2017 at 04:01:27PM -0800, Florian Fainelli wrote: > On 01/30/2017 07:29 PM, Florian Fainelli wrote: > > Introduce a new configuration symbol: MDIO_DEVICE which allows building > > the MDIO devices and bus code, without pulling in the entire Ethernet > > PHY library and devices code.

Re: [PATCH net-next 1/4] net: mv643xx_eth: Do not clobber PHY link outside of state machine

2017-02-06 Thread Andrew Lunn
On Mon, Feb 06, 2017 at 03:55:20PM -0800, Florian Fainelli wrote: > Calling phy_read_status() means that we may call into > genphy_read_status() which in turn will use genphy_update_link() which > can make changes to phydev->link outside of the state machine's state > transitions. This is an invali

[PATCH net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Florian Fainelli
Introduce a new configuration symbol: MDIO_DEVICE which allows building the MDIO devices and bus code, without pulling in the entire Ethernet PHY library and devices code. PHYLIB nows select MDIO_DEVICE and the relevant Makefile files are updated to reflect that. Signed-off-by: Florian Fainelli

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

2017-02-06 Thread Andrew Lunn
On Mon, Feb 06, 2017 at 03:55:23PM -0800, Florian Fainelli wrote: > Calling phy_read_status() means that we may call into > genphy_read_status() which in turn will use genphy_update_link() which > can make changes to phydev->link outside of the state machine's state > transitions. This is an invali

Re: [PATCH v3 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Daniel Borkmann
On 02/07/2017 01:02 AM, Alexei Starovoitov wrote: On 2/6/17 3:39 PM, Daniel Borkmann wrote: On 02/04/2017 04:34 AM, Alexei Starovoitov wrote: [...] +BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb) +{ +struct net_device *dev = skb->dev; + +if (!dev) +return 0; +return pro

Re: [RFC net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Andrew Lunn
> > Introduce a new configuration symbol: MDIO_DEVICE which allows building > > the MDIO devices and bus code, without pulling in the entire Ethernet > > PHY library and devices code. > > > > PHYLIB nows select MDIO_DEVICE and the relevant Makefile files are > > updated to reflect that. > > > > S

Re: [PATCH v3 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Alexei Starovoitov
On 2/6/17 3:39 PM, Daniel Borkmann wrote: On 02/04/2017 04:34 AM, Alexei Starovoitov wrote: [...] +BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb) +{ +struct net_device *dev = skb->dev; + +if (!dev) +return 0; +return proc_get_ns_devid_inum(&dev_net(dev)->ns); +} + +stati

Re: [RFC net-next] net: phy: Allow splitting MDIO bus/device support from PHYs

2017-02-06 Thread Florian Fainelli
On 01/30/2017 07:29 PM, Florian Fainelli wrote: > Introduce a new configuration symbol: MDIO_DEVICE which allows building > the MDIO devices and bus code, without pulling in the entire Ethernet > PHY library and devices code. > > PHYLIB nows select MDIO_DEVICE and the relevant Makefile files are >

[PATCH net-next 0/4] net: Incorrect use of phy_read_status()

2017-02-06 Thread Florian Fainelli
Hi all, This patch series removes incorrect uses of phy_read_status() which can clobber the PHY device link while we are executing with the state machine running. greth was potentially another candidate, but it does funky stuff with auto-negotation that I am still trying to understand. Florian F

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

2017-02-06 Thread Florian Fainelli
Calling phy_read_status() means that we may call into genphy_read_status() which in turn will use genphy_update_link() which can make changes to phydev->link outside of the state machine's state transitions. This is an invalid behavior that is now caught as of 811a919135b9 ("phy state machine: fail

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

2017-02-06 Thread Florian Fainelli
Calling phy_read_status() means that we may call into genphy_read_status() which in turn will use genphy_update_link() which can make changes to phydev->link outside of the state machine's state transitions. This is an invalid behavior that is now caught as of 811a919135b9 ("phy state machine: fail

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

2017-02-06 Thread Florian Fainelli
Calling phy_read_status() means that we may call into genphy_read_status() which in turn will use genphy_update_link() which can make changes to phydev->link outside of the state machine's state transitions. This is an invalid behavior that is now caught as off 811a919135b9 ("phy state machine: fai

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

2017-02-06 Thread Florian Fainelli
Calling phy_read_status() means that we may call into genphy_read_status() which in turn will use genphy_update_link() which can make changes to phydev->link outside of the state machine's state transitions. This is an invalid behavior that is now caught as of 811a919135b9 ("phy state machine: fail

RE: [Intel-wired-lan] [PATCH] net: intel: i40evf: use new api ethtool_{get|set}_link_ksettings

2017-02-06 Thread Wyborny, Carolyn
> -Original Message- > From: Intel-wired-lan [mailto:intel-wired-lan-boun...@lists.osuosl.org] On > Behalf Of Philippe Reynes > Sent: Saturday, February 04, 2017 2:49 PM > To: Kirsher, Jeffrey T ; da...@davemloft.net > Cc: netdev@vger.kernel.org; intel-wired-...@lists.osuosl.org; linux- > k

Re: net/kcm: WARNING in kcm_write_msgs

2017-02-06 Thread Cong Wang
On Mon, Feb 6, 2017 at 4:43 AM, Dmitry Vyukov wrote: > [resending as plain text] > > Hello, > > The following program triggers WARNING in kcm_write_msgs: > > WARNING: CPU: 3 PID: 2936 at net/kcm/kcmsock.c:627 > kcm_write_msgs+0x12e3/0x1b90 net/kcm/kcmsock.c:627 > CPU: 3 PID: 2936 Comm: a.out Not t

[pull request][net-next V2 0/6] Mellanox mlx5 updates 2017-01-31

2017-02-06 Thread Saeed Mahameed
Hi Dave, This pull request includes two new mlx5 features and two small fixes for net-next, Details are bleow. Please pull and let me know if there's any problem. Sorry for the delay on addressing the comments. v1->v2: - Addressed the comments on the static checker fix patch - S

[net-next V2 3/6] net/mlx5: TX WQE update

2017-02-06 Thread Saeed Mahameed
Add new TX WQE fields for Connect-X5 vlan insertion support, type and vlan_tci, when type = MLX5_ETH_WQE_INSERT_VLAN the HW will insert the vlan and prio fields (vlan_tci) to the packet. Those bits and the inline header fields are mutually exclusive, and valid only when: MLX5_CAP_ETH(mdev, wqe_inl

[net-next V2 4/6] net/mlx5e: Tx, no inline copy on ConnectX-5

2017-02-06 Thread Saeed Mahameed
ConnectX-5 and later HW generations will report min inline mode == MLX5_INLINE_MODE_NONE, which means driver is not required to copy packet headers to inline fields of TX WQE. When inline is not required, vlan insertion will be handled in the TX descriptor rather than copy to inline. For LSO case

[net-next V2 1/6] net/mlx5: Fix static checker warnings

2017-02-06 Thread Saeed Mahameed
From: Or Gerlitz For some reason, sparse doesn't like using an expression of type (!x) with a bitwise | and &. In order to mitigate that, we use a local variable. This removes the following sparse complaints on the core driver (and similar ones on the IB driver too): drivers/net/ethernet/mella

[net-next V2 5/6] net/mlx5e: XDP Tx, no inline copy on ConnectX-5

2017-02-06 Thread Saeed Mahameed
ConnectX-5 and later HW generations will report min inline mode == MLX5_INLINE_MODE_NONE, which means driver is not required to copy packet headers to inline fields of TX WQE. Avoid copy to inline segment in XDP TX routine when HW inline mode doesn't require it. This will improve CPU utilization

[net-next V2 6/6] net/mlx5e: Bring back bfreg uar map dedicated pointer

2017-02-06 Thread Saeed Mahameed
4K Uar series modified the mlx5e driver to use the new bfreg API, and mistakenly removed the sq->uar_map iomem data path dedicated pointer, which was meant to be read from xmit path for cache locality utilization. Fix that by returning that pointer to the SQ struct. Fixes: 7309cb4ad71e ("IB/mlx5:

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

2017-02-06 Thread Saeed Mahameed
From: Daniel Jurgens There is a hardware feature that will pad the start or end of a DMA to be cache line aligned to avoid RMWs on the last cache line. The default cache line size setting for this feature is 64B. This change configures the hardware to use 128B alignment on systems with 128B cache

Re: [PATCH v3 net] bpf: add bpf_sk_netns_id() helper

2017-02-06 Thread Daniel Borkmann
On 02/04/2017 04:34 AM, Alexei Starovoitov wrote: [...] +BPF_CALL_1(bpf_skb_netns_id, struct sk_buff *, skb) +{ + struct net_device *dev = skb->dev; + + if (!dev) + return 0; + return proc_get_ns_devid_inum(&dev_net(dev)->ns); +} + +static const struct bpf_func_pro

Re: [PATCH iproute2] ip route: Make name of protocol 0 consistent

2017-02-06 Thread David Ahern
On 2/6/17 3:01 PM, Stephen Hemminger wrote: > On Thu, 2 Feb 2017 09:22:06 -0800 > David Ahern wrote: > >> iproute2 can inconsistently show the name of protocol 0 if a route with >> a custom protocol is added. For example: >> dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec

Re: net/icmp: null-ptr-deref in ping_v4_push_pending_frames

2017-02-06 Thread Florian Westphal
Cong Wang wrote: > On Mon, Feb 6, 2017 at 11:39 AM, Andrey Konovalov > wrote: > > Hi, > > > > I've got the following error report while running the syzkaller fuzzer. > > > > The null-ptr-deref is caused by sendto() on a socket(PF_INET, > > SOCK_DGRAM, PROT_ICMP). > > Note, that this requires the

[PATCH net-next v2 1/8] bpf: Use bpf_load_program() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_prog_load() with bpf_load_program() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c | 9 - tools/lib/bpf/bpf.h | 4 ++-- tools/testing/selftests/bpf/Mak

[PATCH] net: ethernet: ti: cpsw: remove netif_trans_update

2017-02-06 Thread Ivan Khoronzhuk
No need to update jiffies in txq->trans_start twice, it's supposed to be done in netdev_start_xmit() and anyway is re-written. Also, no reason to update trans time in case of an error. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 2 -- 1 file chan

[PATCH net-next v2 3/8] bpf: Use bpf_map_lookup_elem() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_map_lookup() with bpf_map_lookup_elem() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c| 5 ++--- tools/lib/bpf/bpf.h| 2 +- tools/testing/selftests/bpf/bpf_sys

[PATCH net-next v2 2/8] bpf: Use bpf_map_update_elem() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_map_update() with bpf_map_update_elem() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c| 5 +-- tools/lib/bpf/bpf.h| 2 +- tools/testing/selftests/bpf/bpf_sys.h

[PATCH net-next v2 4/8] bpf: Use bpf_map_delete_elem() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_map_delete() with bpf_map_delete_elem() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c| 5 ++--- tools/lib/bpf/bpf.h| 2 +- tools/testing/selftests/bpf/bpf_sys

[PATCH net-next v2 5/8] bpf: Use bpf_map_get_next_key() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_map_next_key() with bpf_map_get_next_key() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c| 5 ++--- tools/lib/bpf/bpf.h| 2 +- tools/testing/selftests/bpf/bpf_

[PATCH v2] netfilter: xt_hashlimit: Fix integer divide round to zero.

2017-02-06 Thread Alban Browaeys
Diving the divider by the multiplier before applying to the input. When this would "divide by zero", divide the multiplier by the divider first then multiply the input by this value. Currently user2creds outputs zero when input value is bigger than the number of slices and lower than scale. This

[PATCH net-next v2 8/8] bpf: Add test_tag to .gitignore

2017-02-06 Thread Mickaël Salaün
Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/testing/selftests/bpf/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore index d3b1c9bca407..541d9d7fad

Re: net/icmp: null-ptr-deref in ping_v4_push_pending_frames

2017-02-06 Thread Cong Wang
On Mon, Feb 6, 2017 at 11:39 AM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while running the syzkaller fuzzer. > > The null-ptr-deref is caused by sendto() on a socket(PF_INET, > SOCK_DGRAM, PROT_ICMP). > Note, that this requires the ability to create such sockets, whic

[PATCH net-next v2 7/8] bpf: Remove bpf_sys.h from selftests

2017-02-06 Thread Mickaël Salaün
Add require dependency headers. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c | 6 ++ tools/testing/selftests/bpf/bpf_sys.h | 27 --- tools/testing/selftests/bpf/test_l

[PATCH net-next v2 6/8] bpf: Use bpf_create_map() from the library

2017-02-06 Thread Mickaël Salaün
Replace bpf_map_create() with bpf_create_map() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/testing/selftests/bpf/bpf_sys.h | 15 --- tools/testing/selftests/bpf/test_lpm_map.c | 6 +++--- tools/testing/selftests/

Re: [PATCH net-next v1 6/7] bpf: Use the bpf_load_program() from the library

2017-02-06 Thread Mickaël Salaün
On 06/02/2017 23:44, Daniel Borkmann wrote: > On 02/06/2017 10:30 PM, Mickaël Salaün wrote: >> On 06/02/2017 20:18, Daniel Borkmann wrote: >>> On 02/06/2017 08:16 PM, Mickaël Salaün wrote: On 06/02/2017 16:30, Daniel Borkmann wrote: > On 02/06/2017 12:14 AM, Mickaël Salaün wrote: >>

Re: [PATCH net-next v2 3/3] bpf: Always test unprivileged programs

2017-02-06 Thread Daniel Borkmann
On 02/06/2017 09:52 PM, Mickaël Salaün wrote: If selftests are run as root, then execute the unprivileged checks as well. This switch from 240 to 364 tests. The test numbers are suffixed with "/u" when executed as unprivileged or with "/p" when executed as privileged. The geteuid() check is rep

Re: [PATCH net-next v1 6/7] bpf: Use the bpf_load_program() from the library

2017-02-06 Thread Daniel Borkmann
On 02/06/2017 10:30 PM, Mickaël Salaün wrote: On 06/02/2017 20:18, Daniel Borkmann wrote: On 02/06/2017 08:16 PM, Mickaël Salaün wrote: On 06/02/2017 16:30, Daniel Borkmann wrote: On 02/06/2017 12:14 AM, Mickaël Salaün wrote: Replace bpf_prog_load() with bpf_load_program() calls. Use the too

Re: [PATCH iproute2/net-next 0/7] tc: flower: Masked ICMP match and ND match

2017-02-06 Thread Stephen Hemminger
On Thu, 2 Feb 2017 11:38:33 +0100 Simon Horman wrote: > Hi, > > this series have several related parts. > > * tc: flower: Update documentation to indicate ARP takes IPv4 prefixes > > Enhance documentation for consistency with later documentation changes. > > * tc: flower: use correct type

Re: [PATCH iproute2/net-next 0/3] Add the tc-sample action

2017-02-06 Thread Stephen Hemminger
On Sun, 5 Feb 2017 09:58:51 +0200 Yotam Gigi wrote: > This patchset adds the tc-sample action support and the corresponding man > page. More information about the action and its usage can be found in the > commit message. > > Yotam Gigi (3): > tc: Add support for the sample tc action > tc:

Re: [PATCH net-next/iproute 2/5] tc: bash-completion: Prepare action autocomplete to support several actions

2017-02-06 Thread Stephen Hemminger
On Mon, 6 Feb 2017 15:19:21 +0200 Yotam Gigi wrote: > The action autocomplete routine (_tc_action_options) currently does not > support several actions statements in one tc command line as it uses the > _tc_once_attr and _tc_one_from_list. > > For example, in that case: > > $ tc filter add dev

Re: [PATCH iproute2] ip route: Make name of protocol 0 consistent

2017-02-06 Thread Stephen Hemminger
On Thu, 2 Feb 2017 09:22:06 -0800 David Ahern wrote: > iproute2 can inconsistently show the name of protocol 0 if a route with > a custom protocol is added. For example: > dsa@cartman:~$ ip -6 ro ls table all | egrep 'proto none|proto unspec' > local ::1 dev lo table local proto none metr

[PATCH net-next v3 02/12] bnxt_en: Don't use DEFINE_DMA_UNMAP_ADDR to store DMA address in RX path.

2017-02-06 Thread Michael Chan
To support XDP_TX, we need the RX buffer's DMA address to transmit the packet. Convert the DMA address field to a permanent field in bnxt_sw_rx_bd. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 21 + drivers/net/ethernet/broadcom/bnxt/bnxt.h |

[PATCH net-next v3 04/12] bnxt_en: Parameterize RX buffer offsets.

2017-02-06 Thread Michael Chan
Convert the global constants BNXT_RX_OFFSET and BNXT_RX_DMA_OFFSET to device parameters. This will make it easier to support XDP with headroom support which requires different RX buffer offsets. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 +-- driv

[PATCH net-next v3 12/12] bnxt_en: Add support for XDP_TX action.

2017-02-06 Thread Michael Chan
Add dedicated transmit function and transmit completion handler for XDP. The XDP transmit logic and completion logic are different than regular TX ring. The TX buffer is recycled back to the RX ring when it completes. v3: Improved the buffer recyling scheme for XDP_TX. v2: Add trace_xdp_excepti

[PATCH net-next v3 05/12] bnxt_en: Add RX page mode support.

2017-02-06 Thread Michael Chan
This mode is to support XDP. In this mode, each rx ring is configured with page sized buffers for linear placement of each packet. MTU will be restricted to what the page sized buffers can support. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 135

[PATCH net-next v3 10/12] bnxt_en: Refactor tx completion path.

2017-02-06 Thread Michael Chan
XDP_TX requires a different function to handle completion. Add a function pointer to handle tx completion logic. Regular TX rings will be assigned the current bnxt_tx_int() for the ->tx_int() function pointer. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 -

[PATCH net-next v3 08/12] bnxt_en: Add tx ring mapping logic.

2017-02-06 Thread Michael Chan
To support XDP_TX, we need to add a set of dedicated TX rings, each associated with the NAPI of an RX ring. To assign XDP rings and regular rings in a flexible way, we add a bp->tx_ring_map[] array to do the remapping. The netdev txq index is stored in the new field txq_index so that we can retri

[PATCH net-next v3 07/12] bnxt_en: Centralize logic to reserve rings.

2017-02-06 Thread Michael Chan
Currently, bnxt_setup_tc() and bnxt_set_channels() have similar and duplicated code to check and reserve rx and tx rings. Add a new function bnxt_reserve_rings() to centralize the logic. This will make it easier to add XDP_TX support which requires allocating a new set of TX rings. Also, the tx

  1   2   3   >