Re: [patch net-next] net/mlx4_en: fix a condition

2017-02-05 Thread Tariq Toukan
On 03/02/2017 11:54 AM, Dan Carpenter wrote: There is a "||" vs "|" typo here so we test 0x1 instead of 0x6. Fixes: 1f8176f7352a ("net/mlx4_en: Check the enabling pptx/pprx flags in SET_PORT wrapper flow") Signed-off-by: Dan Carpenter diff --git

Re: [PATCHv3 net-next 11/12] net: mvpp2: switch to build_skb() in the RX path

2017-02-05 Thread Marcin Wojtas
Hi Thomas, How about switching to napi_alloc_frag() in mvpp2_rx_refill(), which is called in hotpath? In easy way, it may give some performance gain. Best regards, Marcin 2017-02-02 16:51 GMT+01:00 Thomas Petazzoni : > This commit adapts the mvpp2 RX path to

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

2017-02-05 Thread Saeed Mahameed
On Thu, Feb 2, 2017 at 4:47 PM, Daniel Jurgens wrote: > On 2/1/2017 5:12 AM, David Laight wrote: >> From: Saeed Mahameed >>> Sent: 31 January 2017 20:59 >>> From: Daniel Jurgens >>> >>> There is a hardware feature that will pad the start or end of a

Re: [PATCH] [net-next] net/mlx5e: fix another maybe-uninitialized false-positive

2017-02-05 Thread Or Gerlitz
On Fri, Feb 3, 2017 at 6:37 PM, Arnd Bergmann wrote: > In commit abeffce ("net/mlx5e: Fix a -Wmaybe-uninitialized warning"), I fixed > a > gcc warning for the ipv4 offload handling. Now we get the same warning for the > added ipv6 support: > >

Re: [PATCH v2 1/2] net: phy: dp83867: Port mirroring support in the DP83867 TI's PHY driver

2017-02-05 Thread Lukasz Majewski
Hi Andrew, > On Sat, Feb 04, 2017 at 05:02:11PM +0100, Lukasz Majewski wrote: > > This patch adds support for enabling or disabling the port > > mirroring (at CFG4 register) feature of the DP83867 TI's PHY device. > > As we discussed before, "port mirroring" is bad naming. Yes, we should > use

Re: [net-next 5/8] net/mlx5e: Calc vlan_tag_present only once on xmit

2017-02-05 Thread Saeed Mahameed
On Wed, Feb 1, 2017 at 1:20 PM, David Laight wrote: > From: Saeed Mahameed >> Sent: 31 January 2017 20:59 >> Cache skb_vlan_tag_present(skb) and pass it wherever needed in xmit >> routines. > ... > > Does this actually generate better code? Only in case skb pointer is

ATTT

2017-02-05 Thread Reserve Bank Of India
-- http://www.emailmeform.com/builder/form/f075qleMkAL1H311Gef click the weblink above

Re: [PATCH net-next] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-05 Thread Andrew Lunn
> > +static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id) > > +{ > > + u16 reg; > > + > > + struct mv88e6xxx_chip *chip = dev_id; > > + > > + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ); > > + > > + dev_info(chip->dev, "Watchdog event: %04x", reg); > > Should this

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

2017-02-05 Thread Andy Lutomirski
On Sun, Feb 5, 2017 at 11:24 AM, David Ahern wrote: > On 2/3/17 8:34 PM, Alexei Starovoitov wrote: >> Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns >> unique value that identifies netns of given socket or dev_net(skb->dev) >> The upper 32-bits of the

[PATCH 3.10 257/319] net: sctp, forbid negative length

2017-02-05 Thread Willy Tarreau
From: Jiri Slaby commit a4b8e71b05c27bae6bad3bdecddbc6b68a3ad8cf upstream. Most of getsockopt handlers in net/sctp/socket.c check len against sizeof some structure like: if (len < sizeof(int)) return -EINVAL; On the first look, the check seems to be

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

2017-02-05 Thread Florian Fainelli
Le 02/05/17 à 12:22, Yotam Gigi a écrit : >> -Original Message- >> From: Florian Fainelli [mailto:f.faine...@gmail.com] >> Sent: Sunday, February 05, 2017 8:37 PM >> To: Yotam Gigi ; step...@networkplumber.org; >> netdev@vger.kernel.org; Jiri Pirko ;

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

