GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years agopptp: Refactor the struct and macros of PPTP codes
Gao Feng [Fri, 12 Aug 2016 16:30:48 +0000 (00:30 +0800)]
pptp: Refactor the struct and macros of PPTP codes

1. Use struct gre_base_hdr directly in pptp_gre_header instead of
duplicated members;
2. Use existing macros like GRE_KEY, GRE_SEQ, and so on instead of
duplicated macros defined by PPTP;
3. Add new macros like GRE_IS_ACK/SEQ and so on instead of
PPTP_GRE_IS_A/S and so on;

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: dsa: b53: remove .owner and .bus fields for driver
Wei Yongjun [Fri, 12 Aug 2016 15:46:57 +0000 (15:46 +0000)]
net: dsa: b53: remove .owner and .bus fields for driver

Remove .owner and .bus fields since module_spi_driver() is used
which set them automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: macb: add missing free_netdev() on error in macb_probe()
Wei Yongjun [Fri, 12 Aug 2016 15:43:54 +0000 (15:43 +0000)]
net: macb: add missing free_netdev() on error in macb_probe()

Add the missing free_netdev() before return from function macb_probe()
in the platform_get_irq() error handling case.

Fixes: c69618b3e4f2 ("net/macb: fix probe sequence to setup clocks earlier")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: Fix possible memory leak in qed_dcbnl_get_ieee_pfc()
Wei Yongjun [Thu, 11 Aug 2016 23:29:54 +0000 (23:29 +0000)]
qed: Fix possible memory leak in qed_dcbnl_get_ieee_pfc()

'dcbx_info is malloced in qed_dcbnl_get_ieee_pfc() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: a1d8d8a51e83 ("qed: Add dcbnl support.")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'cxgb4-IFLA_VF_MAC'
David S. Miller [Mon, 15 Aug 2016 04:16:58 +0000 (21:16 -0700)]
Merge branch 'cxgb4-IFLA_VF_MAC'

Hariprasad Shenai says:

====================
cxgb4: Add support for IFLA_VF_MAC

We're struggling to implement the PCI SR-IOV management features for
administering Virtual Functions which represent networking devices using
the current Linux APIs. The problem is that these APIs incorporate all
sorts of assumptions which don't match chelsio networking cards.

For instance, the current APIs assume a 1-to-1 mapping of Network Ports,
Physical Functions and the SR-IOV Virtual Functions of those Physical
Functions. This is not the case with our cards where any Virtual Function
can be hooked up to any Port -- or any number of Ports the current Linux
APIs also assume only 1 Network Interface/Port can be accessed per Virtuali
Function.

Another issue is that these APIs assume that the Administrative Driver is
attached to the Physical Function Associated with a Virtual Function. This
is not the case with our card where all administration is performed by a
Driver which is not attached to any of the Physical Functions which have
SR-IOV PCI Capabilities.

Another consequence of these assumptions is the inability to utilize all
of the cards SR-IOV resources. For instance, our cards have SR-IOV
Capabilities on Physical Functions 0..3 and the administrative Driver
attaches to Physical Function 4. Each of the Physical Functions 0..3 can
support up to 16 Virtual Functions. With the current Linux APIs, a 2-Port
card would only be able to use the Virtual Functions on Physical
Function 0..1 and not allow the Virtual Functions on Physical
Functions 2..3 to be used since there are no Ports 2..3 on a 2-Port card.

Patch 1/2 adds support to create management interface for each PF to control
thier corresponding VF's. Patch 2/2 adds support for ndo_set_vf_mac.

This patch series has been created against net-next tree.

We have included all the maintainers of respective drivers. Kindly review
the change and let us know in case of any review comments.

V5: Fix warning reported by kbuild bot when CONFIG_PCI_IOV isn't defined.

V4: Handle memory allocation failure for adapter->mbox_log in init_one().
    Based on review comment by Yuval Mintz <Yuval.Mintz@qlogic.com>

V3: Based on review comment by Yuval Mintz, removed extra parameter pf
    added to IFLA_VF API's and created a net_device corresponding to
    each PF for controling their VF. Based on review comment by
    Yuval Mintz <Yuval.Mintz@qlogic.com>

V2: Fixed check for MAC address in Patch 2/2, based on review comment by
    Yuval Mintz <Yuval.Mintz@qlogic.com>
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4/cxgb4vf: Add set VF mac address support
Hariprasad Shenai [Thu, 11 Aug 2016 15:36:24 +0000 (21:06 +0530)]
cxgb4/cxgb4vf: Add set VF mac address support

Add ndo_set_vf_mac support which allows to set the MAC address
for cxgb4vf interfaces from the host

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: Add control net_device for configuring PCIe VF
Hariprasad Shenai [Thu, 11 Aug 2016 15:36:23 +0000 (21:06 +0530)]
cxgb4: Add control net_device for configuring PCIe VF

Issue:
For instance, the current APIs assume a 1-to-1 mapping of Network Ports,
Physical Functions and the SR-IOV Virtual Functions of those Physical
Functions. This is not the case with our cards where any Virtual
Function can be hooked up to any Port -- or any number of Ports the
current Linux APIs also assume only 1 Network Interface/Port can be
accessed per Virtual Function.

Another issue is that these APIs assume that the Administrative Driver
is attached to the Physical Function Associated with a Virtual Function.
This is not the case with our card where all administration is performed
by a Driver which is not attached to any of the Physical Functions which
have SR-IOV PCI Capabilities.

Another consequence of these assumptions is the inability to utilize all
of the cards SR-IOV resources. For instance, our cards have SR-IOV
Capabilities on Physical Functions 0..3 and the administrative Driver
attaches to Physical Function 4. Each of the Physical Functions 0..3 can
support up to 16 Virtual Functions. With the current Linux APIs, a
2-Port card would only be able to use the Virtual Functions on Physical
Function 0..1 and not allow the Virtual Functions on Physical Functions
2..3 to be used since there are no Ports 2..3 on a 2-Port card.

Fix:
Since the control node is always the netdevice for all VF ACL commands.
Created a dummy netdevice for each Physical Function from 0 to 3 through
which one could control their VFs. The device won't be associated with
any port, since it doesn't need to transmit/receive. Its purely used
for VF management purpose only. The device will be registered only when
VF for a particular PF is configured using PCI sysfs interface and
unregistered while pci_disable_sriov() for the PF is called.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'proc-per-ns'
David S. Miller [Mon, 15 Aug 2016 04:09:11 +0000 (21:09 -0700)]
Merge branch 'proc-per-ns'

Dmitry Torokhov says:

====================
Make /proc per net namespace objects belong to container

Currently [almost] all /proc objects belong to the global root, even if
data belongs to a given namespace within a container and (at least for
sysctls) we work around permssions checks to allow container's root to
access the data.

This series changes ownership of net namespace /proc objects
(/proc/net/self/* and /proc/sys/net/*) to be container's root and not
global root when there exists mapping for container's root in user
namespace.

This helps when running Android CTS in a container, but I think it makes
sense regardless.

Changes from V1:

- added fix for crash when !CONFIG_NET_NS (new patch #1)
- addressed Eric'c comments for error handling style in patch #3 and
  added his Ack
- adjusted patch #2 to use the same style of erro handling
- sent out as series instead of separate patches
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: make net namespace sysctls belong to container's owner
Dmitry Torokhov [Wed, 10 Aug 2016 21:36:02 +0000 (14:36 -0700)]
net: make net namespace sysctls belong to container's owner

If net namespace is attached to a user namespace let's make container's
root owner of sysctls affecting said network namespace instead of global
root.

This also allows us to clean up net_ctl_permissions() because we do not
need to fudge permissions anymore for the container's owner since it now
owns the objects in question.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoproc: make proc entries inherit ownership from parent
Dmitry Torokhov [Wed, 10 Aug 2016 21:36:01 +0000 (14:36 -0700)]
proc: make proc entries inherit ownership from parent

There are certain parameters that belong to net namespace and that are
exported in /proc. They should be controllable by the container's owner,
but are currently owned by global root and thus not available.

Let's change proc code to inherit ownership of parent entry, and when
create per-ns "net" proc entry set it up as owned by container's owner.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonetns: do not call pernet ops for not yet set up init_net namespace
Dmitry Torokhov [Wed, 10 Aug 2016 21:36:00 +0000 (14:36 -0700)]
netns: do not call pernet ops for not yet set up init_net namespace

When CONFIG_NET_NS is disabled, registering pernet operations causes
init() to be called immediately with init_net as an argument. Unfortunately
this leads to some pernet ops, such as proc_net_ns_init() to be called too
early, when init_net namespace has not been fully initialized. This causes
issues when we want to change pernet ops to use more data from the net
namespace in question, for example reference user namespace that owns our
network namespace.

To fix this we could either play game of musical chairs and rearrange init
order, or we could do the same as when CONFIG_NET_NS is enabled, and
postpone calling pernet ops->init() until namespace is set up properly.

Note that we can not simply undo commit ed160e839d2e ("[NET]: Cleanup
pernet operation without CONFIG_NET_NS") and use the same implementations
for __register_pernet_operations() and __unregister_pernet_operations(),
because many pernet ops are marked as __net_initdata and will be discarded,
which wreaks havoc on our ops lists. Here we rely on the fact that we only
use lists until init_net is fully initialized, which happens much earlier
than discarding __net_initdata sections.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: phy: initialize rc to zero to avoid returning garbage value
Colin Ian King [Fri, 12 Aug 2016 20:29:24 +0000 (21:29 +0100)]
net: phy: initialize rc to zero to avoid returning garbage value

In the case where phydev->interrupts is not PHY_INTERRUPT_ENABLED
function vsc85xx_ack_interrupt is returning an uninitialized
garbage value.  Fix this by initializing rc to zero.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: bfin_mac: Fix a few spelling fixes
LABBE Corentin [Fri, 12 Aug 2016 12:58:02 +0000 (14:58 +0200)]
net: bfin_mac: Fix a few spelling fixes

This patch respell some word badly spelled.
- Invidate instead of Invalidate
- proble instead of probe

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge tag 'mac80211-next-for-davem-2016-08-12' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Sat, 13 Aug 2016 22:11:05 +0000 (15:11 -0700)]
Merge tag 'mac80211-next-for-davem-2016-08-12' of git://git./linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Not much for -next so far, but here it goes:
 * send more nl80211 events for interfaces
 * remove useless network/transport offset mangling code
 * validate beacon intervals identically for all interface types
 * use driver rate estimates for mesh
 * fix a compiler type/signedness warning
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'net-urb-alloc-failure'
David S. Miller [Sat, 13 Aug 2016 21:53:41 +0000 (14:53 -0700)]
Merge branch 'net-urb-alloc-failure'

Wolfram Sang says:

====================
net: don't print error when allocating urb fails

This per-subsystem series is part of a tree wide cleanup. usb_alloc_urb() uses
kmalloc which already prints enough information on failure. So, let's simply
remove those "allocation failed" messages from drivers like we did already for
other -ENOMEM cases. gkh acked this approach when we talked about it at LCJ in
Tokyo a few weeks ago.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:13:08 +0000 (23:13 +0200)]
net: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: marvell: mwifiex: usb: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:13:07 +0000 (23:13 +0200)]
net: wireless: marvell: mwifiex: usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb...
Wolfram Sang [Thu, 11 Aug 2016 21:13:06 +0000 (23:13 +0200)]
net: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: intersil: orinoco: orinoco_usb: don't print error when allocating...
Wolfram Sang [Thu, 11 Aug 2016 21:13:05 +0000 (23:13 +0200)]
net: wireless: intersil: orinoco: orinoco_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error when allocating...
Wolfram Sang [Thu, 11 Aug 2016 21:05:31 +0000 (23:05 +0200)]
net: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wireless: ath: ar5523: ar5523: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:30 +0000 (23:05 +0200)]
net: wireless: ath: ar5523: ar5523: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: wimax: i2400m: usb-notif: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:29 +0000 (23:05 +0200)]
net: wimax: i2400m: usb-notif: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: usb: usbnet: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:28 +0000 (23:05 +0200)]
net: usb: usbnet: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: usb: lan78xx: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:27 +0000 (23:05 +0200)]
net: usb: lan78xx: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Acked-by: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: usb: hso: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:26 +0000 (23:05 +0200)]
net: usb: hso: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: usb_8dev: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:25 +0000 (23:05 +0200)]
net: can: usb: usb_8dev: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:24 +0000 (23:05 +0200)]
net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: kvaser_usb: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:23 +0000 (23:05 +0200)]
net: can: usb: kvaser_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: gs_usb: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:22 +0000 (23:05 +0200)]
net: can: usb: gs_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: esd_usb2: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:21 +0000 (23:05 +0200)]
net: can: usb: esd_usb2: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: can: usb: ems_usb: don't print error when allocating urb fails
Wolfram Sang [Thu, 11 Aug 2016 21:05:20 +0000 (23:05 +0200)]
net: can: usb: ems_usb: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: fix up a few missing hashtable.h conflict resolutions
Jiri Kosina [Fri, 12 Aug 2016 14:34:49 +0000 (16:34 +0200)]
net: fix up a few missing hashtable.h conflict resolutions

There are a couple of leftover symbol conflicts caused by hashtable.h
being included by netdevice.h; those were not caught as build failure
(they're "only" a warning, but in fact real bugs). Fix those up.

Fixes: e87a8f24c ("net: resolve symbol conflicts with generic hashtable.h")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'thunderx-next'
David S. Miller [Sat, 13 Aug 2016 19:00:49 +0000 (12:00 -0700)]
Merge branch 'thunderx-next'

Sunil Goutham says:

====================
net: thunderx: Support for newer chips and miscellaneous patches

This patch series adds support for VNIC on 81xx and 83xx SOCs.
81xx/83xx is different from 88xx in terms of capabilities and new type
of interfaces supported (eg: QSGMII, RGMII) and have DLMs instead of
QLMs which allows single BGX to have interfaces of different LMAC types.

Also included some patches which are common for all 88xx/81xx/83xx
SOCs like using netdev's name while registering irqs, reset receive
queue stats and some changes to use standard API for split buffer Rx
packets, generating RSS key e.t.c

PS: Most of the patches were submitted earlier under different series but
for some reason were not picked up by patchwork. Since new patches have been
added in the meantime, resubmitting all as a new patchset.

Changes from v1:
- Incorporated Yuval Mintz's suggestion to use generic API to set minimum
  queue count i.e by using netif_get_num_default_rss_queues().
- Resolved a compilation issue reported by test robot while compiling
  patch 'Add support for 16 LMACs of 83xx'
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Don't set RX_PACKET_DIS while initializing
Sunil Goutham [Fri, 12 Aug 2016 11:21:44 +0000 (16:51 +0530)]
net: thunderx: Don't set RX_PACKET_DIS while initializing

Setting BGXX_SPUX_MISC_CONTROL::RX_PACKET_DIS is not needed as
packet reception is anyway disabled by BGXX_CMRX_CONFIG::DATA_PKT_RX_EN.
Also setting RX_PACKET_DIS causes a bogus remote fault condition
which delays link detection.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Use netdev_rss_key_fill() helper
Sunil Goutham [Fri, 12 Aug 2016 11:21:43 +0000 (16:51 +0530)]
net: thunderx: Use netdev_rss_key_fill() helper

Use standard API to generate a random RSS hash key
on every boot.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Configure tunnelling protocol parsing
Zyta Szpak [Fri, 12 Aug 2016 11:21:42 +0000 (16:51 +0530)]
net: thunderx: Configure tunnelling protocol parsing

This patch enables parsing of inner layers for tunnelled packets.

Signed-off-by: Zyta Szpak <zr@semihalf.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Use napi_consume_skb for bulk free
Sunil Goutham [Fri, 12 Aug 2016 11:21:41 +0000 (16:51 +0530)]
net: thunderx: Use napi_consume_skb for bulk free

This patch enables bulk freeing on the Tx side.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Don't set mac address for secondary Qset VFs
Sunil Goutham [Fri, 12 Aug 2016 11:21:40 +0000 (16:51 +0530)]
net: thunderx: Don't set mac address for secondary Qset VFs

Set MAC addresses only for primary VF's and don't for
secondary VFs.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Reset RXQ HW stats when interface is brought down
Jerin Jacob [Fri, 12 Aug 2016 11:21:39 +0000 (16:51 +0530)]
net: thunderx: Reset RXQ HW stats when interface is brought down

When SQ/TXQ is reclaimed i.e reset it's stats also automatically reset
by HW. This is not the case with RQ. Also VF doesn't have write access
to statistics counter registers. Hence a new Mbox msg is introduced which
supports resetting RQ, SQ and full Qset stats. Currently only RQ stats
are being reset using this mbox message.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Improvement for MBX interface debug messages
Radoslaw Biernacki [Fri, 12 Aug 2016 11:21:38 +0000 (16:51 +0530)]
net: thunderx: Improvement for MBX interface debug messages

Adding debug messages in case of NACK for a mailbox message, also
did small cleanups.

Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Use skb_add_rx_frag() for split buffer Rx pkts
Sunil Goutham [Fri, 12 Aug 2016 11:21:37 +0000 (16:51 +0530)]
net: thunderx: Use skb_add_rx_frag() for split buffer Rx pkts

Instead of a round about way of converting buffers to SKBs and
combining them into a frag list, use standard skb_add_rx_frag()
API to merge page fragments. This code is useful when incoming
packets are of size more than RCV_FRAG_LEN which is currently
set to 2048bytes.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Use netdev's name for naming VF's interrupts
Sunil Goutham [Fri, 12 Aug 2016 11:21:36 +0000 (16:51 +0530)]
net: thunderx: Use netdev's name for naming VF's interrupts

This patch changes the way VF's irqs are visible in /proc/interrupts.
Instead of VF id, logical interface's netdev name is used for IRQ
naming and also all secondary VF's interrupts in multiqset config
use primary VF's netdev name.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Support for 83xx mixed QLM/DLM config
Sunil Goutham [Fri, 12 Aug 2016 11:21:35 +0000 (16:51 +0530)]
net: thunderx: Support for 83xx mixed QLM/DLM config

83xx has 4 BGX blocks and are enabled mixed QLM/DLM
configs. BGX0/BGX1 are from QLM2/QLM3, BGX3 is DLM4
and BGX2 is split across DLM5 & DLM6.

This patch adds support for BGX2's split config and also
enables all 4 BGXs to be used.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add support for 16 LMACs of 83xx
Sunil Goutham [Fri, 12 Aug 2016 11:21:34 +0000 (16:51 +0530)]
net: thunderx: Add support for 16 LMACs of 83xx

83xx will have 4 BGX blocks i.e 16 LMACs, to avoid changing
the same with every platform, nicpf struct elements which
track LMAC related info are now allocated runtime based
on platform's max possible BGX count.

Also fixed configuring min packet size for all LMAC's
supported on a platform.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add RGMII interface type support
Sunil Goutham [Fri, 12 Aug 2016 11:21:33 +0000 (16:51 +0530)]
net: thunderx: Add RGMII interface type support

This patch adds RGX/RGMII interface type support to BGX
driver. This type of interface is supported by 81xx SOC.

CN81XX VNIC has 8 VFs and max possible LMAC interfaces are 9,
hence RGMII interface will not work if all DLMs are in BGX mode
and all 8 LMACs are enabled

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add QSGMII interface type support
Sunil Goutham [Fri, 12 Aug 2016 11:21:32 +0000 (16:51 +0530)]
net: thunderx: Add QSGMII interface type support

This patch adds support for QSGMII interface type to
the BGX driver. This type of interface is supported by
81xx SOC.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add 81xx support to BGX driver
Sunil Goutham [Fri, 12 Aug 2016 11:21:31 +0000 (16:51 +0530)]
net: thunderx: Add 81xx support to BGX driver

This patch adds support for BGX module on 81xx where a BGX
can be split and have different LMACs configured in
different modes.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Support for different LMAC types within BGX
Sunil Goutham [Fri, 12 Aug 2016 11:21:30 +0000 (16:51 +0530)]
net: thunderx: Support for different LMAC types within BGX

On 88xx all LMACs in a BGX will be in same mode but on 81xx
BGX can be split as two and there can be LMACs configured in
different modes.

These changes move lmac_type, lane2serdes fields into per lmac
struct from BGX struct. Got rid of qlm_mode field which has become
redundant with these changes. And now no of valid LMACs is read
from CSRs configured by low level firmware and figuring out the
same based on QLM mode is discarded

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Enable mailbox interrupts on 81xx/83xx
Sunil Goutham [Fri, 12 Aug 2016 11:21:29 +0000 (16:51 +0530)]
net: thunderx: Enable mailbox interrupts on 81xx/83xx

88xx has 128 VFs, 81xx has 8 VFs and 83xx will have 32VFs.
Made changes to PF driver such that mailbox interrupt enable
registers are configuired based on number of VFs HW supports.
Also cleanedup mailbox irq handler registration code.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Enable CQE_RX desc's extension fields
Sunil Goutham [Fri, 12 Aug 2016 11:21:28 +0000 (16:51 +0530)]
net: thunderx: Enable CQE_RX desc's extension fields

Unlike 88xx, CQE_RX descriptor's tunnelling extension i.e CQE_RX2_S
is always enabled on 81xx/83xx and HW does insert these fields into
CQE_RX. As a result receive buffer addresses will now be present at
7th word of CQE_RX instead of 6th.

Enable CQE_RX2_S on 88xx pass 2.x as well.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Set queue count based on number of CPUs
Sunil Goutham [Fri, 12 Aug 2016 11:21:27 +0000 (16:51 +0530)]
net: thunderx: Set queue count based on number of CPUs

81xx has only 4 CPUs, so it doesn't make sense to initialize
entire Qset i.e 8 queues by default. Made changes to queue
initialization to init queues equal to number of CPUs or
8 queues whichever is lesser. Also this will be applicable to
VMs with VNIC VF attached and having less VCPUs

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add support for 81xx and 83xx chips
Sunil Goutham [Fri, 12 Aug 2016 11:21:26 +0000 (16:51 +0530)]
net: thunderx: Add support for 81xx and 83xx chips

This patch adds info on HW maximums of 81xx/83xx and also
configures receive and transmit datapaths accordingly.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Add VNIC's PCI devid on future chips
Sunil Goutham [Fri, 12 Aug 2016 11:21:25 +0000 (16:51 +0530)]
net: thunderx: Add VNIC's PCI devid on future chips

This patch adds PCI device IDs of VNIC on newer chips and also
registers VF driver with them. Device id remains same for all
versions of chips but subsystem device id changes.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: thunderx: Moved HW capability info from macros to structure
Sunil Goutham [Fri, 12 Aug 2016 11:21:24 +0000 (16:51 +0530)]
net: thunderx: Moved HW capability info from macros to structure

Current driver has most of the HW maximums info like no of channels,
traffic limiters, RSS indices e.t.c in the form of macros. These have
been moved into a 'hw_info' structure so that support for VNIC on
newer chips with different set of HW maximums can be added.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'xgene-next'
David S. Miller [Sat, 13 Aug 2016 18:48:54 +0000 (11:48 -0700)]
Merge branch 'xgene-next'

Iyappan Subramanian says:

====================
Fix warning and issues

This patch set fixes the following warning and issues,

  1. Fix compiler warnings
   - drivers: net: xgene: Fix compiler warnings
  2. unmap DMA memory on xgene_Enet_delete_bufpoool()
- drivers: net: xgene: fix: Add dma_unmap_single
  3. Delete descriptor rings and buffer pools on error
- drivers: net: xgene: fix: Delete descriptor rings and buffer pools
  4. Fix error desconstruction on probe()
  - drivers: net: xgene: Fix error deconstruction path
  5. Fix RSS indirection table fields
  - drivers: net: xgene: Fix RSS indirection table fields
  6. Change the port init sequence as per hardware specification
- drivers: net: xgene: Change port init sequence
  7. Fix link not recovered after link is down issue
- drivers: net: xgene: XFI PCS reset when link is down
  8. Fix link up is reported when no SFP+ module is plugged in issue
- drivers: net: xgene: Poll link status via GPIO
- dtb: xgene: Add rxlos-gpios property
- Documentation: dtb: xgene: Add rxlos GPIO mapping
  9. Fix backward compatibility when used with older driver
- drivers: net: xgene: Fix backward compatibility
- dtb: xgene: Fix backward compatibility

v2: Address review comments from v1
- Fixed compiler warnings
- Removed kbuild fix patch, since Arnd submitted the same
- Changed Kconfig to select GPIOLIB (to fix kbuild warning)
- Added rxlos-gpio documentation
- Fixed backward compatibility with older driver

v1:
- Initial version
====================

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodtb: xgene: Fix backward compatibility
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:48 +0000 (22:05 -0700)]
dtb: xgene: Fix backward compatibility

This patch fixes the backward compatibility when used with older kernel.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Fix backward compatibility
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:47 +0000 (22:05 -0700)]
drivers: net: xgene: Fix backward compatibility

This patch fixes the backward compatibility on handling phy_connect(), by
iterating over the phy-handle, when new DT is used with older kernel.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoDocumentation: dtb: xgene: Add rxlos GPIO mapping
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:46 +0000 (22:05 -0700)]
Documentation: dtb: xgene: Add rxlos GPIO mapping

Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodtb: xgene: Add rxlos-gpios property
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:45 +0000 (22:05 -0700)]
dtb: xgene: Add rxlos-gpios property

Added rxlos GPIO mapping by adding rxlos-gpios property.

Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Poll link status via GPIO
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:44 +0000 (22:05 -0700)]
drivers: net: xgene: Poll link status via GPIO

When 10GbE SFP+ module is not plugged in or cable is not connected,
the link status register does not report the proper state due
to floating signal. This patch checks the module present status via an
GPIO to determine whether to ignore the link status register and report
link down.

Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: XFI PCS reset when link is down
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:43 +0000 (22:05 -0700)]
drivers: net: xgene: XFI PCS reset when link is down

This patch fixes the link recovery issue, by doing PCS reset
when the link is down.

Signed-off-by: Fushen Chen <fchen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Change port init sequence
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:42 +0000 (22:05 -0700)]
drivers: net: xgene: Change port init sequence

This patch rearranges the port initialization sequence as recommended by
hardware specification.  This patch also removes, mac_init() call from
xgene_enet_link_state(), as it was not required.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Fix RSS indirection table fields
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:41 +0000 (22:05 -0700)]
drivers: net: xgene: Fix RSS indirection table fields

This patch fixes FPSel and NxtFPSel fields length to 5-bit value.

Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Fushen Chen <fchen@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Fix error deconstruction path
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:40 +0000 (22:05 -0700)]
drivers: net: xgene: Fix error deconstruction path

Since register_netdev() call in xgene_enet_probe() was moved down to
the end, it doesn't properly handle errors that may occur, by
deconstructing everything that was setup before the error occurred.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: fix: Delete descriptor rings and buffer pools
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:39 +0000 (22:05 -0700)]
drivers: net: xgene: fix: Delete descriptor rings and buffer pools

xgene_enet_init_hw() should delete any descriptor rings and
buffer pools setup should le_ops->cle_init() return an error.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: fix: Add dma_unmap_single
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:38 +0000 (22:05 -0700)]
drivers: net: xgene: fix: Add dma_unmap_single

In addition to xgene_enet_delete_bufpool() freeing skbs, their associated
dma memory should also be unmapped.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodrivers: net: xgene: Fix compiler warnings
Iyappan Subramanian [Sat, 13 Aug 2016 05:05:37 +0000 (22:05 -0700)]
drivers: net: xgene: Fix compiler warnings

Fixed compiler warnings reported with -Wmaybe-uninitialized W=1,

      /drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function â€˜xgene_enet_rx_frame’:
      ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c:455:27: warning: variable â€˜pdata’ set but not used [-Wunused-but-set-variable]
      struct xgene_enet_pdata *pdata;
      ^
      ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function â€˜xgene_enet_remove’:
      ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c:1691:30: warning: variable â€˜mac_ops’ set but not used [-Wunused-but-set-variable]
      const struct xgene_mac_ops *mac_ops;
                                   ^

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'bpf-improvements'
David S. Miller [Sat, 13 Aug 2016 04:57:13 +0000 (21:57 -0700)]
Merge branch 'bpf-improvements'

Alexei Starovoitov says:

====================
bpf improvements

Two bpf improvements:
1. allow bpf helpers like bpf_map_lookup_elem() access packet data directly
  for XDP programs
2. enable bpf_get_prandom_u32() for tracing programs
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobpf: allow bpf_get_prandom_u32() to be used in tracing
Alexei Starovoitov [Fri, 12 Aug 2016 01:17:18 +0000 (18:17 -0700)]
bpf: allow bpf_get_prandom_u32() to be used in tracing

bpf_get_prandom_u32() was initially introduced for socket filters
and later requested numberous times to be added to tracing bpf programs
for the same reason as in socket filters: to be able to randomly
select incoming events.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosamples/bpf: add verifier tests for the helper access to the packet
Aaron Yue [Fri, 12 Aug 2016 01:17:17 +0000 (18:17 -0700)]
samples/bpf: add verifier tests for the helper access to the packet

test various corner cases of the helper function access to the packet
via crafted XDP programs.

Signed-off-by: Aaron Yue <haoxuany@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobpf: allow helpers access the packet directly
Alexei Starovoitov [Fri, 12 Aug 2016 01:17:16 +0000 (18:17 -0700)]
bpf: allow helpers access the packet directly

The helper functions like bpf_map_lookup_elem(map, key) were only
allowing 'key' to point to the initialized stack area.
That is causing performance degradation when programs need to process
millions of packets per second and need to copy contents of the packet
into the stack just to pass the stack pointer into the lookup() function.
Allow such helpers read from the packet directly.
All helpers that expect ARG_PTR_TO_MAP_KEY, ARG_PTR_TO_MAP_VALUE,
ARG_PTR_TO_STACK assume byte aligned pointer, so no alignment concerns,
only need to check that helper will not be accessing beyond
the packet range verified by the prior 'if (ptr < data_end)' condition.
For now allow this feature for XDP programs only. Later it can be
relaxed for the clsact programs as well.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosit: make function ipip6_valid_ip_proto() static
Wei Yongjun [Sat, 13 Aug 2016 01:54:15 +0000 (01:54 +0000)]
sit: make function ipip6_valid_ip_proto() static

Fixes the following sparse warning:

net/ipv6/sit.c:1129:6: warning:
 symbol 'ipip6_valid_ip_proto' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'bpf-under-cgroup'
David S. Miller [Sat, 13 Aug 2016 04:49:42 +0000 (21:49 -0700)]
Merge branch 'bpf-under-cgroup'

Sargun Dhillon says:

====================
Add test_current_task_under_cgroup bpf helper and test

This patchset includes a helper and an example to determine whether the probe is
currently executing in the context of a specific cgroup based on a cgroup bpf
map / array. The helper checks the cgroupsv2 hierarchy based on the handle in
the map and if the current cgroup is equal to it, or a descendant of it. The
helper was tested with the example program, and it was verified that the correct
behaviour occurs in the interrupt context.

In an earlier version of this patchset I had added an "opensnoop"-like tool, and
I realized I was basically reimplementing a lot of the code that already exists
in the bcc repo. So, instead I decided to write a test that creates a new mount
namespace, mounts up the cgroupv2 hierarchy, and does some basic tests.  I used
the sync syscall as a canary for these tests because it's a simple, 0-arg
syscall. Once this patch is accepted, adding support to opensnoop will be easy.

I also added a task_under_cgroup_hierarchy function in cgroups.h, as this
pattern is used in a couple places. Converting those can be done in a later
patchset.

Thanks to Alexei, Tejun, and Daniel for providing review.

v1->v2: Clean up
v2->v3: Move around ifdefs out of *.c files, add an "integration" test
v3->v4: De-genercize arraymap fetching function;
rename helper from in_cgroup to under_cgroup (makes much more sense)
Split adding cgroups task_under_cgroup_hierarchy function
v4->v5: Fix formatting
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosamples/bpf: Add test_current_task_under_cgroup test
Sargun Dhillon [Fri, 12 Aug 2016 15:57:04 +0000 (08:57 -0700)]
samples/bpf: Add test_current_task_under_cgroup test

This test has a BPF program which writes the last known pid to call the
sync syscall within a given cgroup to a map.

The user mode program creates its own mount namespace, and mounts the
cgroupsv2  hierarchy in there, as on all current test systems
(Ubuntu 16.04, Debian), the cgroupsv2 vfs is unmounted by default.
Once it does this, it proceeds to test.

The test checks for positive and negative condition. It ensures that
when it's part of a given cgroup, its pid is captured in the map,
and that when it leaves the cgroup, this doesn't happen.

It populate a cgroups arraymap prior to execution in userspace. This means
that the program must be run in the same cgroups namespace as the programs
that are being traced.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agobpf: Add bpf_current_task_under_cgroup helper
Sargun Dhillon [Fri, 12 Aug 2016 15:56:52 +0000 (08:56 -0700)]
bpf: Add bpf_current_task_under_cgroup helper

This adds a bpf helper that's similar to the skb_in_cgroup helper to check
whether the probe is currently executing in the context of a specific
subset of the cgroupsv2 hierarchy. It does this based on membership test
for a cgroup arraymap. It is invalid to call this in an interrupt, and
it'll return an error. The helper is primarily to be used in debugging
activities for containers, where you may have multiple programs running in
a given top-level "container".

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocgroup: Add task_under_cgroup_hierarchy cgroup inline function to headers
Sargun Dhillon [Fri, 12 Aug 2016 15:56:40 +0000 (08:56 -0700)]
cgroup: Add task_under_cgroup_hierarchy cgroup inline function to headers

This commit adds an inline function to cgroup.h to check whether a given
task is under a given cgroup hierarchy. This is to avoid having to put
ifdefs in .c files to gate access to cgroups. When cgroups are disabled
this always returns true.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge tag 'batadv-next-for-davem-20160812' of git://git.open-mesh.org/linux-merge
David S. Miller [Sat, 13 Aug 2016 03:55:41 +0000 (20:55 -0700)]
Merge tag 'batadv-next-for-davem-20160812' of git://git.open-mesh.org/linux-merge

Simon Wunderlich says:

====================
This feature patchset includes the following changes (mostly
chronological order):

 - bump version strings, by Simon Wunderlich

 - kerneldoc clean up, by Sven Eckelmann

 - enable RTNL automatic loading and according documentation
   changes, by Sven Eckelmann (2 patches)

 - fix/improve interface removal and associated locking, by
   Sven Eckelmann (3 patches)

 - clean up unused variables, by Linus Luessing

 - implement Gateway selection code for B.A.T.M.A.N. V by
   Antonio Quartulli (4 patches)

 - rewrite TQ comparison by Markus Pargmann

 - fix Cocinelle warnings on bool vs integers (by Fenguang Wu/Intels
   kbuild test robot) and bitwise arithmetic operations (by Linus
   Luessing)

 - rewrite packet creation for forwarding for readability and to avoid
   reference count mistakes, by Linus Luessing

 - use kmem_cache for translation table, which results in more efficient
   storing of translation table entries, by Sven Eckelmann

 - rewrite/clarify reference handling for send_skb_unicast, by Sven
   Eckelmann

 - fix debug messages when updating routes, by Sven Eckelmann
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'sfc-SFN8000-support-improvements'
David S. Miller [Sat, 13 Aug 2016 03:42:20 +0000 (20:42 -0700)]
Merge branch 'sfc-SFN8000-support-improvements'

Bert Kenward says:

====================
sfc: SFN8000 support improvements

This series improves support for the recently released SFN8000 series
of adapters. Specifically, it retrieves interrupt moderation timer
settings directly from the adapter and uses those settings. It also
uses a new event queue initialisation interface, allowing specification
of a performance objective rather than enabling individual flags.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: get timer configuration from adapter
Bert Kenward [Thu, 11 Aug 2016 12:02:36 +0000 (13:02 +0100)]
sfc: get timer configuration from adapter

On SFN8000 series adapters the MC provides a method to get the timer
quantum and the maximum timer setting. We revert to the old values if the
new call is unavailable.

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: set interrupt moderation via MCDI
Bert Kenward [Thu, 11 Aug 2016 12:02:09 +0000 (13:02 +0100)]
sfc: set interrupt moderation via MCDI

SFN8000-series NICs require a new method of setting interrupt moderation,
via MCDI. This is indicated by a workaround flag. This new MCDI command
takes an explicit time value rather than a number of ticks. It therefore
makes sense to also store the moderation values in terms of time, since
that is what the ethtool interface is interested in.

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: use new performance based event queue init
Bert Kenward [Thu, 11 Aug 2016 12:01:54 +0000 (13:01 +0100)]
sfc: use new performance based event queue init

Rather than explicitly specifying flags we can now specify a desired
performance target to the firmware, ie higher throughput or lower latency.
For now we use the default "auto" configuration.

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: retrieve second word of datapath capabilities
Bert Kenward [Thu, 11 Aug 2016 12:01:35 +0000 (13:01 +0100)]
sfc: retrieve second word of datapath capabilities

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: allow asynchronous MCDI without completion function
Bert Kenward [Thu, 11 Aug 2016 12:01:21 +0000 (13:01 +0100)]
sfc: allow asynchronous MCDI without completion function

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosfc: update MCDI protocol headers
Bert Kenward [Thu, 11 Aug 2016 12:01:01 +0000 (13:01 +0100)]
sfc: update MCDI protocol headers

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: mediatek: enhance the locking using the lightweight ones
Sean Wang [Thu, 11 Aug 2016 09:51:00 +0000 (17:51 +0800)]
net: ethernet: mediatek: enhance the locking using the lightweight ones

Since these critical sections protected by page_lock are all entered
from the user context or bottom half context, they can be replaced
with the spin_lock() or spin_lock_bh instead of spin_lock_irqsave().

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ena: Add a driver for Amazon Elastic Network Adapters (ENA)
Netanel Belgazal [Wed, 10 Aug 2016 11:03:22 +0000 (14:03 +0300)]
net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)

This is a driver for the ENA family of networking devices.

Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'xilinx-gmiitorgmii-converter'
David S. Miller [Fri, 12 Aug 2016 23:57:20 +0000 (16:57 -0700)]
Merge branch 'xilinx-gmiitorgmii-converter'

Kedareswara rao Appana says:

====================
net: phy: Add xilinx gmiitorgmii converter support

The Gigabit Media Independent Interface (GMII) to Reduced Gigabit Media
Independent Interface (RGMII) core provides the RGMII between RGMII-compliant
Ethernet physical media devices (PHY) and the Gigabit Ethernet controller.
This core can be used in all three modes of operation(10/100/1000 Mb/s).
The Management Data Input/Output (MDIO) interface is used to configure the
Speed of operation. This core can switch dynamically between the three
Different speed modes by configuring the conveter register through mdio write.

The conveter sits b/w the MAC and external phy like below

MACB <==> GMII2RGMII <==> RGMII_PHY

        MDIO    <========> GMII2RGMII
MCAB <=======>
                <========> RGMII

Using MAC MDIO bus we can access both the converter and the external PHY.
We need to program the line speed of the converter during run time based
On the external phy negotiated speed.

This patch series does the below
---> Add mask for Control register 10Mbps speed.
---> Add support for xilinx gmiitorgmii converter.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: phy: Add gmiitorgmii converter support
Appana Durga Kedareswara Rao [Wed, 10 Aug 2016 05:50:08 +0000 (11:20 +0530)]
net: phy: Add gmiitorgmii converter support

This patch adds support for gmiitorgmii converter.

The GMII to RGMII IP core provides the Reduced Gigabit Media
Independent Interface (RGMII) between Ethernet physical media
Devices and the Gigabit Ethernet controller. This core can
Switch dynamically between the three different speed modes of
Operation by configuring the converter register through mdio write.

MDIO interface is used to set operating speed of Ethernet MAC.

This converter sits between the MAC and the external phy
MAC <==> GMII2RGMII <==> RGMII_PHY

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoDocumentation: DT: net: Add Xilinx gmiitorgmii converter device tree binding document...
Appana Durga Kedareswara Rao [Wed, 10 Aug 2016 05:50:07 +0000 (11:20 +0530)]
Documentation: DT: net: Add Xilinx gmiitorgmii converter device tree binding documentation

Device-tree binding documentation for xilinx gmiitorgmii converter.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: Add mask for Control register 10Mbps speed
Appana Durga Kedareswara Rao [Wed, 10 Aug 2016 05:50:06 +0000 (11:20 +0530)]
net: Add mask for Control register 10Mbps speed

This patch adds mask for the Control register
10Mbps speed.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonl80211: explicitly check enum nl80211_mesh_power_mode
Johannes Berg [Thu, 11 Aug 2016 12:59:53 +0000 (14:59 +0200)]
nl80211: explicitly check enum nl80211_mesh_power_mode

Different gcc versions appear to be treating enum with different
signedness, causing warnings with the out parameter one way or
the other.

Just use the correct type to avoid all that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: call get_expected_throughput only after adding station
Maxim Altshul [Thu, 11 Aug 2016 10:38:16 +0000 (13:38 +0300)]
mac80211: call get_expected_throughput only after adding station

Depending on which method the driver implements, userspace could
call this (indirectly, by getting station info) before the driver
knows about the station, possibly causing it to misbehave.

Therefore, add a check for sta->uploaded which indicates that the
driver knows about the station.

Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: identically validate beacon interval for AP/MESH/IBSS
Purushottam Kushwaha [Thu, 11 Aug 2016 09:44:02 +0000 (15:14 +0530)]
cfg80211: identically validate beacon interval for AP/MESH/IBSS

Beacon interval interface combinations validation was missing
for MESH/IBSS join, add those.

Johannes: also move the beacon interval check disallowing really
tiny and really big intervals into the common function, which
adds it for AP mode.

Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: always notify userspace when wireless netdev is removed
Denis Kenzior [Wed, 3 Aug 2016 21:58:35 +0000 (16:58 -0500)]
cfg80211: always notify userspace when wireless netdev is removed

This change alters the semantics of NL80211_CMD_DEL_INTERFACE events
by always sending this event whenever a net_device object associated
with a wdev is destroyed.  Prior to this change, this event was only
emitted as a result of NL80211_CMD_DEL_INTERFACE command sent from
userspace.  This allows userspace to reliably detect when wireless
interfaces have been removed, e.g. due to USB removal events, etc.

For wireless device objects without an associated net_device (e.g.
NL80211_IFTYPE_P2P_DEVICE), the NL80211_CMD_DEL_INTERFACE event is
now generated inside cfg80211_unregister_wdev.

Signed-off-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: always notify userspace of new wireless netdevs
Denis Kenzior [Wed, 3 Aug 2016 21:58:33 +0000 (16:58 -0500)]
cfg80211: always notify userspace of new wireless netdevs

This change alters the semantics of NL80211_CMD_NEW_INTERFACE events
by always sending this event whenever a new net_device object
associated with a wdev is registered.  Prior to this change, this event
was only sent as a result of NL80211_CMD_NEW_INTERFACE command sent
from userspace.  This allows userspace to reliably detect new wireless
interfaces (e.g. due to hardware hot-plug events, etc).

For wdevs created without an associated net_device object (e.g.
NL80211_IFTYPE_P2P_DEVICE), the NL80211_CMD_NEW_INTERFACE event is
still generated inside the relevant nl80211 command handler.

Signed-off-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove skb header offset mangling in ieee80211_build_hdr
Felix Fietkau [Wed, 13 Jul 2016 09:00:02 +0000 (11:00 +0200)]
mac80211: remove skb header offset mangling in ieee80211_build_hdr

Since the code only touches the MAC headers, the offsets to the
network/transport headers remain the same throughout this function.
Remove pointless pieces of code that try to 'preserve' them.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: mesh: Add support for HW RC implementation
Maxim Altshul [Mon, 11 Jul 2016 14:15:24 +0000 (17:15 +0300)]
mac80211: mesh: Add support for HW RC implementation

Mesh HWMP module will be able to rely on the HW
RC algorithm if it exists, for path metric calculations.

This allows the metric calculation mechanism to calculate
a correct metric, based on PER and last TX rate both via
HW RC algorithm if it exists or via parameters collected
by the SW.

Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonet: ethernet: renesas: sh_eth: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Tue, 9 Aug 2016 22:04:49 +0000 (00:04 +0200)]
net: ethernet: renesas: sh_eth: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: renesas: sh_eth: use phydev from struct net_device
Philippe Reynes [Tue, 9 Aug 2016 22:04:48 +0000 (00:04 +0200)]
net: ethernet: renesas: sh_eth: use phydev from struct net_device

The private structure contain a pointer to phydev, but the structure
net_device already contain such pointer. So we can remove the pointer
phy_dev in the private structure, and update the driver to use the
one contained in struct net_device.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosamples/bpf: fix bpf_perf_event_output prototype
Adam Barth [Wed, 10 Aug 2016 16:45:39 +0000 (09:45 -0700)]
samples/bpf: fix bpf_perf_event_output prototype

The commit 555c8a8623a3 ("bpf: avoid stack copy and use skb ctx for event output")
started using 20 of initially reserved upper 32-bits of 'flags' argument
in bpf_perf_event_output(). Adjust corresponding prototype in samples/bpf/bpf_helpers.h

Signed-off-by: Adam Barth <arb@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>