2017-02-05 Thread David Ahern
On 2/3/17 8:34 PM, Alexei Starovoitov wrote: > Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns > unique value that identifies netns of given socket or dev_net(skb->dev) > The upper 32-bits of the return value contain device id where namespace > filesystem resides and lower

RE: [PATCH iproute2/net-next 1/3] tc: Add support for the sample tc action

2017-02-05 Thread Yotam Gigi
>-Original Message- >From: Florian Fainelli [mailto:f.faine...@gmail.com] >Sent: Sunday, February 05, 2017 8:37 PM >To: Yotam Gigi ; step...@networkplumber.org; >netdev@vger.kernel.org; Jiri Pirko ; Elad Raz > >Subject: Re: [PATCH

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

2017-02-05 Thread Florian Fainelli
On 02/04/2017 11:58 PM, Yotam Gigi wrote: > The sample tc action allows sampling packets matching a classifier. It > peeks randomly packets, and samples them using the psample netlink > channel. The user can specify the psample group, which the packet will be > sampled to, the sampling rate and

[PATCH v2 1/2] mac80211: fils_aead: Use crypto api CMAC shash rather than bare cipher

2017-02-05 Thread Ard Biesheuvel
Switch the FILS AEAD code to use a cmac(aes) shash instantiated by the crypto API rather than reusing the open coded implementation in aes_cmac_vector(). This makes the code more understandable, and allows platforms to implement cmac(aes) in a more secure (*) and efficient way than is typically

[PATCH net] udp: properly cope with csum errors

2017-02-05 Thread Eric Dumazet
From: Eric Dumazet Dmitry reported that UDP sockets being destroyed would trigger the WARN_ON(atomic_read(>sk_rmem_alloc)); in inet_sock_destruct() It turns out we do not properly destroy skb(s) that have wrong UDP checksum. Thanks again to syzkaller team. Fixes :

[PATCH] net: intel: igb: use new api ethtool_{get|set}_link_ksettings

2017-02-05 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 108

[PATCH v2 2/2] mac80211: aes-cmac: switch to shash CMAC driver

2017-02-05 Thread Ard Biesheuvel
Instead of open coding the CMAC algorithm in the mac80211 driver using byte wide xors and calls into the crypto layer for each block of data, instantiate a cmac(aes) synchronous hash and pass all the data into it directly. This does not only simplify the code, it also allows the use of more

[PATCH v2 0/2] mac80211: use crypto shash for AES cmac

2017-02-05 Thread Ard Biesheuvel
This is something I spotted while working on AES in various modes for ARM and arm64. The mac80211 aes_cmac code reimplements the CMAC algorithm based on the core AES cipher, which is rather restrictive in how platforms can satisfy the dependency on this algorithm. For instance, SIMD

[PATCH] net: intel: ixgb: use new api ethtool_{get|set}_link_ksettings

2017-02-05 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c |

Re: [PATCHv1] net-next: treewide use is_vlan_dev() helper function.

2017-02-05 Thread Jonathan Maxwell
On Sun, Feb 5, 2017 at 4:00 AM, Parav Pandit wrote: > This patch makes use of is_vlan_dev() function instead of flag > comparison which is exactly done by is_vlan_dev() helper function. > > Signed-off-by: Parav Pandit > Reviewed-by: Daniel Jurgens

[PATCH net-next v1 1/7] bpf: Add missing header to the library

2017-02-05 Thread Mickaël Salaün
Including stddef.h is needed to define size_t. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: Wang Nan --- tools/lib/bpf/bpf.h | 1 + 1 file

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

2017-02-05 Thread Mickaël Salaün
Replace bpf_prog_load() with bpf_load_program() calls. Use the tools include directory instead of the installed one to allow builds from other kernels. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan

[PATCH net-next v1 2/7] samples/bpf: Ignore already processed ELF sections

2017-02-05 Thread Mickaël Salaün
Add a missing check for the map fixup loop. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann --- samples/bpf/bpf_load.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH net-next v1 3/7] samples/bpf: Reset global variables

2017-02-05 Thread Mickaël Salaün
Before loading a new ELF, clean previous kernel version, license and processed sections. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: David S. Miller

[PATCH net-next v1 7/7] bpf: Always test unprivileged programs

2017-02-05 Thread Mickaël Salaün
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 replaced with a capability check. Handling

[PATCH net-next v1 4/7] tools: Sync {,tools/}include/uapi/linux/bpf.h

2017-02-05 Thread Mickaël Salaün
The tools version of this header is out of date; update it to the latest version from kernel header. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: David S. Miller

[PATCH net-next v1 5/7] bpf: Simplify bpf_load_program() error handling in the library

2017-02-05 Thread Mickaël Salaün
Do not call a second time bpf(2) when a program load failed. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: Wang Nan --- tools/lib/bpf/bpf.c

Re: [PATCH v2 net-next 00/12] net: get rid of __napi_complete()

2017-02-05 Thread David Miller
From: Eric Dumazet Date: Sat, 4 Feb 2017 15:24:50 -0800 > This patch series removes __napi_complete() calls, in an effort > to make NAPI API simpler and generalize GRO and napi_complete_done() Nice cleanup, series applied, thanks Eric.

[PATCH net 1/2] net: phy: Check phydev->drv

2017-02-05 Thread Florian Fainelli
In preparation for supporting driver bind/unbind properly, sprinkle checks on phydev->drv where we may call into PHYLIB from user-space or other parts of the kernel. Suggested-by: Russell King Signed-off-by: Florian Fainelli ---

[PATCH net 0/2] net: phy: Unbind/bind fixes

2017-02-05 Thread Florian Fainelli
Hi all, This patch series addresses the inability to safely unbind and bind PHY drivers by making the appropriate checks throught PHYLIB where we may be directly responding to user-space queries, as well as from within the kernel state machine. The second patch makes the unbind -> bind working

[RFC 1/2] dt: emac: document device-tree based phy discovery and setup

2017-02-05 Thread Christian Lamparter
This patch adds documentation for a new "phy-handler" property and "mdio" sub-node. These allows the enumeration of PHYs which are supported by the phy library under drivers/net/phy. The EMAC ethernet controller in IBM and AMCC 4xx chips is currently stuck with a few privately defined phy

[RFC 2/2] net: emac: add support for device-tree based PHY discovery and setup

2017-02-05 Thread Christian Lamparter
From: Christian Lamparter This patch adds glue-code that allows the EMAC driver to interface with the existing dt-supported PHYs in drivers/net/phy. Because currently, the emac driver maintains a small library of supported phys for in a private phy.c file located in the

[PATCH net 2/2] net: phy: Fix PHY driver bind and unbind events

2017-02-05 Thread Florian Fainelli
The PHY library does not deal very well with bind and unbind events. The first thing we would see is that we were not properly canceling the PHY state machine workqueue, so we would be crashing while dereferencing phydev->drv since there is no driver attached anymore. Once we fix that, there are

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

2017-02-05 Thread David Miller
From: John Fastabend Date: Thu, 02 Feb 2017 19:14:05 -0800 > 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 \

Re: [PATCH net] ip6_gre: fix ip6gre_err() invalid reads

2017-02-05 Thread David Miller
From: Eric Dumazet Date: Sat, 04 Feb 2017 23:18:55 -0800 > From: Eric Dumazet > > Andrey Konovalov reported out of bound accesses in ip6gre_err() > > If GRE flags contains GRE_KEY, the following expression > *(((__be32 *)p) + (grehlen / 4) - 1) >

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

2017-02-05 Thread David Miller
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 packet does not match any flow in > the

Re: [RFC 1/2] dt: emac: document device-tree based phy discovery and setup

2017-02-05 Thread Florian Fainelli
Le 02/05/17 à 14:25, Christian Lamparter a écrit : > This patch adds documentation for a new "phy-handler" property > and "mdio" sub-node. These allows the enumeration of PHYs which > are supported by the phy library under drivers/net/phy. > > The EMAC ethernet controller in IBM and AMCC 4xx

Re: [RFC 2/2] net: emac: add support for device-tree based PHY discovery and setup

2017-02-05 Thread Florian Fainelli
Le 02/05/17 à 14:25, Christian Lamparter a écrit : > From: Christian Lamparter > > This patch adds glue-code that allows the EMAC driver to interface > with the existing dt-supported PHYs in drivers/net/phy. > > Because currently, the emac driver maintains a small library of

[PATCH] net: intel: igbvf: use new api ethtool_{get|set}_link_ksettings

2017-02-05 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/intel/igbvf/ethtool.c | 38

[PATCH v5 net-next] net: mvneta: implement .set_wol and .get_wol

2017-02-05 Thread Jisheng Zhang
From: Jingju Hou The mvneta itself does not support WOL, but the PHY might. So pass the calls to the PHY Signed-off-by: Jingju Hou Signed-off-by: Jisheng Zhang --- since v4: - address Andrew Lunn's comment since v3: - really

Re: [net-next PATCH v2 3/5] virtio_net: remove duplicate queue pair binding in XDP

2017-02-05 Thread Jason Wang
On 2017年02月03日 11:15, John Fastabend wrote: Factor out qp assignment. Signed-off-by: John Fastabend Acked-by: Jason Wang --- drivers/net/virtio_net.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

Re: [net-next PATCH v2 4/5] virtio_net: refactor freeze/restore logic into virtnet reset logic

2017-02-05 Thread Jason Wang
On 2017年02月03日 11:16, John Fastabend wrote: For XDP we will need to reset the queues to allow for buffer headroom to be configured. In order to do this we need to essentially run the freeze()/restore() code path. Unfortunately the locking requirements between the freeze/restore and reset paths

Re: Fw: [Bug 193911] New: net_prio.ifpriomap is not aware of the network namespace, and discloses all network interface

2017-02-05 Thread Cong Wang
On Fri, Feb 3, 2017 at 3:53 PM, Stephen Hemminger wrote: > > > Begin forwarded message: > > Date: Fri, 03 Feb 2017 21:14:28 + > From: bugzilla-dae...@bugzilla.kernel.org > To: step...@networkplumber.org > Subject: [Bug 193911] New: net_prio.ifpriomap is not aware

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

2017-02-05 Thread Jason Wang
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 ensure that we do not have to unwind queue headroom push queue setup below

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

2017-02-05 Thread Jason Wang
On 2017年02月06日 12:39, Michael S. Tsirkin wrote: On Sun, Feb 05, 2017 at 05:36:34PM -0500, David Miller wrote: From: John Fastabend Date: Thu, 02 Feb 2017 19:14:05 -0800 This series adds adjust head support for virtio. The following is my test setup. I use qemu +

Re: [PATCH v4 net-next] net: mvneta: implement .set_wol and .get_wol

2017-02-05 Thread Jisheng Zhang
Hi Andrew, On Mon, 23 Jan 2017 19:10:34 +0100 Andrew Lunn wrote: > > On Mon, Jan 23, 2017 at 02:55:07PM +0800, Jisheng Zhang wrote: > > From: Jingju Hou > > > > From: Jingju Hou > > > > The mvneta itself does not support WOL, but the PHY might. >

Re: [PATCH v4 net-next] net: mvneta: implement .set_wol and .get_wol

2017-02-05 Thread Jisheng Zhang
On Mon, 6 Feb 2017 15:08:48 +0800 Jisheng Zhang wrote: > Hi Andrew, > > On Mon, 23 Jan 2017 19:10:34 +0100 Andrew Lunn wrote: > > > > > On Mon, Jan 23, 2017 at 02:55:07PM +0800, Jisheng Zhang wrote: > > > From: Jingju Hou > > > > > > From: Jingju Hou

Re: fs, net: deadlock between bind/splice on af_unix

2017-02-05 Thread Cong Wang
On Tue, Jan 31, 2017 at 10:14 AM, Mateusz Guzik wrote: > On Mon, Jan 30, 2017 at 10:44:03PM -0800, Cong Wang wrote: >> Mind being more specific? > > Consider 2 threads which bind the same socket, but with different paths. > > Currently exactly one file will get created, the one

Re: [PATCH net-next] virtio: Fix affinity for >32 VCPUs

2017-02-05 Thread Jason Wang
On 2017年02月03日 14:19, Ben Serebrin wrote: From: Benjamin Serebrin If the number of virtio queue pairs is not equal to the number of VCPUs, the virtio guest driver doesn't assign any CPU affinity for the queue interrupts or the xps aggregation interrupt. So this in fact

Re: [PATCH net-next] virtio: Fix affinity for >32 VCPUs

2017-02-05 Thread Benjamin Serebrin
On Sun, Feb 5, 2017 at 11:24 PM, Jason Wang wrote: > > > On 2017年02月03日 14:19, Ben Serebrin wrote: >> >> From: Benjamin Serebrin >> >> If the number of virtio queue pairs is not equal to the >> number of VCPUs, the virtio guest driver doesn't assign >>

Re: [PATCHv1] net-next: treewide use is_vlan_dev() helper function.

2017-02-05 Thread Johannes Thumshirn
On 02/04/2017 06:00 PM, Parav Pandit wrote: This patch makes use of is_vlan_dev() function instead of flag comparison which is exactly done by is_vlan_dev() helper function. Signed-off-by: Parav Pandit Reviewed-by: Daniel Jurgens --- For

RE: [PATCH iproute2/net-next 1/3] tc: Add support for the sample tc action

2017-02-05 Thread Yotam Gigi
>-Original Message- >From: Florian Fainelli [mailto:f.faine...@gmail.com] >Sent: Sunday, February 05, 2017 10:55 PM >To: Yotam Gigi ; step...@networkplumber.org; >netdev@vger.kernel.org; Jiri Pirko ; Elad Raz > >Subject: Re:

Re: [PATCH net-next] virtio: Fix affinity for >32 VCPUs

2017-02-05 Thread Jason Wang
On 2017年02月06日 15:28, Benjamin Serebrin wrote: On Sun, Feb 5, 2017 at 11:24 PM, Jason Wang wrote: On 2017年02月03日 14:19, Ben Serebrin wrote: From: Benjamin Serebrin If the number of virtio queue pairs is not equal to the number of VCPUs, the virtio

Re: [PATCH net-next] net: dsa: mv88e6xxx: Add watchdog interrupt handler

2017-02-05 Thread Florian Fainelli
On 02/05/2017 08:52 AM, Andrew Lunn wrote: >>> +static irqreturn_t mv88e6xxx_g2_watchdog_thread_fn(int irq, void *dev_id) >>> +{ >>> + u16 reg; >>> + >>> + struct mv88e6xxx_chip *chip = dev_id; >>> + >>> + mv88e6xxx_g2_read(chip, GLOBAL2_WDOG_CONTROL, ); >>> + >>> + dev_info(chip->dev,

Re: [PATCH net-next v2 2/2] Add a eBPF helper function to retrieve socket uid

2017-02-05 Thread kbuild test robot
Hi Chenbo, [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Chenbo-Feng/Two-Helper-function-about-socket-information/20170206-102835 config: x86_64-randconfig-x014-201706 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

[PATCH net] ipv6: tcp: add a missing tcp_v6_restore_cb()

2017-02-05 Thread Eric Dumazet
From: Eric Dumazet Dmitry reported use-after-free in ip6_datagram_recv_specific_ctl() A similar bug was fixed in commit 8ce48623f0cf ("ipv6: tcp: restore IP6CB for pktoptions skbs"), but I missed another spot. tcp_v6_syn_recv_sock() can indeed set np->pktoptions from

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

2017-02-05 Thread Stephen Rothwell
Hi Dave, Today's linux-next merge of the drm tree got a conflict in: lib/Kconfig between commit: 44091d29f207 ("lib: Introduce priority array area manager") from the net-next tree and commit: cf4a7207b1cb ("lib: Add a simple prime number generator") from the drm tree. I fixed it up

Re: [PATCH net-next v2 2/2] Add a eBPF helper function to retrieve socket uid

2017-02-05 Thread Eric Dumazet
On Sun, 2017-02-05 at 18:17 -0800, Chenbo Feng wrote: > From: Chenbo Feng > > Returns the owner uid of the socket inside a sk_buff. This is useful to > perform per-UID accounting of network traffic or per-UID packet > filtering. > > Signed-off-by: Chenbo Feng

Re: [PATCH net-next v2 1/2] Add a helper function to get socket cookie in eBPF

2017-02-05 Thread Eric Dumazet
On Mon, 2017-02-06 at 12:01 +0900, Lorenzo Colitti wrote: > On Mon, Feb 6, 2017 at 11:17 AM, Chenbo Feng > wrote: > > +BPF_CALL_1(bpf_get_socket_cookie, struct sk_buff *, skb) > > +{ > > + return skb->sk ? sock_gen_cookie(skb->sk) : 0; > > +} > > + > > Does

[PATCH net-next v2 0/2] Two Helper function about socket information

2017-02-05 Thread Chenbo Feng
From: Chenbo Feng Introduce two eBpf helper function to get the socket cookie and socket uid for each packet. The helper function is useful when the *sk field inside sk_buff is not empty. Chenbo Feng (2): Add a helper function to get socket cookie in eBPF Add a eBPF helper

[PATCH net-next v2 2/2] Add a eBPF helper function to retrieve socket uid

2017-02-05 Thread Chenbo Feng
From: Chenbo Feng Returns the owner uid of the socket inside a sk_buff. This is useful to perform per-UID accounting of network traffic or per-UID packet filtering. Signed-off-by: Chenbo Feng --- include/uapi/linux/bpf.h | 9 -

[PATCH net-next v2 1/2] Add a helper function to get socket cookie in eBPF

2017-02-05 Thread Chenbo Feng
From: Chenbo Feng Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff with a known socket. Generates a new cookie if one was not yet set.If the socket pointer inside sk_buff is NULL, 0 is returned. The helper function coud be useful in monitoring per socket

Re: [PATCH net-next v2 1/2] Add a helper function to get socket cookie in eBPF

2017-02-05 Thread Eric Dumazet
On Sun, 2017-02-05 at 18:17 -0800, Chenbo Feng wrote: > From: Chenbo Feng > > Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff > with a known socket. Generates a new cookie if one was not yet set.If > the socket pointer inside sk_buff is NULL, 0 is

Re: [PATCH net-next v2 1/2] Add a helper function to get socket cookie in eBPF

2017-02-05 Thread Lorenzo Colitti
On Mon, Feb 6, 2017 at 11:17 AM, Chenbo Feng wrote: > +BPF_CALL_1(bpf_get_socket_cookie, struct sk_buff *, skb) > +{ > + return skb->sk ? sock_gen_cookie(skb->sk) : 0; > +} > + Does this code need to increment the socket refcount, or call ACCESS_ONCE to get

Re: [PATCH net-next 2/2] Add a eBPF helper function to retrieve socket uid

2017-02-05 Thread Lorenzo Colitti
On Fri, Feb 3, 2017 at 10:51 AM, Eric Dumazet wrote: > if (sk) { > sk = sk_to_full_sk(sk); > if (sk_fullsock(sk)) > return sk->sk_uid; > } Sure, though sk_to_full_sk is in inet_sock.h so I have to move some core around. Options I see: 1. Move

Re: [net-next PATCH v2 1/5] virtio_net: wrap rtnl_lock in test for calling with lock already held

2017-02-05 Thread Jason Wang
On 2017年02月03日 11:14, John Fastabend wrote: For XDP use case and to allow ethtool reset tests it is useful to be able to use reset paths from contexts where rtnl lock is already held. This requries updating virtnet_set_queues and free_receive_bufs the two places where rtnl_lock is taken in

Re: [net-next PATCH v2 2/5] virtio_net: factor out xdp handler for readability

2017-02-05 Thread Jason Wang
On 2017年02月03日 11:15, John Fastabend wrote: At this point the do_xdp_prog is mostly if/else branches handling the different modes of virtio_net. So remove it and handle running the program in the per mode handlers. Signed-off-by: John Fastabend Acked-by: Jason

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

2017-02-05 Thread Michael S. Tsirkin
On Sun, Feb 05, 2017 at 05:36:34PM -0500, David Miller wrote: > From: John Fastabend > Date: Thu, 02 Feb 2017 19:14:05 -0800 > > > This series adds adjust head support for virtio. The following is my > > test setup. I use qemu + virtio as follows, > > > >

[lkp-robot] [net] 5e2f2bdf34: BUG:unable_to_handle_kernel

2017-02-05 Thread kernel test robot
FYI, we noticed the following commit: commit: 5e2f2bdf34997460bc590e2bf56438fa9ec50322 ("net: ipv6: Keep nexthop of multipath route on admin down") url: https://github.com/0day-ci/linux/commits/David-Ahern/net-ipv6-Keep-nexthop-of-multipath-route-on-admin-down/20170119-120949 in testcase:

Re: Understanding mutual exclusion between rtnl_lock and rcu_read_lock

2017-02-05 Thread Cong Wang
On Fri, Feb 3, 2017 at 7:25 PM, Joel Cunningham wrote: > From the documentation in dev.c: > /* > * The @dev_base_head list is protected by @dev_base_lock and the rtnl > * semaphore. > * > * Pure readers hold dev_base_lock for reading, or rcu_read_lock() > * > *

Re: net: deadlock on genl_mutex

2017-02-05 Thread Cong Wang
On Sun, Jan 29, 2017 at 2:11 AM, Dmitry Vyukov wrote: > On Fri, Dec 9, 2016 at 6:08 AM, Cong Wang wrote: Chain exists of: Possible unsafe locking scenario: CPU0CPU1