Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 22:27:06 +0000 (14:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 22:27:06 +0000 (14:27 -0800)
Pull networking updates from David Miller:

 1) New offloading infrastructure and example 'rocker' driver for
    offloading of switching and routing to hardware.

    This work was done by a large group of dedicated individuals, not
    limited to: Scott Feldman, Jiri Pirko, Thomas Graf, John Fastabend,
    Jamal Hadi Salim, Andy Gospodarek, Florian Fainelli, Roopa Prabhu

 2) Start making the networking operate on IOV iterators instead of
    modifying iov objects in-situ during transfers.  Thanks to Al Viro
    and Herbert Xu.

 3) A set of new netlink interfaces for the TIPC stack, from Richard
    Alpe.

 4) Remove unnecessary looping during ipv6 routing lookups, from Martin
    KaFai Lau.

 5) Add PAUSE frame generation support to gianfar driver, from Matei
    Pavaluca.

 6) Allow for larger reordering levels in TCP, which are easily
    achievable in the real world right now, from Eric Dumazet.

 7) Add a variable of napi_schedule that doesn't need to disable cpu
    interrupts, from Eric Dumazet.

 8) Use a doubly linked list to optimize neigh_parms_release(), from
    Nicolas Dichtel.

 9) Various enhancements to the kernel BPF verifier, and allow eBPF
    programs to actually be attached to sockets.  From Alexei
    Starovoitov.

10) Support TSO/LSO in sunvnet driver, from David L Stevens.

11) Allow controlling ECN usage via routing metrics, from Florian
    Westphal.

12) Remote checksum offload, from Tom Herbert.

13) Add split-header receive, BQL, and xmit_more support to amd-xgbe
    driver, from Thomas Lendacky.

14) Add MPLS support to openvswitch, from Simon Horman.

15) Support wildcard tunnel endpoints in ipv6 tunnels, from Steffen
    Klassert.

16) Do gro flushes on a per-device basis using a timer, from Eric
    Dumazet.  This tries to resolve the conflicting goals between the
    desired handling of bulk vs.  RPC-like traffic.

17) Allow userspace to ask for the CPU upon what a packet was
    received/steered, via SO_INCOMING_CPU.  From Eric Dumazet.

18) Limit GSO packets to half the current congestion window, from Eric
    Dumazet.

19) Add a generic helper so that all drivers set their RSS keys in a
    consistent way, from Eric Dumazet.

20) Add xmit_more support to enic driver, from Govindarajulu
    Varadarajan.

21) Add VLAN packet scheduler action, from Jiri Pirko.

22) Support configurable RSS hash functions via ethtool, from Eyal
    Perry.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1820 commits)
  Fix race condition between vxlan_sock_add and vxlan_sock_release
  net/macb: fix compilation warning for print_hex_dump() called with skb->mac_header
  net/mlx4: Add support for A0 steering
  net/mlx4: Refactor QUERY_PORT
  net/mlx4_core: Add explicit error message when rule doesn't meet configuration
  net/mlx4: Add A0 hybrid steering
  net/mlx4: Add mlx4_bitmap zone allocator
  net/mlx4: Add a check if there are too many reserved QPs
  net/mlx4: Change QP allocation scheme
  net/mlx4_core: Use tasklet for user-space CQ completion events
  net/mlx4_core: Mask out host side virtualization features for guests
  net/mlx4_en: Set csum level for encapsulated packets
  be2net: Export tunnel offloads only when a VxLAN tunnel is created
  gianfar: Fix dma check map error when DMA_API_DEBUG is enabled
  cxgb4/csiostor: Don't use MASTER_MUST for fw_hello call
  net: fec: only enable mdio interrupt before phy device link up
  net: fec: clear all interrupt events to support i.MX6SX
  net: fec: reset fep link status in suspend function
  net: sock: fix access via invalid file descriptor
  net: introduce helper macro for_each_cmsghdr
  ...

19 files changed:
1  2 
MAINTAINERS
arch/nios2/include/asm/Kbuild
drivers/net/ethernet/cadence/Kconfig
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/macvtap.c
drivers/net/tun.c
drivers/scsi/csiostor/csio_scsi.c
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
drivers/scsi/fcoe/fcoe.c
drivers/vhost/net.c
include/net/sock.h
include/uapi/linux/Kbuild
lib/Makefile
net/bluetooth/rfcomm/core.c
net/core/dev.c
net/core/rtnetlink.c
net/netfilter/nf_log.c
net/packet/af_packet.c

diff --combined MAINTAINERS
@@@ -850,7 -850,6 +850,7 @@@ ARM/Amlogic MesonX SoC suppor
  M:    Carlo Caione <carlo@caione.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 +F:    drivers/media/rc/meson-ir.c
  N:    meson[x68]
  
  ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES
@@@ -862,7 -861,6 +862,7 @@@ W: http://maxim.org.za/at91_26.htm
  W:    http://www.linux4sam.org
  S:    Supported
  F:    arch/arm/mach-at91/
 +F:    include/soc/at91/
  F:    arch/arm/boot/dts/at91*.dts
  F:    arch/arm/boot/dts/at91*.dtsi
  F:    arch/arm/boot/dts/sama*.dts
@@@ -1310,22 -1308,30 +1310,22 @@@ F:   drivers/*/*rockchip
  F:    drivers/*/*/*rockchip*
  F:    sound/soc/rockchip/
  
 -ARM/SAMSUNG ARM ARCHITECTURES
 -M:    Ben Dooks <ben-linux@fluff.org>
 -M:    Kukjin Kim <kgene.kim@samsung.com>
 +ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
 +M:    Kukjin Kim <kgene@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 -W:    http://www.fluff.org/ben/linux/
  S:    Maintained
  F:    arch/arm/boot/dts/s3c*
  F:    arch/arm/boot/dts/exynos*
  F:    arch/arm/plat-samsung/
  F:    arch/arm/mach-s3c24*/
  F:    arch/arm/mach-s3c64xx/
 +F:    arch/arm/mach-s5p*/
 +F:    arch/arm/mach-exynos*/
  F:    drivers/*/*s3c2410*
  F:    drivers/*/*/*s3c2410*
  F:    drivers/spi/spi-s3c*
  F:    sound/soc/samsung/*
 -
 -ARM/S5P EXYNOS ARM ARCHITECTURES
 -M:    Kukjin Kim <kgene.kim@samsung.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 -S:    Maintained
 -F:    arch/arm/mach-s5p*/
 -F:    arch/arm/mach-exynos*/
  N:    exynos
  
  ARM/SAMSUNG MOBILE MACHINE SUPPORT
@@@ -1375,12 -1381,12 +1375,12 @@@ F:   arch/arm/boot/dts/sh
  F:    arch/arm/configs/ape6evm_defconfig
  F:    arch/arm/configs/armadillo800eva_defconfig
  F:    arch/arm/configs/bockw_defconfig
 -F:    arch/arm/configs/koelsch_defconfig
  F:    arch/arm/configs/kzm9g_defconfig
  F:    arch/arm/configs/lager_defconfig
  F:    arch/arm/configs/mackerel_defconfig
  F:    arch/arm/configs/marzen_defconfig
  F:    arch/arm/configs/shmobile_defconfig
 +F:    arch/arm/include/debug/renesas-scif.S
  F:    arch/arm/mach-shmobile/
  F:    drivers/sh/
  
@@@ -1424,7 -1430,6 +1424,7 @@@ F:      drivers/tty/serial/st-asc.
  F:    drivers/usb/dwc3/dwc3-st.c
  F:    drivers/usb/host/ehci-st.c
  F:    drivers/usb/host/ohci-st.c
 +F:    drivers/ata/ahci_st.c
  
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
@@@ -1498,19 -1503,6 +1498,19 @@@ S:    Maintaine
  F:    drivers/clk/ux500/
  F:    include/linux/platform_data/clk-ux500.h
  
 +ARM/VERSATILE EXPRESS PLATFORM
 +M:    Liviu Dudau <liviu.dudau@arm.com>
 +M:    Sudeep Holla <sudeep.holla@arm.com>
 +M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/boot/dts/vexpress*
 +F:    arch/arm/mach-vexpress/
 +F:    */*/vexpress*
 +F:    */*/*/vexpress*
 +F:    drivers/clk/versatile/clk-vexpress-osc.c
 +F:    drivers/clocksource/versatile.c
 +
  ARM/VFP SUPPORT
  M:    Russell King <linux@arm.linux.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1836,7 -1828,7 +1836,7 @@@ F:      include/net/ax25.
  F:    net/ax25/
  
  AZ6007 DVB DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -1870,6 -1862,7 +1870,6 @@@ F:      drivers/net/wireless/b43legacy
  
  BACKLIGHT CLASS/SUBSYSTEM
  M:    Jingoo Han <jg1.han@samsung.com>
 -M:    Bryan Wu <cooloney@gmail.com>
  M:    Lee Jones <lee.jones@linaro.org>
  S:    Maintained
  F:    drivers/video/backlight/
@@@ -2104,13 -2097,10 +2104,13 @@@ F:   arch/arm/include/debug/bcm63xx.
  BROADCOM BCM7XXX ARM ARCHITECTURE
  M:    Marc Carino <marc.ceeeee@gmail.com>
  M:    Brian Norris <computersforpeace@gmail.com>
 +M:    Gregory Fong <gregory.0xf0@gmail.com>
 +M:    Florian Fainelli <f.fainelli@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-bcm/*brcmstb*
  F:    arch/arm/boot/dts/bcm7*.dts*
 +F:    drivers/bus/brcmstb_gisb.c
  
  BROADCOM TG3 GIGABIT ETHERNET DRIVER
  M:    Prashant Sreedharan <prashant@broadcom.com>
@@@ -2141,20 -2131,6 +2141,20 @@@ L:    linux-scsi@vger.kernel.or
  S:    Supported
  F:    drivers/scsi/bnx2i/
  
 +BROADCOM CYGNUS/IPROC ARM ARCHITECTURE
 +M:    Ray Jui <rjui@broadcom.com>
 +M:    Scott Branden <sbranden@broadcom.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    bcm-kernel-feedback-list@broadcom.com
 +T:    git git://git.github.com/brcm/linux.git
 +S:    Maintained
 +N:    iproc
 +N:    cygnus
 +N:    bcm9113*
 +N:    bcm9583*
 +N:    bcm583*
 +N:    bcm113*
 +
  BROADCOM KONA GPIO DRIVER
  M:    Ray Jui <rjui@broadcom.com>
  L:    bcm-kernel-feedback-list@broadcom.com
@@@ -2222,7 -2198,7 +2222,7 @@@ F:      Documentation/filesystems/btrfs.tx
  F:    fs/btrfs/
  
  BTTV VIDEO4LINUX DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -2332,6 -2308,14 +2332,14 @@@ F:    security/capability.
  F:    security/commoncap.c
  F:    kernel/capability.c
  
+ CC2520 IEEE-802.15.4 RADIO DRIVER
+ M:    Varka Bhadram <varkabhadram@gmail.com>
+ L:    linux-wpan@vger.kernel.org
+ S:    Maintained
+ F:    drivers/net/ieee802154/cc2520.c
+ F:    include/linux/spi/cc2520.h
+ F:    Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
  CELL BROADBAND ENGINE ARCHITECTURE
  M:    Arnd Bergmann <arnd@arndb.de>
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -2513,13 -2497,6 +2521,13 @@@ F:    fs/coda
  F:    include/linux/coda*.h
  F:    include/uapi/linux/coda*.h
  
 +CODA V4L2 MEM2MEM DRIVER
 +M:    Philipp Zabel <p.zabel@pengutronix.de>
 +L:    linux-media@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/media/coda.txt
 +F:    drivers/media/platform/coda/
 +
  COMMON CLK FRAMEWORK
  M:    Mike Turquette <mturquette@linaro.org>
  L:    linux-kernel@vger.kernel.org
@@@ -2535,7 -2512,8 +2543,7 @@@ M:      Steve French <sfrench@samba.org
  L:    linux-cifs@vger.kernel.org
  L:    samba-technical@lists.samba.org (moderated for non-subscribers)
  W:    http://linux-cifs.samba.org/
 -Q:    http://patchwork.ozlabs.org/project/linux-cifs-client/list/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git
 +T:    git git://git.samba.org/sfrench/cifs-2.6.git
  S:    Supported
  F:    Documentation/filesystems/cifs/
  F:    fs/cifs/
@@@ -2612,7 -2590,7 +2620,7 @@@ L:      cgroups@vger.kernel.or
  L:    linux-mm@kvack.org
  S:    Maintained
  F:    mm/memcontrol.c
 -F:    mm/page_cgroup.c
 +F:    mm/swap_cgroup.c
  
  CORETEMP HARDWARE MONITORING DRIVER
  M:    Fenghua Yu <fenghua.yu@intel.com>
@@@ -2662,16 -2640,6 +2670,16 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Maintained
  F:    drivers/cpuidle/cpuidle-big_little.c
  
 +CPUIDLE DRIVER - ARM EXYNOS
 +M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
 +M:    Daniel Lezcano <daniel.lezcano@linaro.org>
 +M:    Kukjin Kim <kgene@kernel.org>
 +L:    linux-pm@vger.kernel.org
 +L:    linux-samsung-soc@vger.kernel.org
 +S:    Supported
 +F:    drivers/cpuidle/cpuidle-exynos.c
 +F:    arch/arm/mach-exynos/pm.c
 +
  CPUIDLE DRIVERS
  M:    Rafael J. Wysocki <rjw@rjwysocki.net>
  M:    Daniel Lezcano <daniel.lezcano@linaro.org>
@@@ -2739,7 -2707,7 +2747,7 @@@ F:      drivers/net/wireless/cw1200
  
  CX18 VIDEO4LINUX DRIVER
  M:    Andy Walls <awalls@md.metrocast.net>
 -L:    ivtv-devel@ivtvdriver.org (moderated for non-subscribers)
 +L:    ivtv-devel@ivtvdriver.org (subscribers-only)
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  W:    http://linuxtv.org
@@@ -2759,7 -2727,7 +2767,7 @@@ F:      drivers/media/common/cx2341x
  F:    include/media/cx2341x*
  
  CX88 VIDEO4LINUX DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -2902,10 -2870,11 +2910,10 @@@ F:   Documentation/networking/dmfe.tx
  F:    drivers/net/ethernet/dec/tulip/dmfe.c
  
  DC390/AM53C974 SCSI driver
 -M:    Kurt Garloff <garloff@suse.de>
 -W:    http://www.garloff.de/kurt/linux/dc390/
 -M:    Guennadi Liakhovetski <g.liakhovetski@gmx.de>
 +M:    Hannes Reinecke <hare@suse.de>
 +L:    linux-scsi@vger.kernel.org
  S:    Maintained
 -F:    drivers/scsi/tmscsim.*
 +F:    drivers/scsi/am53c974.c
  
  DC395x SCSI driver
  M:    Oliver Neukum <oliver@neukum.org>
@@@ -3441,7 -3410,7 +3449,7 @@@ F:      fs/ecryptfs
  EDAC-CORE
  M:    Doug Thompson <dougthompson@xmission.com>
  M:    Borislav Petkov <bp@alien8.de>
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Supported
@@@ -3490,7 -3459,7 +3498,7 @@@ S:      Maintaine
  F:    drivers/edac/e7xxx_edac.c
  
  EDAC-GHES
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Maintained
@@@ -3518,21 -3487,21 +3526,21 @@@ S:   Maintaine
  F:    drivers/edac/i5000_edac.c
  
  EDAC-I5400
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Maintained
  F:    drivers/edac/i5400_edac.c
  
  EDAC-I7300
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Maintained
  F:    drivers/edac/i7300_edac.c
  
  EDAC-I7CORE
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Maintained
@@@ -3575,7 -3544,7 +3583,7 @@@ S:      Maintaine
  F:    drivers/edac/r82600_edac.c
  
  EDAC-SBRIDGE
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
  S:    Maintained
@@@ -3635,7 -3604,7 +3643,7 @@@ S:      Maintaine
  F:    drivers/net/ethernet/ibm/ehea/
  
  EM28XX VIDEO4LINUX DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -4752,14 -4721,15 +4760,21 @@@ S:   Maintaine
  F:    net/ieee802154/
  F:    net/mac802154/
  F:    drivers/net/ieee802154/
+ F:    include/linux/nl802154.h
+ F:    include/linux/ieee802154.h
+ F:    include/net/nl802154.h
+ F:    include/net/mac802154.h
+ F:    include/net/af_ieee802154.h
+ F:    include/net/cfg802154.h
+ F:    include/net/ieee802154_netdev.h
  F:    Documentation/networking/ieee802154.txt
  
 +IGORPLUG-USB IR RECEIVER
 +M:    Sean Young <sean@mess.org>
 +L:    linux-media@vger.kernel.org
 +S:    Maintained
 +F:    drivers/media/rc/igorplugusb.c
 +
  IGUANAWORKS USB IR TRANSCEIVER
  M:    Sean Young <sean@mess.org>
  L:    linux-media@vger.kernel.org
@@@ -4817,11 -4787,6 +4832,11 @@@ L:    linux-security-module@vger.kernel.or
  S:    Supported
  F:    security/integrity/ima/
  
 +IMGTEC IR DECODER DRIVER
 +M:    James Hogan <james.hogan@imgtec.com>
 +S:    Maintained
 +F:    drivers/media/rc/img-ir/
 +
  IMS TWINTURBO FRAMEBUFFER DRIVER
  L:    linux-fbdev@vger.kernel.org
  S:    Orphan
@@@ -5236,7 -5201,7 +5251,7 @@@ F:      drivers/media/tuners/it913x
  
  IVTV VIDEO4LINUX DRIVER
  M:    Andy Walls <awalls@md.metrocast.net>
 -L:    ivtv-devel@ivtvdriver.org (moderated for non-subscribers)
 +L:    ivtv-devel@ivtvdriver.org (subscribers-only)
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  W:    http://www.ivtvdriver.org
@@@ -5931,6 -5896,11 +5946,11 @@@ M:    Russell King <rmk+kernel@arm.linux.o
  S:    Maintained
  F:    drivers/gpu/drm/armada/
  
+ MARVELL 88E6352 DSA support
+ M:    Guenter Roeck <linux@roeck-us.net>
+ S:    Maintained
+ F:    drivers/net/dsa/mv88e6352.c
  MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
  M:    Mirko Lindner <mlindner@marvell.com>
  M:    Stephen Hemminger <stephen@networkplumber.org>
@@@ -6012,7 -5982,7 +6032,7 @@@ S:      Maintaine
  F:    drivers/media/radio/radio-maxiradio*
  
  MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  P:    LinuxTV.org Project
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
@@@ -6041,13 -6011,10 +6061,13 @@@ W:   http://linuxtv.or
  S:    Odd Fixes
  F:    drivers/media/parport/pms*
  
 -MEGARAID SCSI DRIVERS
 -M:    Neela Syam Kolli <megaraidlinux@lsi.com>
 +MEGARAID SCSI/SAS DRIVERS
 +M:    Kashyap Desai <kashyap.desai@avagotech.com>
 +M:    Sumit Saxena <sumit.saxena@avagotech.com>
 +M:    Uday Lingala <uday.lingala@avagotech.com>
 +L:    megaraidlinux.pdl@avagotech.com
  L:    linux-scsi@vger.kernel.org
 -W:    http://megaraid.lsilogic.com
 +W:    http://www.lsi.com
  S:    Maintained
  F:    Documentation/scsi/megaraid.txt
  F:    drivers/scsi/megaraid.*
@@@ -6170,28 -6137,6 +6190,28 @@@ S:    Supporte
  F:    include/linux/mlx5/
  F:    drivers/infiniband/hw/mlx5/
  
 +MN88472 MEDIA DRIVER
 +M:    Antti Palosaari <crope@iki.fi>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +W:    http://palosaari.fi/linux/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/anttip/media_tree.git
 +S:    Maintained
 +F:    drivers/staging/media/mn88472/
 +F:    drivers/media/dvb-frontends/mn88472.h
 +
 +MN88473 MEDIA DRIVER
 +M:    Antti Palosaari <crope@iki.fi>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +W:    http://palosaari.fi/linux/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/anttip/media_tree.git
 +S:    Maintained
 +F:    drivers/staging/media/mn88473/
 +F:    drivers/media/dvb-frontends/mn88473.h
 +
  MODULE SUPPORT
  M:    Rusty Russell <rusty@rustcorp.com.au>
  S:    Maintained
@@@ -6380,6 -6325,7 +6400,6 @@@ F:      drivers/scsi/g_NCR5380.
  F:    drivers/scsi/g_NCR5380_mmio.c
  F:    drivers/scsi/mac_scsi.*
  F:    drivers/scsi/pas16.*
 -F:    drivers/scsi/sun3_NCR5380.c
  F:    drivers/scsi/sun3_scsi.*
  F:    drivers/scsi/sun3_scsi_vme.c
  F:    drivers/scsi/t128.*
@@@ -6635,13 -6581,6 +6655,13 @@@ S:    Maintaine
  F:    Documentation/scsi/NinjaSCSI.txt
  F:    drivers/scsi/nsp32*
  
 +NIOS2 ARCHITECTURE
 +M:    Ley Foon Tan <lftan@altera.com>
 +L:    nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
 +T:    git git://git.rocketboards.org/linux-socfpga.git
 +S:    Maintained
 +F:    arch/nios2/
 +
  NTB DRIVER
  M:    Jon Mason <jdmason@kudzu.us>
  M:    Dave Jiang <dave.jiang@intel.com>
@@@ -6682,12 -6621,6 +6702,12 @@@ S:    Supporte
  F:    drivers/gpu/drm/i2c/tda998x_drv.c
  F:    include/drm/i2c/tda998x.h
  
 +NXP TFA9879 DRIVER
 +M:    Peter Rosin <peda@axentia.se>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    sound/soc/codecs/tfa9879*
 +
  OMAP SUPPORT
  M:    Tony Lindgren <tony@atomide.com>
  L:    linux-omap@vger.kernel.org
@@@ -6757,14 -6690,6 +6777,14 @@@ L:    linux-omap@vger.kernel.or
  S:    Maintained
  F:    sound/soc/omap/
  
 +OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
 +M:    Roger Quadros <rogerq@ti.com>
 +M:    Tony Lindgren <tony@atomide.com>
 +L:    linux-omap@vger.kernel.org
 +S:    Maintained
 +F:    drivers/memory/omap-gpmc.c
 +F:    arch/arm/mach-omap2/*gpmc*
 +
  OMAP FRAMEBUFFER SUPPORT
  M:    Tomi Valkeinen <tomi.valkeinen@ti.com>
  L:    linux-fbdev@vger.kernel.org
@@@ -7142,16 -7067,6 +7162,16 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/pci/xgene-pci.txt
  F:    drivers/pci/host/pci-xgene.c
  
 +PCI DRIVER FOR FREESCALE LAYERSCAPE
 +M:    Minghuan Lian <minghuan.Lian@freescale.com>
 +M:    Mingkai Hu <mingkai.hu@freescale.com>
 +M:    Roy Zang <tie-fei.zang@freescale.com>
 +L:    linuxppc-dev@lists.ozlabs.org
 +L:    linux-pci@vger.kernel.org
 +L:    linux-arm-kernel@lists.infradead.org
 +S:    Maintained
 +F:    drivers/pci/host/*layerscape*
 +
  PCI DRIVER FOR IMX6
  M:    Richard Zhu <r65037@freescale.com>
  M:    Lucas Stach <l.stach@pengutronix.de>
@@@ -7331,13 -7246,7 +7351,13 @@@ PIN CONTROLLER - ATMEL AT9
  M:    Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 -F:    drivers/pinctrl/pinctrl-at91.c
 +F:    drivers/pinctrl/pinctrl-at91.*
 +
 +PIN CONTROLLER - INTEL
 +M:    Mika Westerberg <mika.westerberg@linux.intel.com>
 +M:    Heikki Krogerus <heikki.krogerus@linux.intel.com>
 +S:    Maintained
 +F:    drivers/pinctrl/intel/
  
  PIN CONTROLLER - RENESAS
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@@ -7956,6 -7865,13 +7976,13 @@@ F:    drivers/hid/hid-roccat
  F:    include/linux/hid-roccat*
  F:    Documentation/ABI/*/sysfs-driver-hid-roccat*
  
+ ROCKER DRIVER
+ M:    Jiri Pirko <jiri@resnulli.us>
+ M:    Scott Feldman <sfeldma@gmail.com>
+ L:    netdev@vger.kernel.org
+ S:    Supported
+ F:    drivers/net/ethernet/rocker/
  ROCKETPORT DRIVER
  P:    Comtrol Corp.
  W:    http://www.comtrol.com
@@@ -8003,11 -7919,10 +8030,10 @@@ S:   Maintaine
  F:    drivers/media/dvb-frontends/rtl2832_sdr*
  
  RTL8180 WIRELESS DRIVER
- M:    "John W. Linville" <linville@tuxdriver.com>
  L:    linux-wireless@vger.kernel.org
  W:    http://wireless.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
- S:    Maintained
+ S:    Orphan
  F:    drivers/net/wireless/rtl818x/rtl8180/
  
  RTL8187 WIRELESS DRIVER
@@@ -8124,7 -8039,7 +8150,7 @@@ S:      Odd Fixe
  F:    drivers/media/i2c/saa6588*
  
  SAA7134 VIDEO4LINUX DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -8582,7 -8497,7 +8608,7 @@@ S:      Maintaine
  F:    drivers/media/radio/si4713/radio-usb-si4713.c
  
  SIANO DVB DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -8592,14 -8507,6 +8618,14 @@@ F:    drivers/media/usb/siano
  F:    drivers/media/usb/siano/
  F:    drivers/media/mmc/siano/
  
 +SIMPLEFB FB DRIVER
 +M:    Hans de Goede <hdegoede@redhat.com>
 +L:    linux-fbdev@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/video/simple-framebuffer.txt
 +F:    drivers/video/fbdev/simplefb.c
 +F:    include/linux/platform_data/simplefb.h
 +
  SH_VEU V4L2 MEM2MEM DRIVER
  L:    linux-media@vger.kernel.org
  S:    Orphan
@@@ -8801,9 -8708,7 +8827,9 @@@ S:      Maintaine
  F:    drivers/leds/leds-net48xx.c
  
  SOFTLOGIC 6x10 MPEG CODEC
 -M:    Ismael Luceno <ismael.luceno@corp.bluecherry.net>
 +M:    Bluecherry Maintainers <maintainers@bluecherrydvr.com>
 +M:    Andrey Utkin <andrey.utkin@corp.bluecherry.net>
 +M:    Andrey Utkin <andrey.krieger.utkin@gmail.com>
  L:    linux-media@vger.kernel.org
  S:    Supported
  F:    drivers/media/pci/solo6x10/
@@@ -9160,6 -9065,13 +9186,13 @@@ F:    lib/swiotlb.
  F:    arch/*/kernel/pci-swiotlb.c
  F:    include/linux/swiotlb.h
  
+ SWITCHDEV
+ M:    Jiri Pirko <jiri@resnulli.us>
+ L:    netdev@vger.kernel.org
+ S:    Supported
+ F:    net/switchdev/
+ F:    include/net/switchdev.h
  SYNOPSYS ARC ARCHITECTURE
  M:    Vineet Gupta <vgupta@synopsys.com>
  S:    Supported
@@@ -9277,7 -9189,7 +9310,7 @@@ S:      Maintaine
  F:    drivers/media/i2c/tda9840*
  
  TEA5761 TUNER DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -9285,7 -9197,7 +9318,7 @@@ S:      Odd fixe
  F:    drivers/media/tuners/tea5761.*
  
  TEA5767 TUNER DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -9597,7 -9509,7 +9630,7 @@@ F:      include/linux/shmem_fs.
  F:    mm/shmem.c
  
  TM6000 VIDEO4LINUX DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
@@@ -10418,7 -10330,7 +10451,7 @@@ S:   Maintaine
  F:    arch/x86/kernel/cpu/mcheck/*
  
  XC2028/3028 TUNER DRIVER
 -M:    Mauro Carvalho Chehab <m.chehab@samsung.com>
 +M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
index bb160be,0000000..01c75f3
mode 100644,000000..100644
--- /dev/null
@@@ -1,66 -1,0 +1,65 @@@
- generic-y += hash.h
 +generic-y += atomic.h
 +generic-y += auxvec.h
 +generic-y += barrier.h
 +generic-y += bitops.h
 +generic-y += bitsperlong.h
 +generic-y += bug.h
 +generic-y += bugs.h
 +generic-y += clkdev.h
 +generic-y += cputime.h
 +generic-y += current.h
 +generic-y += device.h
 +generic-y += div64.h
 +generic-y += dma.h
 +generic-y += emergency-restart.h
 +generic-y += errno.h
 +generic-y += exec.h
 +generic-y += fb.h
 +generic-y += fcntl.h
 +generic-y += ftrace.h
 +generic-y += futex.h
 +generic-y += hardirq.h
 +generic-y += hw_irq.h
 +generic-y += ioctl.h
 +generic-y += ioctls.h
 +generic-y += ipcbuf.h
 +generic-y += irq_regs.h
 +generic-y += irq_work.h
 +generic-y += kdebug.h
 +generic-y += kmap_types.h
 +generic-y += kvm_para.h
 +generic-y += local.h
 +generic-y += mcs_spinlock.h
 +generic-y += mman.h
 +generic-y += module.h
 +generic-y += msgbuf.h
 +generic-y += param.h
 +generic-y += pci.h
 +generic-y += percpu.h
 +generic-y += poll.h
 +generic-y += posix_types.h
 +generic-y += preempt.h
 +generic-y += resource.h
 +generic-y += scatterlist.h
 +generic-y += sections.h
 +generic-y += segment.h
 +generic-y += sembuf.h
 +generic-y += serial.h
 +generic-y += shmbuf.h
 +generic-y += shmparam.h
 +generic-y += siginfo.h
 +generic-y += signal.h
 +generic-y += socket.h
 +generic-y += sockios.h
 +generic-y += spinlock.h
 +generic-y += stat.h
 +generic-y += statfs.h
 +generic-y += termbits.h
 +generic-y += termios.h
 +generic-y += topology.h
 +generic-y += trace_clock.h
 +generic-y += types.h
 +generic-y += unaligned.h
 +generic-y += user.h
 +generic-y += vga.h
 +generic-y += xor.h
@@@ -22,7 -22,7 +22,7 @@@ if NET_CADENC
  
  config ARM_AT91_ETHER
        tristate "AT91RM9200 Ethernet support"
 -      depends on HAS_DMA && (ARCH_AT91RM9200 || COMPILE_TEST)
 +      depends on HAS_DMA && (ARCH_AT91 || COMPILE_TEST)
        select MACB
        ---help---
          If you wish to compile a kernel for the AT91RM9200 and enable
@@@ -35,8 -35,8 +35,8 @@@ config MAC
        ---help---
          The Cadence MACB ethernet interface is found on many Atmel AT32 and
          AT91 parts.  This driver also supports the Cadence GEM (Gigabit
-         Ethernet MAC found in some ARM SoC devices).  Note: the Gigabit mode
-         is not yet supported.  Say Y to include support for the MACB/GEM chip.
+         Ethernet MAC found in some ARM SoC devices).  Say Y to include
+         support for the MACB/GEM chip.
  
          To compile this driver as a module, choose M here: the module
          will be called macb.
@@@ -1016,7 -1016,7 +1016,7 @@@ static bool e1000_clean_rx_irq(struct e
                 */
                if (length < copybreak) {
                        struct sk_buff *new_skb =
-                           netdev_alloc_skb_ip_align(netdev, length);
+                               napi_alloc_skb(&adapter->napi, length);
                        if (new_skb) {
                                skb_copy_to_linear_data_offset(new_skb,
                                                               -NET_IP_ALIGN,
@@@ -3449,15 -3449,12 +3449,12 @@@ static void e1000e_setup_rss_hash(struc
  {
        struct e1000_hw *hw = &adapter->hw;
        u32 mrqc, rxcsum;
+       u32 rss_key[10];
        int i;
-       static const u32 rsskey[10] = {
-               0xda565a6d, 0xc20e5b25, 0x3d256741, 0xb08fa343, 0xcb2bcad0,
-               0xb4307bae, 0xa32dcb77, 0x0cf23080, 0x3bb7426a, 0xfa01acbe
-       };
  
-       /* Fill out hash function seed */
+       netdev_rss_key_fill(rss_key, sizeof(rss_key));
        for (i = 0; i < 10; i++)
-               ew32(RSSRK(i), rsskey[i]);
+               ew32(RSSRK(i), rss_key[i]);
  
        /* Direct all traffic to queue 0 */
        for (i = 0; i < 32; i++)
@@@ -5557,12 -5554,8 +5554,8 @@@ static netdev_tx_t e1000_xmit_frame(str
        /* The minimum packet size with TCTL.PSP set is 17 bytes so
         * pad skb in order to meet this minimum size requirement
         */
-       if (unlikely(skb->len < 17)) {
-               if (skb_pad(skb, 17 - skb->len))
-                       return NETDEV_TX_OK;
-               skb->len = 17;
-               skb_set_tail_pointer(skb, 17);
-       }
+       if (skb_put_padto(skb, 17))
+               return NETDEV_TX_OK;
  
        mss = skb_shinfo(skb)->gso_size;
        if (mss) {
@@@ -6372,6 -6365,7 +6365,6 @@@ static int e1000e_pm_resume(struct devi
  }
  #endif /* CONFIG_PM_SLEEP */
  
 -#ifdef CONFIG_PM_RUNTIME
  static int e1000e_pm_runtime_idle(struct device *dev)
  {
        struct pci_dev *pdev = to_pci_dev(dev);
@@@ -6431,6 -6425,7 +6424,6 @@@ static int e1000e_pm_runtime_suspend(st
  
        return 0;
  }
 -#endif /* CONFIG_PM_RUNTIME */
  #endif /* CONFIG_PM */
  
  static void e1000_shutdown(struct pci_dev *pdev)
@@@ -186,9 -186,11 +186,9 @@@ static int igb_pci_enable_sriov(struct 
  static int igb_suspend(struct device *);
  #endif
  static int igb_resume(struct device *);
 -#ifdef CONFIG_PM_RUNTIME
  static int igb_runtime_suspend(struct device *dev);
  static int igb_runtime_resume(struct device *dev);
  static int igb_runtime_idle(struct device *dev);
 -#endif
  static const struct dev_pm_ops igb_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume)
        SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume,
@@@ -3373,14 -3375,11 +3373,11 @@@ static void igb_setup_mrqc(struct igb_a
        struct e1000_hw *hw = &adapter->hw;
        u32 mrqc, rxcsum;
        u32 j, num_rx_queues;
-       static const u32 rsskey[10] = { 0xDA565A6D, 0xC20E5B25, 0x3D256741,
-                                       0xB08FA343, 0xCB2BCAD0, 0xB4307BAE,
-                                       0xA32DCB77, 0x0CF23080, 0x3BB7426A,
-                                       0xFA01ACBE };
+       u32 rss_key[10];
  
-       /* Fill out hash function seeds */
+       netdev_rss_key_fill(rss_key, sizeof(rss_key));
        for (j = 0; j < 10; j++)
-               wr32(E1000_RSSRK(j), rsskey[j]);
+               wr32(E1000_RSSRK(j), rss_key[j]);
  
        num_rx_queues = adapter->rss_queues;
  
@@@ -5092,12 -5091,8 +5089,8 @@@ static netdev_tx_t igb_xmit_frame(struc
        /* The minimum packet size with TCTL.PSP set is 17 so pad the skb
         * in order to meet this minimum size requirement.
         */
-       if (unlikely(skb->len < 17)) {
-               if (skb_pad(skb, 17 - skb->len))
-                       return NETDEV_TX_OK;
-               skb->len = 17;
-               skb_set_tail_pointer(skb, 17);
-       }
+       if (skb_put_padto(skb, 17))
+               return NETDEV_TX_OK;
  
        return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb));
  }
@@@ -6649,8 -6644,7 +6642,7 @@@ static struct sk_buff *igb_fetch_rx_buf
  #endif
  
                /* allocate a skb to store the frags */
-               skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
-                                               IGB_RX_HDR_LEN);
+               skb = napi_alloc_skb(&rx_ring->q_vector->napi, IGB_RX_HDR_LEN);
                if (unlikely(!skb)) {
                        rx_ring->rx_stats.alloc_failed++;
                        return NULL;
@@@ -6851,14 -6845,9 +6843,9 @@@ static bool igb_cleanup_headers(struct 
        if (skb_is_nonlinear(skb))
                igb_pull_tail(rx_ring, rx_desc, skb);
  
-       /* if skb_pad returns an error the skb was freed */
-       if (unlikely(skb->len < 60)) {
-               int pad_len = 60 - skb->len;
-               if (skb_pad(skb, pad_len))
-                       return true;
-               __skb_put(skb, pad_len);
-       }
+       /* if eth_skb_pad returns an error the skb was freed */
+       if (eth_skb_pad(skb))
+               return true;
  
        return false;
  }
@@@ -6993,7 -6982,7 +6980,7 @@@ static bool igb_alloc_mapped_page(struc
                return true;
  
        /* alloc new page for storage */
-       page = __skb_alloc_page(GFP_ATOMIC | __GFP_COLD, NULL);
+       page = dev_alloc_page();
        if (unlikely(!page)) {
                rx_ring->rx_stats.alloc_failed++;
                return false;
@@@ -7448,6 -7437,7 +7435,6 @@@ static int igb_resume(struct device *de
        return 0;
  }
  
 -#ifdef CONFIG_PM_RUNTIME
  static int igb_runtime_idle(struct device *dev)
  {
        struct pci_dev *pdev = to_pci_dev(dev);
@@@ -7484,7 -7474,8 +7471,7 @@@ static int igb_runtime_resume(struct de
  {
        return igb_resume(dev);
  }
 -#endif /* CONFIG_PM_RUNTIME */
 -#endif
 +#endif /* CONFIG_PM */
  
  static void igb_shutdown(struct pci_dev *pdev)
  {
diff --combined drivers/net/macvtap.c
@@@ -15,6 -15,7 +15,7 @@@
  #include <linux/cdev.h>
  #include <linux/idr.h>
  #include <linux/fs.h>
+ #include <linux/uio.h>
  
  #include <net/ipv6.h>
  #include <net/net_namespace.h>
@@@ -45,18 -46,6 +46,18 @@@ struct macvtap_queue 
        struct list_head next;
  };
  
 +#define MACVTAP_FEATURES (IFF_VNET_HDR | IFF_VNET_LE | IFF_MULTI_QUEUE)
 +
 +static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val)
 +{
 +      return __virtio16_to_cpu(q->flags & IFF_VNET_LE, val);
 +}
 +
 +static inline __virtio16 cpu_to_macvtap16(struct macvtap_queue *q, u16 val)
 +{
 +      return __cpu_to_virtio16(q->flags & IFF_VNET_LE, val);
 +}
 +
  static struct proto macvtap_proto = {
        .name = "macvtap",
        .owner = THIS_MODULE,
@@@ -569,8 -558,7 +570,8 @@@ static inline struct sk_buff *macvtap_a
   * macvtap_skb_from_vnet_hdr and macvtap_skb_to_vnet_hdr should
   * be shared with the tun/tap driver.
   */
 -static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb,
 +static int macvtap_skb_from_vnet_hdr(struct macvtap_queue *q,
 +                                   struct sk_buff *skb,
                                     struct virtio_net_hdr *vnet_hdr)
  {
        unsigned short gso_type = 0;
        }
  
        if (vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
 -              if (!skb_partial_csum_set(skb, vnet_hdr->csum_start,
 -                                        vnet_hdr->csum_offset))
 +              if (!skb_partial_csum_set(skb, macvtap16_to_cpu(q, vnet_hdr->csum_start),
 +                                        macvtap16_to_cpu(q, vnet_hdr->csum_offset)))
                        return -EINVAL;
        }
  
        if (vnet_hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
 -              skb_shinfo(skb)->gso_size = vnet_hdr->gso_size;
 +              skb_shinfo(skb)->gso_size = macvtap16_to_cpu(q, vnet_hdr->gso_size);
                skb_shinfo(skb)->gso_type = gso_type;
  
                /* Header must be checked, and gso_segs computed. */
        return 0;
  }
  
 -static void macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
 -                                 struct virtio_net_hdr *vnet_hdr)
 +static void macvtap_skb_to_vnet_hdr(struct macvtap_queue *q,
 +                                  const struct sk_buff *skb,
 +                                  struct virtio_net_hdr *vnet_hdr)
  {
        memset(vnet_hdr, 0, sizeof(*vnet_hdr));
  
                struct skb_shared_info *sinfo = skb_shinfo(skb);
  
                /* This is a hint as to how much should be linear. */
 -              vnet_hdr->hdr_len = skb_headlen(skb);
 -              vnet_hdr->gso_size = sinfo->gso_size;
 +              vnet_hdr->hdr_len = cpu_to_macvtap16(q, skb_headlen(skb));
 +              vnet_hdr->gso_size = cpu_to_macvtap16(q, sinfo->gso_size);
                if (sinfo->gso_type & SKB_GSO_TCPV4)
                        vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
                else if (sinfo->gso_type & SKB_GSO_TCPV6)
  
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
                vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
 -              vnet_hdr->csum_start = skb_checksum_start_offset(skb);
                if (vlan_tx_tag_present(skb))
 -                      vnet_hdr->csum_start += VLAN_HLEN;
 -              vnet_hdr->csum_offset = skb->csum_offset;
 +                      vnet_hdr->csum_start = cpu_to_macvtap16(q,
 +                              skb_checksum_start_offset(skb) + VLAN_HLEN);
 +              else
 +                      vnet_hdr->csum_start = cpu_to_macvtap16(q,
 +                              skb_checksum_start_offset(skb));
 +              vnet_hdr->csum_offset = cpu_to_macvtap16(q, skb->csum_offset);
        } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
                vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
        } /* else everything is zero */
  
  /* Get packet from user space buffer */
  static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
-                               const struct iovec *iv, unsigned long total_len,
-                               size_t count, int noblock)
+                               struct iov_iter *from, int noblock)
  {
        int good_linear = SKB_MAX_HEAD(NET_IP_ALIGN);
        struct sk_buff *skb;
        struct macvlan_dev *vlan;
+       unsigned long total_len = iov_iter_count(from);
        unsigned long len = total_len;
        int err;
        struct virtio_net_hdr vnet_hdr = { 0 };
        int copylen = 0;
        bool zerocopy = false;
        size_t linear;
+       ssize_t n;
  
        if (q->flags & IFF_VNET_HDR) {
                vnet_hdr_len = q->vnet_hdr_sz;
                        goto err;
                len -= vnet_hdr_len;
  
-               err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0,
-                                          sizeof(vnet_hdr));
-               if (err < 0)
+               err = -EFAULT;
+               n = copy_from_iter(&vnet_hdr, sizeof(vnet_hdr), from);
+               if (n != sizeof(vnet_hdr))
                        goto err;
+               iov_iter_advance(from, vnet_hdr_len - sizeof(vnet_hdr));
                if ((vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
 -                   vnet_hdr.csum_start + vnet_hdr.csum_offset + 2 >
 -                                                      vnet_hdr.hdr_len)
 -                      vnet_hdr.hdr_len = vnet_hdr.csum_start +
 -                                              vnet_hdr.csum_offset + 2;
 +                   macvtap16_to_cpu(q, vnet_hdr.csum_start) +
 +                   macvtap16_to_cpu(q, vnet_hdr.csum_offset) + 2 >
 +                           macvtap16_to_cpu(q, vnet_hdr.hdr_len))
 +                      vnet_hdr.hdr_len = cpu_to_macvtap16(q,
 +                               macvtap16_to_cpu(q, vnet_hdr.csum_start) +
 +                               macvtap16_to_cpu(q, vnet_hdr.csum_offset) + 2);
                err = -EINVAL;
 -              if (vnet_hdr.hdr_len > len)
 +              if (macvtap16_to_cpu(q, vnet_hdr.hdr_len) > len)
                        goto err;
        }
  
        if (unlikely(len < ETH_HLEN))
                goto err;
  
-       err = -EMSGSIZE;
-       if (unlikely(count > UIO_MAXIOV))
-               goto err;
        if (m && m->msg_control && sock_flag(&q->sk, SOCK_ZEROCOPY)) {
 -              copylen = vnet_hdr.hdr_len ? vnet_hdr.hdr_len : GOODCOPY_LEN;
+               struct iov_iter i;
 +              copylen = vnet_hdr.hdr_len ?
 +                      macvtap16_to_cpu(q, vnet_hdr.hdr_len) : GOODCOPY_LEN;
                if (copylen > good_linear)
                        copylen = good_linear;
                linear = copylen;
-               if (iov_pages(iv, vnet_hdr_len + copylen, count)
-                   <= MAX_SKB_FRAGS)
+               i = *from;
+               iov_iter_advance(&i, copylen);
+               if (iov_iter_npages(&i, INT_MAX) <= MAX_SKB_FRAGS)
                        zerocopy = true;
        }
  
        if (!zerocopy) {
                copylen = len;
 -              if (vnet_hdr.hdr_len > good_linear)
 +              if (macvtap16_to_cpu(q, vnet_hdr.hdr_len) > good_linear)
                        linear = good_linear;
                else
 -                      linear = vnet_hdr.hdr_len;
 +                      linear = macvtap16_to_cpu(q, vnet_hdr.hdr_len);
        }
  
        skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen,
                goto err;
  
        if (zerocopy)
-               err = zerocopy_sg_from_iovec(skb, iv, vnet_hdr_len, count);
+               err = zerocopy_sg_from_iter(skb, from);
        else {
-               err = skb_copy_datagram_from_iovec(skb, 0, iv, vnet_hdr_len,
-                                                  len);
+               err = skb_copy_datagram_from_iter(skb, 0, from, len);
                if (!err && m && m->msg_control) {
                        struct ubuf_info *uarg = m->msg_control;
                        uarg->callback(uarg, false);
        skb->protocol = eth_hdr(skb)->h_proto;
  
        if (vnet_hdr_len) {
 -              err = macvtap_skb_from_vnet_hdr(skb, &vnet_hdr);
 +              err = macvtap_skb_from_vnet_hdr(q, skb, &vnet_hdr);
                if (err)
                        goto err_kfree;
        }
@@@ -783,46 -764,42 +784,42 @@@ err
        return err;
  }
  
- static ssize_t macvtap_aio_write(struct kiocb *iocb, const struct iovec *iv,
-                                unsigned long count, loff_t pos)
+ static ssize_t macvtap_write_iter(struct kiocb *iocb, struct iov_iter *from)
  {
        struct file *file = iocb->ki_filp;
-       ssize_t result = -ENOLINK;
        struct macvtap_queue *q = file->private_data;
  
-       result = macvtap_get_user(q, NULL, iv, iov_length(iv, count), count,
-                                 file->f_flags & O_NONBLOCK);
-       return result;
+       return macvtap_get_user(q, NULL, from, file->f_flags & O_NONBLOCK);
  }
  
  /* Put packet to the user space buffer */
  static ssize_t macvtap_put_user(struct macvtap_queue *q,
                                const struct sk_buff *skb,
-                               const struct iovec *iv, int len)
+                               struct iov_iter *iter)
  {
        int ret;
        int vnet_hdr_len = 0;
        int vlan_offset = 0;
-       int copied, total;
+       int total;
  
        if (q->flags & IFF_VNET_HDR) {
                struct virtio_net_hdr vnet_hdr;
                vnet_hdr_len = q->vnet_hdr_sz;
-               if ((len -= vnet_hdr_len) < 0)
+               if (iov_iter_count(iter) < vnet_hdr_len)
                        return -EINVAL;
  
 -              macvtap_skb_to_vnet_hdr(skb, &vnet_hdr);
 +              macvtap_skb_to_vnet_hdr(q, skb, &vnet_hdr);
  
-               if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
+               if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
+                   sizeof(vnet_hdr))
                        return -EFAULT;
+               iov_iter_advance(iter, vnet_hdr_len - sizeof(vnet_hdr));
        }
-       total = copied = vnet_hdr_len;
+       total = vnet_hdr_len;
        total += skb->len;
  
-       if (!vlan_tx_tag_present(skb))
-               len = min_t(int, skb->len, len);
-       else {
-               int copy;
+       if (vlan_tx_tag_present(skb)) {
                struct {
                        __be16 h_vlan_proto;
                        __be16 h_vlan_TCI;
                veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
  
                vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
-               len = min_t(int, skb->len + VLAN_HLEN, len);
                total += VLAN_HLEN;
  
-               copy = min_t(int, vlan_offset, len);
-               ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
-               len -= copy;
-               copied += copy;
-               if (ret || !len)
+               ret = skb_copy_datagram_iter(skb, 0, iter, vlan_offset);
+               if (ret || !iov_iter_count(iter))
                        goto done;
  
-               copy = min_t(int, sizeof(veth), len);
-               ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
-               len -= copy;
-               copied += copy;
-               if (ret || !len)
+               ret = copy_to_iter(&veth, sizeof(veth), iter);
+               if (ret != sizeof(veth) || !iov_iter_count(iter))
                        goto done;
        }
  
-       ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
+       ret = skb_copy_datagram_iter(skb, vlan_offset, iter,
+                                    skb->len - vlan_offset);
  
  done:
        return ret ? ret : total;
  }
  
  static ssize_t macvtap_do_read(struct macvtap_queue *q,
-                              const struct iovec *iv, unsigned long len,
+                              struct iov_iter *to,
                               int noblock)
  {
        DEFINE_WAIT(wait);
        struct sk_buff *skb;
        ssize_t ret = 0;
  
-       while (len) {
+       if (!iov_iter_count(to))
+               return 0;
+       while (1) {
                if (!noblock)
                        prepare_to_wait(sk_sleep(&q->sk), &wait,
                                        TASK_INTERRUPTIBLE);
  
                /* Read frames from the queue */
                skb = skb_dequeue(&q->sk.sk_receive_queue);
-               if (!skb) {
-                       if (noblock) {
-                               ret = -EAGAIN;
-                               break;
-                       }
-                       if (signal_pending(current)) {
-                               ret = -ERESTARTSYS;
-                               break;
-                       }
-                       /* Nothing to read, let's sleep */
-                       schedule();
-                       continue;
+               if (skb)
+                       break;
+               if (noblock) {
+                       ret = -EAGAIN;
+                       break;
                }
-               ret = macvtap_put_user(q, skb, iv, len);
-               kfree_skb(skb);
-               break;
+               if (signal_pending(current)) {
+                       ret = -ERESTARTSYS;
+                       break;
+               }
+               /* Nothing to read, let's sleep */
+               schedule();
+       }
+       if (skb) {
+               ret = macvtap_put_user(q, skb, to);
+               if (unlikely(ret < 0))
+                       kfree_skb(skb);
+               else
+                       consume_skb(skb);
        }
        if (!noblock)
                finish_wait(sk_sleep(&q->sk), &wait);
        return ret;
  }
  
- static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv,
-                               unsigned long count, loff_t pos)
+ static ssize_t macvtap_read_iter(struct kiocb *iocb, struct iov_iter *to)
  {
        struct file *file = iocb->ki_filp;
        struct macvtap_queue *q = file->private_data;
-       ssize_t len, ret = 0;
+       ssize_t len = iov_iter_count(to), ret;
  
-       len = iov_length(iv, count);
-       if (len < 0) {
-               ret = -EINVAL;
-               goto out;
-       }
-       ret = macvtap_do_read(q, iv, len, file->f_flags & O_NONBLOCK);
+       ret = macvtap_do_read(q, to, file->f_flags & O_NONBLOCK);
        ret = min_t(ssize_t, ret, len);
        if (ret > 0)
                iocb->ki_pos = ret;
- out:
        return ret;
  }
  
@@@ -1023,7 -991,8 +1011,7 @@@ static long macvtap_ioctl(struct file *
                        return -EFAULT;
  
                ret = 0;
 -              if ((u & ~(IFF_VNET_HDR | IFF_MULTI_QUEUE)) !=
 -                  (IFF_NO_PI | IFF_TAP))
 +              if ((u & ~MACVTAP_FEATURES) != (IFF_NO_PI | IFF_TAP))
                        ret = -EINVAL;
                else
                        q->flags = u;
                return ret;
  
        case TUNGETFEATURES:
 -              if (put_user(IFF_TAP | IFF_NO_PI | IFF_VNET_HDR |
 -                           IFF_MULTI_QUEUE, up))
 +              if (put_user(IFF_TAP | IFF_NO_PI | MACVTAP_FEATURES, up))
                        return -EFAULT;
                return 0;
  
@@@ -1109,8 -1079,10 +1097,10 @@@ static const struct file_operations mac
        .owner          = THIS_MODULE,
        .open           = macvtap_open,
        .release        = macvtap_release,
-       .aio_read       = macvtap_aio_read,
-       .aio_write      = macvtap_aio_write,
+       .read           = new_sync_read,
+       .write          = new_sync_write,
+       .read_iter      = macvtap_read_iter,
+       .write_iter     = macvtap_write_iter,
        .poll           = macvtap_poll,
        .llseek         = no_llseek,
        .unlocked_ioctl = macvtap_ioctl,
@@@ -1123,8 -1095,7 +1113,7 @@@ static int macvtap_sendmsg(struct kioc
                           struct msghdr *m, size_t total_len)
  {
        struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock);
-       return macvtap_get_user(q, m, m->msg_iov, total_len, m->msg_iovlen,
-                           m->msg_flags & MSG_DONTWAIT);
+       return macvtap_get_user(q, m, &m->msg_iter, m->msg_flags & MSG_DONTWAIT);
  }
  
  static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock,
        int ret;
        if (flags & ~(MSG_DONTWAIT|MSG_TRUNC))
                return -EINVAL;
-       ret = macvtap_do_read(q, m->msg_iov, total_len,
-                         flags & MSG_DONTWAIT);
+       ret = macvtap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT);
        if (ret > total_len) {
                m->msg_flags |= MSG_TRUNC;
                ret = flags & MSG_TRUNC ? ret : total_len;
diff --combined drivers/net/tun.c
@@@ -71,6 -71,7 +71,7 @@@
  #include <net/rtnetlink.h>
  #include <net/sock.h>
  #include <linux/seq_file.h>
+ #include <linux/uio.h>
  
  #include <asm/uaccess.h>
  
@@@ -103,15 -104,6 +104,15 @@@ do {                                                             
  } while (0)
  #endif
  
 +/* TUN device flags */
 +
 +/* IFF_ATTACH_QUEUE is never stored in device flags,
 + * overload it to mean fasync when stored there.
 + */
 +#define TUN_FASYNC    IFF_ATTACH_QUEUE
 +
 +#define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \
 +                    IFF_VNET_LE | IFF_MULTI_QUEUE)
  #define GOODCOPY_LEN 128
  
  #define FLT_EXACT_COUNT 8
@@@ -205,16 -197,6 +206,16 @@@ struct tun_struct 
        u32 flow_count;
  };
  
 +static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
 +{
 +      return __virtio16_to_cpu(tun->flags & IFF_VNET_LE, val);
 +}
 +
 +static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val)
 +{
 +      return __cpu_to_virtio16(tun->flags & IFF_VNET_LE, val);
 +}
 +
  static inline u32 tun_hashfn(u32 rxhash)
  {
        return rxhash & 0x3ff;
@@@ -491,7 -473,7 +492,7 @@@ static void __tun_detach(struct tun_fil
                if (tun && tun->numqueues == 0 && tun->numdisabled == 0) {
                        netif_carrier_off(tun->dev);
  
 -                      if (!(tun->flags & TUN_PERSIST) &&
 +                      if (!(tun->flags & IFF_PERSIST) &&
                            tun->dev->reg_state == NETREG_REGISTERED)
                                unregister_netdevice(tun->dev);
                }
@@@ -542,7 -524,7 +543,7 @@@ static void tun_detach_all(struct net_d
        }
        BUG_ON(tun->numdisabled != 0);
  
 -      if (tun->flags & TUN_PERSIST)
 +      if (tun->flags & IFF_PERSIST)
                module_put(THIS_MODULE);
  }
  
@@@ -560,7 -542,7 +561,7 @@@ static int tun_attach(struct tun_struc
                goto out;
  
        err = -EBUSY;
 -      if (!(tun->flags & TUN_TAP_MQ) && tun->numqueues == 1)
 +      if (!(tun->flags & IFF_MULTI_QUEUE) && tun->numqueues == 1)
                goto out;
  
        err = -E2BIG;
@@@ -837,7 -819,7 +838,7 @@@ drop
        skb_tx_error(skb);
        kfree_skb(skb);
        rcu_read_unlock();
-       return NETDEV_TX_OK;
+       return NET_XMIT_DROP;
  }
  
  static void tun_net_mclist(struct net_device *dev)
@@@ -939,7 -921,7 +940,7 @@@ static void tun_net_init(struct net_dev
        struct tun_struct *tun = netdev_priv(dev);
  
        switch (tun->flags & TUN_TYPE_MASK) {
 -      case TUN_TUN_DEV:
 +      case IFF_TUN:
                dev->netdev_ops = &tun_netdev_ops;
  
                /* Point-to-Point TUN Device */
                dev->tx_queue_len = TUN_READQ_SIZE;  /* We prefer our own queue length */
                break;
  
 -      case TUN_TAP_DEV:
 +      case IFF_TAP:
                dev->netdev_ops = &tap_netdev_ops;
                /* Ethernet TAP Device */
                ether_setup(dev);
@@@ -1030,75 -1012,80 +1031,80 @@@ static struct sk_buff *tun_alloc_skb(st
  
  /* Get packet from user space buffer */
  static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
-                           void *msg_control, const struct iovec *iv,
-                           size_t total_len, size_t count, int noblock)
+                           void *msg_control, struct iov_iter *from,
+                           int noblock)
  {
        struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
        struct sk_buff *skb;
+       size_t total_len = iov_iter_count(from);
        size_t len = total_len, align = NET_SKB_PAD, linear;
        struct virtio_net_hdr gso = { 0 };
        int good_linear;
-       int offset = 0;
        int copylen;
        bool zerocopy = false;
        int err;
        u32 rxhash;
+       ssize_t n;
  
 -      if (!(tun->flags & TUN_NO_PI)) {
 +      if (!(tun->flags & IFF_NO_PI)) {
                if (len < sizeof(pi))
                        return -EINVAL;
                len -= sizeof(pi);
  
-               if (memcpy_fromiovecend((void *)&pi, iv, 0, sizeof(pi)))
+               n = copy_from_iter(&pi, sizeof(pi), from);
+               if (n != sizeof(pi))
                        return -EFAULT;
-               offset += sizeof(pi);
        }
  
 -      if (tun->flags & TUN_VNET_HDR) {
 +      if (tun->flags & IFF_VNET_HDR) {
                if (len < tun->vnet_hdr_sz)
                        return -EINVAL;
                len -= tun->vnet_hdr_sz;
  
-               if (memcpy_fromiovecend((void *)&gso, iv, offset, sizeof(gso)))
+               n = copy_from_iter(&gso, sizeof(gso), from);
+               if (n != sizeof(gso))
                        return -EFAULT;
  
                if ((gso.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
 -                  gso.csum_start + gso.csum_offset + 2 > gso.hdr_len)
 -                      gso.hdr_len = gso.csum_start + gso.csum_offset + 2;
 +                  tun16_to_cpu(tun, gso.csum_start) + tun16_to_cpu(tun, gso.csum_offset) + 2 > tun16_to_cpu(tun, gso.hdr_len))
 +                      gso.hdr_len = cpu_to_tun16(tun, tun16_to_cpu(tun, gso.csum_start) + tun16_to_cpu(tun, gso.csum_offset) + 2);
  
 -              if (gso.hdr_len > len)
 +              if (tun16_to_cpu(tun, gso.hdr_len) > len)
                        return -EINVAL;
-               offset += tun->vnet_hdr_sz;
+               iov_iter_advance(from, tun->vnet_hdr_sz - sizeof(gso));
        }
  
 -      if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
 +      if ((tun->flags & TUN_TYPE_MASK) == IFF_TAP) {
                align += NET_IP_ALIGN;
                if (unlikely(len < ETH_HLEN ||
 -                           (gso.hdr_len && gso.hdr_len < ETH_HLEN)))
 +                           (gso.hdr_len && tun16_to_cpu(tun, gso.hdr_len) < ETH_HLEN)))
                        return -EINVAL;
        }
  
        good_linear = SKB_MAX_HEAD(align);
  
        if (msg_control) {
+               struct iov_iter i = *from;
                /* There are 256 bytes to be copied in skb, so there is
                 * enough room for skb expand head in case it is used.
                 * The rest of the buffer is mapped from userspace.
                 */
 -              copylen = gso.hdr_len ? gso.hdr_len : GOODCOPY_LEN;
 +              copylen = gso.hdr_len ? tun16_to_cpu(tun, gso.hdr_len) : GOODCOPY_LEN;
                if (copylen > good_linear)
                        copylen = good_linear;
                linear = copylen;
-               if (iov_pages(iv, offset + copylen, count) <= MAX_SKB_FRAGS)
+               iov_iter_advance(&i, copylen);
+               if (iov_iter_npages(&i, INT_MAX) <= MAX_SKB_FRAGS)
                        zerocopy = true;
        }
  
        if (!zerocopy) {
                copylen = len;
 -              if (gso.hdr_len > good_linear)
 +              if (tun16_to_cpu(tun, gso.hdr_len) > good_linear)
                        linear = good_linear;
                else
 -                      linear = gso.hdr_len;
 +                      linear = tun16_to_cpu(tun, gso.hdr_len);
        }
  
        skb = tun_alloc_skb(tfile, align, copylen, linear, noblock);
        }
  
        if (zerocopy)
-               err = zerocopy_sg_from_iovec(skb, iv, offset, count);
+               err = zerocopy_sg_from_iter(skb, from);
        else {
-               err = skb_copy_datagram_from_iovec(skb, 0, iv, offset, len);
+               err = skb_copy_datagram_from_iter(skb, 0, from, len);
                if (!err && msg_control) {
                        struct ubuf_info *uarg = msg_control;
                        uarg->callback(uarg, false);
        }
  
        if (gso.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
 -              if (!skb_partial_csum_set(skb, gso.csum_start,
 -                                        gso.csum_offset)) {
 +              if (!skb_partial_csum_set(skb, tun16_to_cpu(tun, gso.csum_start),
 +                                        tun16_to_cpu(tun, gso.csum_offset))) {
                        tun->dev->stats.rx_frame_errors++;
                        kfree_skb(skb);
                        return -EINVAL;
        }
  
        switch (tun->flags & TUN_TYPE_MASK) {
 -      case TUN_TUN_DEV:
 -              if (tun->flags & TUN_NO_PI) {
 +      case IFF_TUN:
 +              if (tun->flags & IFF_NO_PI) {
                        switch (skb->data[0] & 0xf0) {
                        case 0x40:
                                pi.proto = htons(ETH_P_IP);
                skb->protocol = pi.proto;
                skb->dev = tun->dev;
                break;
 -      case TUN_TAP_DEV:
 +      case IFF_TAP:
                skb->protocol = eth_type_trans(skb, tun->dev);
                break;
        }
                if (gso.gso_type & VIRTIO_NET_HDR_GSO_ECN)
                        skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
  
 -              skb_shinfo(skb)->gso_size = gso.gso_size;
 +              skb_shinfo(skb)->gso_size = tun16_to_cpu(tun, gso.gso_size);
                if (skb_shinfo(skb)->gso_size == 0) {
                        tun->dev->stats.rx_frame_errors++;
                        kfree_skb(skb);
        return total_len;
  }
  
- static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
-                             unsigned long count, loff_t pos)
+ static ssize_t tun_chr_write_iter(struct kiocb *iocb, struct iov_iter *from)
  {
        struct file *file = iocb->ki_filp;
        struct tun_struct *tun = tun_get(file);
        if (!tun)
                return -EBADFD;
  
-       tun_debug(KERN_INFO, tun, "tun_chr_write %ld\n", count);
-       result = tun_get_user(tun, tfile, NULL, iv, iov_length(iv, count),
-                             count, file->f_flags & O_NONBLOCK);
+       result = tun_get_user(tun, tfile, NULL, from, file->f_flags & O_NONBLOCK);
  
        tun_put(tun);
        return result;
  static ssize_t tun_put_user(struct tun_struct *tun,
                            struct tun_file *tfile,
                            struct sk_buff *skb,
-                           const struct iovec *iv, int len)
+                           struct iov_iter *iter)
  {
        struct tun_pi pi = { 0, skb->protocol };
-       ssize_t total = 0;
-       int vlan_offset = 0, copied;
+       ssize_t total;
+       int vlan_offset = 0;
        int vlan_hlen = 0;
        int vnet_hdr_sz = 0;
  
        if (vlan_tx_tag_present(skb))
                vlan_hlen = VLAN_HLEN;
  
 -      if (tun->flags & TUN_VNET_HDR)
 +      if (tun->flags & IFF_VNET_HDR)
                vnet_hdr_sz = tun->vnet_hdr_sz;
  
 -      if (!(tun->flags & TUN_NO_PI)) {
+       total = skb->len + vlan_hlen + vnet_hdr_sz;
-               if ((len -= sizeof(pi)) < 0)
 +      if (!(tun->flags & IFF_NO_PI)) {
+               if (iov_iter_count(iter) < sizeof(pi))
                        return -EINVAL;
  
-               if (len < skb->len + vlan_hlen + vnet_hdr_sz) {
+               total += sizeof(pi);
+               if (iov_iter_count(iter) < total) {
                        /* Packet will be striped */
                        pi.flags |= TUN_PKT_STRIP;
                }
  
-               if (memcpy_toiovecend(iv, (void *) &pi, 0, sizeof(pi)))
+               if (copy_to_iter(&pi, sizeof(pi), iter) != sizeof(pi))
                        return -EFAULT;
-               total += sizeof(pi);
        }
  
        if (vnet_hdr_sz) {
                struct virtio_net_hdr gso = { 0 }; /* no info leak */
-               if ((len -= vnet_hdr_sz) < 0)
+               if (iov_iter_count(iter) < vnet_hdr_sz)
                        return -EINVAL;
  
                if (skb_is_gso(skb)) {
                        struct skb_shared_info *sinfo = skb_shinfo(skb);
  
                        /* This is a hint as to how much should be linear. */
 -                      gso.hdr_len = skb_headlen(skb);
 -                      gso.gso_size = sinfo->gso_size;
 +                      gso.hdr_len = cpu_to_tun16(tun, skb_headlen(skb));
 +                      gso.gso_size = cpu_to_tun16(tun, sinfo->gso_size);
                        if (sinfo->gso_type & SKB_GSO_TCPV4)
                                gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
                        else if (sinfo->gso_type & SKB_GSO_TCPV6)
                        else {
                                pr_err("unexpected GSO type: "
                                       "0x%x, gso_size %d, hdr_len %d\n",
 -                                     sinfo->gso_type, gso.gso_size,
 -                                     gso.hdr_len);
 +                                     sinfo->gso_type, tun16_to_cpu(tun, gso.gso_size),
 +                                     tun16_to_cpu(tun, gso.hdr_len));
                                print_hex_dump(KERN_ERR, "tun: ",
                                               DUMP_PREFIX_NONE,
                                               16, 1, skb->head,
 -                                             min((int)gso.hdr_len, 64), true);
 +                                             min((int)tun16_to_cpu(tun, gso.hdr_len), 64), true);
                                WARN_ON_ONCE(1);
                                return -EINVAL;
                        }
  
                if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
 -                      gso.csum_start = skb_checksum_start_offset(skb) +
 -                                       vlan_hlen;
 -                      gso.csum_offset = skb->csum_offset;
 +                      gso.csum_start = cpu_to_tun16(tun, skb_checksum_start_offset(skb) +
 +                                                    vlan_hlen);
 +                      gso.csum_offset = cpu_to_tun16(tun, skb->csum_offset);
                } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
                        gso.flags = VIRTIO_NET_HDR_F_DATA_VALID;
                } /* else everything is zero */
  
-               if (unlikely(memcpy_toiovecend(iv, (void *)&gso, total,
-                                              sizeof(gso))))
+               if (copy_to_iter(&gso, sizeof(gso), iter) != sizeof(gso))
                        return -EFAULT;
-               total += vnet_hdr_sz;
+               iov_iter_advance(iter, vnet_hdr_sz - sizeof(gso));
        }
  
-       copied = total;
-       len = min_t(int, skb->len + vlan_hlen, len);
-       total += skb->len + vlan_hlen;
        if (vlan_hlen) {
-               int copy, ret;
+               int ret;
                struct {
                        __be16 h_vlan_proto;
                        __be16 h_vlan_TCI;
  
                vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
  
-               copy = min_t(int, vlan_offset, len);
-               ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
-               len -= copy;
-               copied += copy;
-               if (ret || !len)
+               ret = skb_copy_datagram_iter(skb, 0, iter, vlan_offset);
+               if (ret || !iov_iter_count(iter))
                        goto done;
  
-               copy = min_t(int, sizeof(veth), len);
-               ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
-               len -= copy;
-               copied += copy;
-               if (ret || !len)
+               ret = copy_to_iter(&veth, sizeof(veth), iter);
+               if (ret != sizeof(veth) || !iov_iter_count(iter))
                        goto done;
        }
  
-       skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
+       skb_copy_datagram_iter(skb, vlan_offset, iter, skb->len - vlan_offset);
  
  done:
        tun->dev->stats.tx_packets++;
-       tun->dev->stats.tx_bytes += len;
+       tun->dev->stats.tx_bytes += skb->len + vlan_hlen;
  
        return total;
  }
  
  static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile,
-                          const struct iovec *iv, ssize_t len, int noblock)
+                          struct iov_iter *to,
+                          int noblock)
  {
        struct sk_buff *skb;
-       ssize_t ret = 0;
+       ssize_t ret;
        int peeked, err, off = 0;
  
        tun_debug(KERN_INFO, tun, "tun_do_read\n");
  
-       if (!len)
-               return ret;
+       if (!iov_iter_count(to))
+               return 0;
  
        if (tun->dev->reg_state != NETREG_REGISTERED)
                return -EIO;
        /* Read frames from queue */
        skb = __skb_recv_datagram(tfile->socket.sk, noblock ? MSG_DONTWAIT : 0,
                                  &peeked, &off, &err);
-       if (skb) {
-               ret = tun_put_user(tun, tfile, skb, iv, len);
+       if (!skb)
+               return 0;
+       ret = tun_put_user(tun, tfile, skb, to);
+       if (unlikely(ret < 0))
                kfree_skb(skb);
-       else
-               ret = err;
+       else
+               consume_skb(skb);
  
        return ret;
  }
  
- static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv,
-                           unsigned long count, loff_t pos)
+ static ssize_t tun_chr_read_iter(struct kiocb *iocb, struct iov_iter *to)
  {
        struct file *file = iocb->ki_filp;
        struct tun_file *tfile = file->private_data;
        struct tun_struct *tun = __tun_get(tfile);
-       ssize_t len, ret;
+       ssize_t len = iov_iter_count(to), ret;
  
        if (!tun)
                return -EBADFD;
-       len = iov_length(iv, count);
-       if (len < 0) {
-               ret = -EINVAL;
-               goto out;
-       }
-       ret = tun_do_read(tun, tfile, iv, len,
-                         file->f_flags & O_NONBLOCK);
+       ret = tun_do_read(tun, tfile, to, file->f_flags & O_NONBLOCK);
        ret = min_t(ssize_t, ret, len);
        if (ret > 0)
                iocb->ki_pos = ret;
- out:
        tun_put(tun);
        return ret;
  }
@@@ -1481,8 -1452,9 +1471,9 @@@ static int tun_sendmsg(struct kiocb *io
  
        if (!tun)
                return -EBADFD;
-       ret = tun_get_user(tun, tfile, m->msg_control, m->msg_iov, total_len,
-                          m->msg_iovlen, m->msg_flags & MSG_DONTWAIT);
+       ret = tun_get_user(tun, tfile, m->msg_control, &m->msg_iter,
+                          m->msg_flags & MSG_DONTWAIT);
        tun_put(tun);
        return ret;
  }
@@@ -1507,8 -1479,7 +1498,7 @@@ static int tun_recvmsg(struct kiocb *io
                                         SOL_PACKET, TUN_TX_TIMESTAMP);
                goto out;
        }
-       ret = tun_do_read(tun, tfile, m->msg_iov, total_len,
-                         flags & MSG_DONTWAIT);
+       ret = tun_do_read(tun, tfile, &m->msg_iter, flags & MSG_DONTWAIT);
        if (ret > total_len) {
                m->msg_flags |= MSG_TRUNC;
                ret = flags & MSG_TRUNC ? ret : total_len;
@@@ -1540,7 -1511,32 +1530,7 @@@ static struct proto tun_proto = 
  
  static int tun_flags(struct tun_struct *tun)
  {
 -      int flags = 0;
 -
 -      if (tun->flags & TUN_TUN_DEV)
 -              flags |= IFF_TUN;
 -      else
 -              flags |= IFF_TAP;
 -
 -      if (tun->flags & TUN_NO_PI)
 -              flags |= IFF_NO_PI;
 -
 -      /* This flag has no real effect.  We track the value for backwards
 -       * compatibility.
 -       */
 -      if (tun->flags & TUN_ONE_QUEUE)
 -              flags |= IFF_ONE_QUEUE;
 -
 -      if (tun->flags & TUN_VNET_HDR)
 -              flags |= IFF_VNET_HDR;
 -
 -      if (tun->flags & TUN_TAP_MQ)
 -              flags |= IFF_MULTI_QUEUE;
 -
 -      if (tun->flags & TUN_PERSIST)
 -              flags |= IFF_PERSIST;
 -
 -      return flags;
 +      return tun->flags & (TUN_FEATURES | IFF_PERSIST | IFF_TUN | IFF_TAP);
  }
  
  static ssize_t tun_show_flags(struct device *dev, struct device_attribute *attr,
@@@ -1596,7 -1592,7 +1586,7 @@@ static int tun_set_iff(struct net *net
                        return -EINVAL;
  
                if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) !=
 -                  !!(tun->flags & TUN_TAP_MQ))
 +                  !!(tun->flags & IFF_MULTI_QUEUE))
                        return -EINVAL;
  
                if (tun_not_capable(tun))
                if (err < 0)
                        return err;
  
 -              if (tun->flags & TUN_TAP_MQ &&
 +              if (tun->flags & IFF_MULTI_QUEUE &&
                    (tun->numqueues + tun->numdisabled > 1)) {
                        /* One or more queue has already been attached, no need
                         * to initialize the device again.
                /* Set dev type */
                if (ifr->ifr_flags & IFF_TUN) {
                        /* TUN device */
 -                      flags |= TUN_TUN_DEV;
 +                      flags |= IFF_TUN;
                        name = "tun%d";
                } else if (ifr->ifr_flags & IFF_TAP) {
                        /* TAP device */
 -                      flags |= TUN_TAP_DEV;
 +                      flags |= IFF_TAP;
                        name = "tap%d";
                } else
                        return -EINVAL;
  
        tun_debug(KERN_INFO, tun, "tun_set_iff\n");
  
 -      if (ifr->ifr_flags & IFF_NO_PI)
 -              tun->flags |= TUN_NO_PI;
 -      else
 -              tun->flags &= ~TUN_NO_PI;
 -
 -      /* This flag has no real effect.  We track the value for backwards
 -       * compatibility.
 -       */
 -      if (ifr->ifr_flags & IFF_ONE_QUEUE)
 -              tun->flags |= TUN_ONE_QUEUE;
 -      else
 -              tun->flags &= ~TUN_ONE_QUEUE;
 -
 -      if (ifr->ifr_flags & IFF_VNET_HDR)
 -              tun->flags |= TUN_VNET_HDR;
 -      else
 -              tun->flags &= ~TUN_VNET_HDR;
 -
 -      if (ifr->ifr_flags & IFF_MULTI_QUEUE)
 -              tun->flags |= TUN_TAP_MQ;
 -      else
 -              tun->flags &= ~TUN_TAP_MQ;
 +      tun->flags = (tun->flags & ~TUN_FEATURES) |
 +              (ifr->ifr_flags & TUN_FEATURES);
  
        /* Make sure persistent devices do not get stuck in
         * xoff state.
@@@ -1829,7 -1845,7 +1819,7 @@@ static int tun_set_queue(struct file *f
                ret = tun_attach(tun, file, false);
        } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
                tun = rtnl_dereference(tfile->tun);
 -              if (!tun || !(tun->flags & TUN_TAP_MQ) || tfile->detached)
 +              if (!tun || !(tun->flags & IFF_MULTI_QUEUE) || tfile->detached)
                        ret = -EINVAL;
                else
                        __tun_detach(tfile, false);
@@@ -1864,9 -1880,9 +1854,9 @@@ static long __tun_chr_ioctl(struct fil
        if (cmd == TUNGETFEATURES) {
                /* Currently this just means: "what IFF flags are valid?".
                 * This is needed because we never checked for invalid flags on
 -               * TUNSETIFF. */
 -              return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
 -                              IFF_VNET_HDR | IFF_MULTI_QUEUE,
 +               * TUNSETIFF.
 +               */
 +              return put_user(IFF_TUN | IFF_TAP | TUN_FEATURES,
                                (unsigned int __user*)argp);
        } else if (cmd == TUNSETQUEUE)
                return tun_set_queue(file, &ifr);
                /* Disable/Enable persist mode. Keep an extra reference to the
                 * module to prevent the module being unprobed.
                 */
 -              if (arg && !(tun->flags & TUN_PERSIST)) {
 -                      tun->flags |= TUN_PERSIST;
 +              if (arg && !(tun->flags & IFF_PERSIST)) {
 +                      tun->flags |= IFF_PERSIST;
                        __module_get(THIS_MODULE);
                }
 -              if (!arg && (tun->flags & TUN_PERSIST)) {
 -                      tun->flags &= ~TUN_PERSIST;
 +              if (!arg && (tun->flags & IFF_PERSIST)) {
 +                      tun->flags &= ~IFF_PERSIST;
                        module_put(THIS_MODULE);
                }
  
        case TUNSETTXFILTER:
                /* Can be set only for TAPs */
                ret = -EINVAL;
 -              if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
 +              if ((tun->flags & TUN_TYPE_MASK) != IFF_TAP)
                        break;
                ret = update_filter(&tun->txflt, (void __user *)arg);
                break;
        case TUNATTACHFILTER:
                /* Can be set only for TAPs */
                ret = -EINVAL;
 -              if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
 +              if ((tun->flags & TUN_TYPE_MASK) != IFF_TAP)
                        break;
                ret = -EFAULT;
                if (copy_from_user(&tun->fprog, argp, sizeof(tun->fprog)))
        case TUNDETACHFILTER:
                /* Can be set only for TAPs */
                ret = -EINVAL;
 -              if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
 +              if ((tun->flags & TUN_TYPE_MASK) != IFF_TAP)
                        break;
                ret = 0;
                tun_detach_filter(tun, tun->numqueues);
  
        case TUNGETFILTER:
                ret = -EINVAL;
 -              if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
 +              if ((tun->flags & TUN_TYPE_MASK) != IFF_TAP)
                        break;
                ret = -EFAULT;
                if (copy_to_user(argp, &tun->fprog, sizeof(tun->fprog)))
@@@ -2196,7 -2212,7 +2186,7 @@@ static int tun_chr_close(struct inode *
  }
  
  #ifdef CONFIG_PROC_FS
 -static int tun_chr_show_fdinfo(struct seq_file *m, struct file *f)
 +static void tun_chr_show_fdinfo(struct seq_file *m, struct file *f)
  {
        struct tun_struct *tun;
        struct ifreq ifr;
        if (tun)
                tun_put(tun);
  
 -      return seq_printf(m, "iff:\t%s\n", ifr.ifr_name);
 +      seq_printf(m, "iff:\t%s\n", ifr.ifr_name);
  }
  #endif
  
  static const struct file_operations tun_fops = {
        .owner  = THIS_MODULE,
        .llseek = no_llseek,
-       .read  = do_sync_read,
-       .aio_read  = tun_chr_aio_read,
-       .write = do_sync_write,
-       .aio_write = tun_chr_aio_write,
+       .read  = new_sync_read,
+       .write = new_sync_write,
+       .read_iter  = tun_chr_read_iter,
+       .write_iter = tun_chr_write_iter,
        .poll   = tun_chr_poll,
        .unlocked_ioctl = tun_chr_ioctl,
  #ifdef CONFIG_COMPAT
@@@ -2268,10 -2284,10 +2258,10 @@@ static void tun_get_drvinfo(struct net_
        strlcpy(info->version, DRV_VERSION, sizeof(info->version));
  
        switch (tun->flags & TUN_TYPE_MASK) {
 -      case TUN_TUN_DEV:
 +      case IFF_TUN:
                strlcpy(info->bus_info, "tun", sizeof(info->bus_info));
                break;
 -      case TUN_TAP_DEV:
 +      case IFF_TAP:
                strlcpy(info->bus_info, "tap", sizeof(info->bus_info));
                break;
        }
@@@ -152,6 -152,28 +152,6 @@@ csio_scsi_itnexus_loss_error(uint16_t e
        return 0;
  }
  
 -static inline void
 -csio_scsi_tag(struct scsi_cmnd *scmnd, uint8_t *tag, uint8_t hq,
 -            uint8_t oq, uint8_t sq)
 -{
 -      char stag[2];
 -
 -      if (scsi_populate_tag_msg(scmnd, stag)) {
 -              switch (stag[0]) {
 -              case HEAD_OF_QUEUE_TAG:
 -                      *tag = hq;
 -                      break;
 -              case ORDERED_QUEUE_TAG:
 -                      *tag = oq;
 -                      break;
 -              default:
 -                      *tag = sq;
 -                      break;
 -              }
 -      } else
 -              *tag = 0;
 -}
 -
  /*
   * csio_scsi_fcp_cmnd - Frame the SCSI FCP command paylod.
   * @req: IO req structure.
@@@ -170,12 -192,11 +170,12 @@@ csio_scsi_fcp_cmnd(struct csio_ioreq *r
                int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun);
                fcp_cmnd->fc_tm_flags = 0;
                fcp_cmnd->fc_cmdref = 0;
 -              fcp_cmnd->fc_pri_ta = 0;
  
                memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16);
 -              csio_scsi_tag(scmnd, &fcp_cmnd->fc_pri_ta,
 -                            FCP_PTA_HEADQ, FCP_PTA_ORDERED, FCP_PTA_SIMPLE);
 +              if (scmnd->flags & SCMD_TAGGED)
 +                      fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE;
 +              else
 +                      fcp_cmnd->fc_pri_ta = 0;
                fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd));
  
                if (req->nsge)
@@@ -209,10 -230,10 +209,10 @@@ csio_scsi_init_cmd_wr(struct csio_iore
        struct csio_dma_buf *dma_buf;
        uint8_t imm = csio_hw_to_scsim(hw)->proto_cmd_len;
  
-       wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_SCSI_CMD_WR) |
+       wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_CMD_WR) |
                                          FW_SCSI_CMD_WR_IMMDLEN(imm));
-       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
-                                           FW_WR_LEN16(
+       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) |
+                                           FW_WR_LEN16_V(
                                                DIV_ROUND_UP(size, 16)));
  
        wr->cookie = (uintptr_t) req;
@@@ -301,7 -322,7 +301,7 @@@ csio_scsi_init_ultptx_dsgl(struct csio_
        struct csio_dma_buf *dma_buf;
        struct scsi_cmnd *scmnd = csio_scsi_cmnd(req);
  
-       sgl->cmd_nsge = htonl(ULPTX_CMD(ULP_TX_SC_DSGL) | ULPTX_MORE |
+       sgl->cmd_nsge = htonl(ULPTX_CMD_V(ULP_TX_SC_DSGL) | ULPTX_MORE |
                                     ULPTX_NSGE(req->nsge));
        /* Now add the data SGLs */
        if (likely(!req->dcopy)) {
@@@ -370,10 -391,10 +370,10 @@@ csio_scsi_init_read_wr(struct csio_iore
        uint8_t imm = csio_hw_to_scsim(hw)->proto_cmd_len;
        struct scsi_cmnd *scmnd = csio_scsi_cmnd(req);
  
-       wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_SCSI_READ_WR) |
+       wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_READ_WR) |
                                     FW_SCSI_READ_WR_IMMDLEN(imm));
-       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
-                                      FW_WR_LEN16(DIV_ROUND_UP(size, 16)));
+       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) |
+                                      FW_WR_LEN16_V(DIV_ROUND_UP(size, 16)));
        wr->cookie = (uintptr_t)req;
        wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
        wr->tmo_val = (uint8_t)(req->tmo);
@@@ -423,10 -444,10 +423,10 @@@ csio_scsi_init_write_wr(struct csio_ior
        uint8_t imm = csio_hw_to_scsim(hw)->proto_cmd_len;
        struct scsi_cmnd *scmnd = csio_scsi_cmnd(req);
  
-       wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_SCSI_WRITE_WR) |
+       wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_WRITE_WR) |
                                     FW_SCSI_WRITE_WR_IMMDLEN(imm));
-       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
-                                      FW_WR_LEN16(DIV_ROUND_UP(size, 16)));
+       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) |
+                                      FW_WR_LEN16_V(DIV_ROUND_UP(size, 16)));
        wr->cookie = (uintptr_t)req;
        wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx));
        wr->tmo_val = (uint8_t)(req->tmo);
@@@ -653,9 -674,9 +653,9 @@@ csio_scsi_init_abrt_cls_wr(struct csio_
        struct csio_rnode *rn = req->rnode;
        struct fw_scsi_abrt_cls_wr *wr = (struct fw_scsi_abrt_cls_wr *)addr;
  
-       wr->op_immdlen = cpu_to_be32(FW_WR_OP(FW_SCSI_ABRT_CLS_WR));
-       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID(rn->flowid) |
-                                           FW_WR_LEN16(
+       wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_ABRT_CLS_WR));
+       wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) |
+                                           FW_WR_LEN16_V(
                                                DIV_ROUND_UP(size, 16)));
  
        wr->cookie = (uintptr_t) req;
@@@ -2241,7 -2262,11 +2241,7 @@@ csio_slave_alloc(struct scsi_device *sd
  static int
  csio_slave_configure(struct scsi_device *sdev)
  {
 -      if (sdev->tagged_supported)
 -              scsi_activate_tcq(sdev, csio_lun_qdepth);
 -      else
 -              scsi_deactivate_tcq(sdev, csio_lun_qdepth);
 -
 +      scsi_change_queue_depth(sdev, csio_lun_qdepth);
        return 0;
  }
  
@@@ -2286,7 -2311,6 +2286,7 @@@ struct scsi_host_template csio_fcoe_sho
        .use_clustering         = ENABLE_CLUSTERING,
        .shost_attrs            = csio_fcoe_lport_attrs,
        .max_sectors            = CSIO_MAX_SECTOR_SIZE,
 +      .use_blk_tags           = 1,
  };
  
  struct scsi_host_template csio_fcoe_shost_vport_template = {
        .use_clustering         = ENABLE_CLUSTERING,
        .shost_attrs            = csio_fcoe_vport_attrs,
        .max_sectors            = CSIO_MAX_SECTOR_SIZE,
 +      .use_blk_tags           = 1,
  };
  
  /*
@@@ -89,7 -89,7 +89,7 @@@ static struct scsi_host_template cxgb4i
        .proc_name      = DRV_MODULE_NAME,
        .can_queue      = CXGB4I_SCSI_HOST_QDEPTH,
        .queuecommand   = iscsi_queuecommand,
 -      .change_queue_depth = iscsi_change_queue_depth,
 +      .change_queue_depth = scsi_change_queue_depth,
        .sg_tablesize   = SG_ALL,
        .max_sectors    = 0xFFFF,
        .cmd_per_lun    = ISCSI_DEF_CMD_PER_LUN,
@@@ -99,7 -99,6 +99,7 @@@
        .target_alloc   = iscsi_target_alloc,
        .use_clustering = DISABLE_CLUSTERING,
        .this_id        = -1,
 +      .track_queue_depth = 1,
  };
  
  static struct iscsi_transport cxgb4i_iscsi_transport = {
@@@ -189,18 -188,18 +189,18 @@@ static void send_act_open_req(struct cx
        unsigned int qid_atid = ((unsigned int)csk->atid) |
                                 (((unsigned int)csk->rss_qid) << 14);
  
-       opt0 = KEEP_ALIVE(1) |
-               WND_SCALE(wscale) |
-               MSS_IDX(csk->mss_idx) |
-               L2T_IDX(((struct l2t_entry *)csk->l2t)->idx) |
-               TX_CHAN(csk->tx_chan) |
-               SMAC_SEL(csk->smac_idx) |
-               ULP_MODE(ULP_MODE_ISCSI) |
-               RCV_BUFSIZ(cxgb4i_rcv_win >> 10);
-       opt2 = RX_CHANNEL(0) |
-               RSS_QUEUE_VALID |
-               (1 << 20) |
-               RSS_QUEUE(csk->rss_qid);
+       opt0 = KEEP_ALIVE_F |
+               WND_SCALE_V(wscale) |
+               MSS_IDX_V(csk->mss_idx) |
+               L2T_IDX_V(((struct l2t_entry *)csk->l2t)->idx) |
+               TX_CHAN_V(csk->tx_chan) |
+               SMAC_SEL_V(csk->smac_idx) |
+               ULP_MODE_V(ULP_MODE_ISCSI) |
+               RCV_BUFSIZ_V(cxgb4i_rcv_win >> 10);
+       opt2 = RX_CHANNEL_V(0) |
+               RSS_QUEUE_VALID_F |
+               (RX_FC_DISABLE_F) |
+               RSS_QUEUE_V(csk->rss_qid);
  
        if (is_t4(lldi->adapter_type)) {
                struct cpl_act_open_req *req =
                req->params = cpu_to_be32(cxgb4_select_ntuple(
                                        csk->cdev->ports[csk->port_id],
                                        csk->l2t));
-               opt2 |= 1 << 22;
+               opt2 |= RX_FC_VALID_F;
                req->opt2 = cpu_to_be32(opt2);
  
                log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
                req->local_ip = csk->saddr.sin_addr.s_addr;
                req->peer_ip = csk->daddr.sin_addr.s_addr;
                req->opt0 = cpu_to_be64(opt0);
-               req->params = cpu_to_be64(V_FILTER_TUPLE(
+               req->params = cpu_to_be64(FILTER_TUPLE_V(
                                cxgb4_select_ntuple(
                                        csk->cdev->ports[csk->port_id],
                                        csk->l2t)));
@@@ -272,19 -271,19 +272,19 @@@ static void send_act_open_req6(struct c
        unsigned int qid_atid = ((unsigned int)csk->atid) |
                                 (((unsigned int)csk->rss_qid) << 14);
  
-       opt0 = KEEP_ALIVE(1) |
-               WND_SCALE(wscale) |
-               MSS_IDX(csk->mss_idx) |
-               L2T_IDX(((struct l2t_entry *)csk->l2t)->idx) |
-               TX_CHAN(csk->tx_chan) |
-               SMAC_SEL(csk->smac_idx) |
-               ULP_MODE(ULP_MODE_ISCSI) |
-               RCV_BUFSIZ(cxgb4i_rcv_win >> 10);
+       opt0 = KEEP_ALIVE_F |
+               WND_SCALE_V(wscale) |
+               MSS_IDX_V(csk->mss_idx) |
+               L2T_IDX_V(((struct l2t_entry *)csk->l2t)->idx) |
+               TX_CHAN_V(csk->tx_chan) |
+               SMAC_SEL_V(csk->smac_idx) |
+               ULP_MODE_V(ULP_MODE_ISCSI) |
+               RCV_BUFSIZ_V(cxgb4i_rcv_win >> 10);
  
-       opt2 = RX_CHANNEL(0) |
-               RSS_QUEUE_VALID |
-               RX_FC_DISABLE |
-               RSS_QUEUE(csk->rss_qid);
+       opt2 = RX_CHANNEL_V(0) |
+               RSS_QUEUE_VALID_F |
+               RX_FC_DISABLE_F |
+               RSS_QUEUE_V(csk->rss_qid);
  
        if (t4) {
                struct cpl_act_open_req6 *req =
  
                req->opt0 = cpu_to_be64(opt0);
  
-               opt2 |= RX_FC_VALID;
+               opt2 |= RX_FC_VALID_F;
                req->opt2 = cpu_to_be32(opt2);
  
                req->params = cpu_to_be32(cxgb4_select_ntuple(
                                                                        8);
                req->opt0 = cpu_to_be64(opt0);
  
-               opt2 |= T5_OPT_2_VALID;
+               opt2 |= T5_OPT_2_VALID_F;
                req->opt2 = cpu_to_be32(opt2);
  
-               req->params = cpu_to_be64(V_FILTER_TUPLE(cxgb4_select_ntuple(
+               req->params = cpu_to_be64(FILTER_TUPLE_V(cxgb4_select_ntuple(
                                          csk->cdev->ports[csk->port_id],
                                          csk->l2t)));
        }
@@@ -452,7 -451,8 +452,8 @@@ static u32 send_rx_credits(struct cxgbi
        INIT_TP_WR(req, csk->tid);
        OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_RX_DATA_ACK,
                                      csk->tid));
-       req->credit_dack = cpu_to_be32(RX_CREDITS(credits) | RX_FORCE_ACK(1));
+       req->credit_dack = cpu_to_be32(RX_CREDITS_V(credits)
+                                      | RX_FORCE_ACK_F);
        cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb);
        return credits;
  }
@@@ -500,10 -500,10 +501,10 @@@ static inline void send_tx_flowc_wr(str
        skb = alloc_wr(flowclen, 0, GFP_ATOMIC);
        flowc = (struct fw_flowc_wr *)skb->head;
        flowc->op_to_nparams =
-               htonl(FW_WR_OP(FW_FLOWC_WR) | FW_FLOWC_WR_NPARAMS(8));
+               htonl(FW_WR_OP_V(FW_FLOWC_WR) | FW_FLOWC_WR_NPARAMS_V(8));
        flowc->flowid_len16 =
-               htonl(FW_WR_LEN16(DIV_ROUND_UP(72, 16)) |
-                               FW_WR_FLOWID(csk->tid));
+               htonl(FW_WR_LEN16_V(DIV_ROUND_UP(72, 16)) |
+                               FW_WR_FLOWID_V(csk->tid));
        flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;
        flowc->mnemval[0].val = htonl(csk->cdev->pfvf);
        flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
@@@ -543,30 -543,31 +544,31 @@@ static inline void make_tx_data_wr(stru
  {
        struct fw_ofld_tx_data_wr *req;
        unsigned int submode = cxgbi_skcb_ulp_mode(skb) & 3;
-       unsigned int wr_ulp_mode = 0;
+       unsigned int wr_ulp_mode = 0, val;
  
        req = (struct fw_ofld_tx_data_wr *)__skb_push(skb, sizeof(*req));
  
        if (is_ofld_imm(skb)) {
-               req->op_to_immdlen = htonl(FW_WR_OP(FW_OFLD_TX_DATA_WR) |
-                                       FW_WR_COMPL(1) |
-                                       FW_WR_IMMDLEN(dlen));
-               req->flowid_len16 = htonl(FW_WR_FLOWID(csk->tid) |
-                                               FW_WR_LEN16(credits));
+               req->op_to_immdlen = htonl(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) |
+                                       FW_WR_COMPL_F |
+                                       FW_WR_IMMDLEN_V(dlen));
+               req->flowid_len16 = htonl(FW_WR_FLOWID_V(csk->tid) |
+                                               FW_WR_LEN16_V(credits));
        } else {
                req->op_to_immdlen =
-                       cpu_to_be32(FW_WR_OP(FW_OFLD_TX_DATA_WR) |
-                                       FW_WR_COMPL(1) |
-                                       FW_WR_IMMDLEN(0));
+                       cpu_to_be32(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) |
+                                       FW_WR_COMPL_F |
+                                       FW_WR_IMMDLEN_V(0));
                req->flowid_len16 =
-                       cpu_to_be32(FW_WR_FLOWID(csk->tid) |
-                                       FW_WR_LEN16(credits));
+                       cpu_to_be32(FW_WR_FLOWID_V(csk->tid) |
+                                       FW_WR_LEN16_V(credits));
        }
        if (submode)
-               wr_ulp_mode = FW_OFLD_TX_DATA_WR_ULPMODE(ULP2_MODE_ISCSI) |
-                               FW_OFLD_TX_DATA_WR_ULPSUBMODE(submode);
+               wr_ulp_mode = FW_OFLD_TX_DATA_WR_ULPMODE_V(ULP2_MODE_ISCSI) |
+                               FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(submode);
+       val = skb_peek(&csk->write_queue) ? 0 : 1;
        req->tunnel_to_proxy = htonl(wr_ulp_mode |
-                FW_OFLD_TX_DATA_WR_SHOVE(skb_peek(&csk->write_queue) ? 0 : 1));
+                                    FW_OFLD_TX_DATA_WR_SHOVE_V(val));
        req->plen = htonl(len);
        if (!cxgbi_sock_flag(csk, CTPF_TX_DATA_SENT))
                cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT);
@@@ -1445,16 -1446,16 +1447,16 @@@ static inline void ulp_mem_io_set_hdr(s
  
        INIT_ULPTX_WR(req, wr_len, 0, 0);
        if (is_t4(lldi->adapter_type))
-               req->cmd = htonl(ULPTX_CMD(ULP_TX_MEM_WRITE) |
-                                       (ULP_MEMIO_ORDER(1)));
+               req->cmd = htonl(ULPTX_CMD_V(ULP_TX_MEM_WRITE) |
+                                       (ULP_MEMIO_ORDER_F));
        else
-               req->cmd = htonl(ULPTX_CMD(ULP_TX_MEM_WRITE) |
-                                       (V_T5_ULP_MEMIO_IMM(1)));
-       req->dlen = htonl(ULP_MEMIO_DATA_LEN(dlen >> 5));
-       req->lock_addr = htonl(ULP_MEMIO_ADDR(pm_addr >> 5));
+               req->cmd = htonl(ULPTX_CMD_V(ULP_TX_MEM_WRITE) |
+                                       (T5_ULP_MEMIO_IMM_F));
+       req->dlen = htonl(ULP_MEMIO_DATA_LEN_V(dlen >> 5));
+       req->lock_addr = htonl(ULP_MEMIO_ADDR_V(pm_addr >> 5));
        req->len16 = htonl(DIV_ROUND_UP(wr_len - sizeof(req->wr), 16));
  
-       idata->cmd_more = htonl(ULPTX_CMD(ULP_TX_SC_IMM));
+       idata->cmd_more = htonl(ULPTX_CMD_V(ULP_TX_SC_IMM));
        idata->len = htonl(dlen);
  }
  
@@@ -1678,7 -1679,8 +1680,8 @@@ static void *t4_uld_add(const struct cx
        cdev->skb_rx_extra = sizeof(struct cpl_iscsi_hdr);
        cdev->itp = &cxgb4i_iscsi_transport;
  
-       cdev->pfvf = FW_VIID_PFN_GET(cxgb4_port_viid(lldi->ports[0])) << 8;
+       cdev->pfvf = FW_VIID_PFN_G(cxgb4_port_viid(lldi->ports[0]))
+                       << FW_VIID_PFN_S;
        pr_info("cdev 0x%p,%s, pfvf %u.\n",
                cdev, lldi->ports[0]->name, cdev->pfvf);
  
diff --combined drivers/scsi/fcoe/fcoe.c
@@@ -280,16 -280,14 +280,16 @@@ static struct scsi_host_template fcoe_s
        .eh_device_reset_handler = fc_eh_device_reset,
        .eh_host_reset_handler = fc_eh_host_reset,
        .slave_alloc = fc_slave_alloc,
 -      .change_queue_depth = fc_change_queue_depth,
 -      .change_queue_type = fc_change_queue_type,
 +      .change_queue_depth = scsi_change_queue_depth,
 +      .change_queue_type = scsi_change_queue_type,
        .this_id = -1,
        .cmd_per_lun = 3,
        .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
        .use_clustering = ENABLE_CLUSTERING,
        .sg_tablesize = SG_ALL,
        .max_sectors = 0xffff,
 +      .use_blk_tags = 1,
 +      .track_queue_depth = 1,
  };
  
  /**
@@@ -1671,10 -1669,8 +1671,8 @@@ static int fcoe_xmit(struct fc_lport *l
            fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) {
                /* must set skb->dev before calling vlan_put_tag */
                skb->dev = fcoe->realdev;
-               skb = __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
-                                            vlan_dev_vlan_id(fcoe->netdev));
-               if (!skb)
-                       return -ENOMEM;
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      vlan_dev_vlan_id(fcoe->netdev));
        } else
                skb->dev = fcoe->netdev;
  
diff --combined drivers/vhost/net.c
@@@ -48,21 -48,20 +48,21 @@@ MODULE_PARM_DESC(experimental_zcopytx, 
   * status internally; used for zerocopy tx only.
   */
  /* Lower device DMA failed */
 -#define VHOST_DMA_FAILED_LEN  3
 +#define VHOST_DMA_FAILED_LEN  ((__force __virtio32)3)
  /* Lower device DMA done */
 -#define VHOST_DMA_DONE_LEN    2
 +#define VHOST_DMA_DONE_LEN    ((__force __virtio32)2)
  /* Lower device DMA in progress */
 -#define VHOST_DMA_IN_PROGRESS 1
 +#define VHOST_DMA_IN_PROGRESS ((__force __virtio32)1)
  /* Buffer unused */
 -#define VHOST_DMA_CLEAR_LEN   0
 +#define VHOST_DMA_CLEAR_LEN   ((__force __virtio32)0)
  
 -#define VHOST_DMA_IS_DONE(len) ((len) >= VHOST_DMA_DONE_LEN)
 +#define VHOST_DMA_IS_DONE(len) ((__force u32)(len) >= (__force u32)VHOST_DMA_DONE_LEN)
  
  enum {
        VHOST_NET_FEATURES = VHOST_FEATURES |
                         (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
 -                       (1ULL << VIRTIO_NET_F_MRG_RXBUF),
 +                       (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
 +                       (1ULL << VIRTIO_F_VERSION_1),
  };
  
  enum {
@@@ -343,7 -342,6 +343,6 @@@ static void handle_tx(struct vhost_net 
                .msg_namelen = 0,
                .msg_control = NULL,
                .msg_controllen = 0,
-               .msg_iov = vq->iov,
                .msg_flags = MSG_DONTWAIT,
        };
        size_t len, total_len = 0;
                }
                /* Skip header. TODO: support TSO. */
                s = move_iovec_hdr(vq->iov, nvq->hdr, hdr_size, out);
-               msg.msg_iovlen = out;
                len = iov_length(vq->iov, out);
+               iov_iter_init(&msg.msg_iter, WRITE, vq->iov, out, len);
                /* Sanity check */
                if (!len) {
                        vq_err(vq, "Unexpected header len for TX: "
                        struct ubuf_info *ubuf;
                        ubuf = nvq->ubuf_info + nvq->upend_idx;
  
 -                      vq->heads[nvq->upend_idx].id = head;
 +                      vq->heads[nvq->upend_idx].id = cpu_to_vhost32(vq, head);
                        vq->heads[nvq->upend_idx].len = VHOST_DMA_IN_PROGRESS;
                        ubuf->callback = vhost_zerocopy_callback;
                        ubuf->ctx = nvq->ubufs;
@@@ -501,10 -499,6 +500,10 @@@ static int get_rx_bufs(struct vhost_vir
        int headcount = 0;
        unsigned d;
        int r, nlogs = 0;
 +      /* len is always initialized before use since we are always called with
 +       * datalen > 0.
 +       */
 +      u32 uninitialized_var(len);
  
        while (datalen > 0 && headcount < quota) {
                if (unlikely(seg >= UIO_MAXIOV)) {
                        nlogs += *log_num;
                        log += *log_num;
                }
 -              heads[headcount].id = d;
 -              heads[headcount].len = iov_length(vq->iov + seg, in);
 -              datalen -= heads[headcount].len;
 +              heads[headcount].id = cpu_to_vhost32(vq, d);
 +              len = iov_length(vq->iov + seg, in);
 +              heads[headcount].len = cpu_to_vhost32(vq, len);
 +              datalen -= len;
                ++headcount;
                seg += in;
        }
 -      heads[headcount - 1].len += datalen;
 +      heads[headcount - 1].len = cpu_to_vhost32(vq, len - datalen);
        *iovcount = seg;
        if (unlikely(log))
                *log_num = nlogs;
@@@ -568,7 -561,6 +567,6 @@@ static void handle_rx(struct vhost_net 
                .msg_namelen = 0,
                .msg_control = NULL, /* FIXME: get and handle RX aux data. */
                .msg_controllen = 0,
-               .msg_iov = vq->iov,
                .msg_flags = MSG_DONTWAIT,
        };
        struct virtio_net_hdr_mrg_rxbuf hdr = {
                        break;
                /* On overrun, truncate and discard */
                if (unlikely(headcount > UIO_MAXIOV)) {
-                       msg.msg_iovlen = 1;
+                       iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
                        err = sock->ops->recvmsg(NULL, sock, &msg,
                                                 1, MSG_DONTWAIT | MSG_TRUNC);
                        pr_debug("Discarded rx packet: len %zd\n", sock_len);
                        /* Copy the header for use in VIRTIO_NET_F_MRG_RXBUF:
                         * needed because recvmsg can modify msg_iov. */
                        copy_iovec_hdr(vq->iov, nvq->hdr, sock_hlen, in);
-               msg.msg_iovlen = in;
+               iov_iter_init(&msg.msg_iter, READ, vq->iov, in, sock_len);
                err = sock->ops->recvmsg(NULL, sock, &msg,
                                         sock_len, MSG_DONTWAIT | MSG_TRUNC);
                /* Userspace might have consumed the packet meanwhile:
@@@ -1031,8 -1023,7 +1029,8 @@@ static int vhost_net_set_features(struc
        size_t vhost_hlen, sock_hlen, hdr_len;
        int i;
  
 -      hdr_len = (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ?
 +      hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) |
 +                             (1ULL << VIRTIO_F_VERSION_1))) ?
                        sizeof(struct virtio_net_hdr_mrg_rxbuf) :
                        sizeof(struct virtio_net_hdr);
        if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) {
diff --combined include/net/sock.h
@@@ -54,8 -54,8 +54,8 @@@
  #include <linux/security.h>
  #include <linux/slab.h>
  #include <linux/uaccess.h>
 +#include <linux/page_counter.h>
  #include <linux/memcontrol.h>
 -#include <linux/res_counter.h>
  #include <linux/static_key.h>
  #include <linux/aio.h>
  #include <linux/sched.h>
@@@ -273,6 -273,7 +273,7 @@@ struct cg_proto
    *   @sk_rcvtimeo: %SO_RCVTIMEO setting
    *   @sk_sndtimeo: %SO_SNDTIMEO setting
    *   @sk_rxhash: flow hash received from netif layer
+   *   @sk_incoming_cpu: record cpu processing incoming packets
    *   @sk_txhash: computed flow hash for use on transmit
    *   @sk_filter: socket filtering instructions
    *   @sk_protinfo: private area, net family specific, when not using slab
@@@ -350,6 -351,12 +351,12 @@@ struct sock 
  #ifdef CONFIG_RPS
        __u32                   sk_rxhash;
  #endif
+       u16                     sk_incoming_cpu;
+       /* 16bit hole
+        * Warned : sk_incoming_cpu can be set from softirq,
+        * Do not use this hole without fully understanding possible issues.
+        */
        __u32                   sk_txhash;
  #ifdef CONFIG_NET_RX_BUSY_POLL
        unsigned int            sk_napi_id;
@@@ -833,6 -840,11 +840,11 @@@ static inline int sk_backlog_rcv(struc
        return sk->sk_backlog_rcv(sk, skb);
  }
  
+ static inline void sk_incoming_cpu_update(struct sock *sk)
+ {
+       sk->sk_incoming_cpu = raw_smp_processor_id();
+ }
  static inline void sock_rps_record_flow_hash(__u32 hash)
  {
  #ifdef CONFIG_RPS
@@@ -897,7 -909,6 +909,7 @@@ static inline void sock_rps_reset_rxhas
                if (!__rc) {                                            \
                        *(__timeo) = schedule_timeout(*(__timeo));      \
                }                                                       \
 +              sched_annotate_sleep();                                         \
                lock_sock(__sk);                                        \
                __rc = __condition;                                     \
                __rc;                                                   \
@@@ -1062,7 -1073,7 +1074,7 @@@ enum cg_proto_flags 
  };
  
  struct cg_proto {
 -      struct res_counter      memory_allocated;       /* Current allocated memory. */
 +      struct page_counter     memory_allocated;       /* Current allocated memory. */
        struct percpu_counter   sockets_allocated;      /* Current number of sockets. */
        int                     memory_pressure;
        long                    sysctl_mem[3];
@@@ -1214,26 -1225,34 +1226,26 @@@ static inline void memcg_memory_allocat
                                              unsigned long amt,
                                              int *parent_status)
  {
 -      struct res_counter *fail;
 -      int ret;
 +      page_counter_charge(&prot->memory_allocated, amt);
  
 -      ret = res_counter_charge_nofail(&prot->memory_allocated,
 -                                      amt << PAGE_SHIFT, &fail);
 -      if (ret < 0)
 +      if (page_counter_read(&prot->memory_allocated) >
 +          prot->memory_allocated.limit)
                *parent_status = OVER_LIMIT;
  }
  
  static inline void memcg_memory_allocated_sub(struct cg_proto *prot,
                                              unsigned long amt)
  {
 -      res_counter_uncharge(&prot->memory_allocated, amt << PAGE_SHIFT);
 -}
 -
 -static inline u64 memcg_memory_allocated_read(struct cg_proto *prot)
 -{
 -      u64 ret;
 -      ret = res_counter_read_u64(&prot->memory_allocated, RES_USAGE);
 -      return ret >> PAGE_SHIFT;
 +      page_counter_uncharge(&prot->memory_allocated, amt);
  }
  
  static inline long
  sk_memory_allocated(const struct sock *sk)
  {
        struct proto *prot = sk->sk_prot;
 +
        if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
 -              return memcg_memory_allocated_read(sk->sk_cgrp);
 +              return page_counter_read(&sk->sk_cgrp->memory_allocated);
  
        return atomic_long_read(prot->memory_allocated);
  }
@@@ -1247,7 -1266,7 +1259,7 @@@ sk_memory_allocated_add(struct sock *sk
                memcg_memory_allocated_add(sk->sk_cgrp, amt, parent_status);
                /* update the root cgroup regardless */
                atomic_long_add_return(amt, prot->memory_allocated);
 -              return memcg_memory_allocated_read(sk->sk_cgrp);
 +              return page_counter_read(&sk->sk_cgrp->memory_allocated);
        }
  
        return atomic_long_add_return(amt, prot->memory_allocated);
@@@ -1865,29 -1884,6 +1877,6 @@@ static inline int skb_copy_to_page_noca
        return 0;
  }
  
- static inline int skb_copy_to_page(struct sock *sk, char __user *from,
-                                  struct sk_buff *skb, struct page *page,
-                                  int off, int copy)
- {
-       if (skb->ip_summed == CHECKSUM_NONE) {
-               int err = 0;
-               __wsum csum = csum_and_copy_from_user(from,
-                                                    page_address(page) + off,
-                                                           copy, 0, &err);
-               if (err)
-                       return err;
-               skb->csum = csum_block_add(skb->csum, csum, skb->len);
-       } else if (copy_from_user(page_address(page) + off, from, copy))
-               return -EFAULT;
-       skb->len             += copy;
-       skb->data_len        += copy;
-       skb->truesize        += copy;
-       sk->sk_wmem_queued   += copy;
-       sk_mem_charge(sk, copy);
-       return 0;
- }
  /**
   * sk_wmem_alloc_get - returns write allocations
   * @sk: socket
@@@ -2269,16 -2265,6 +2258,6 @@@ bool sk_ns_capable(const struct sock *s
  bool sk_capable(const struct sock *sk, int cap);
  bool sk_net_capable(const struct sock *sk, int cap);
  
- /*
-  *    Enable debug/info messages
-  */
- extern int net_msg_warn;
- #define NETDEBUG(fmt, args...) \
-       do { if (net_msg_warn) printk(fmt,##args); } while (0)
- #define LIMIT_NETDEBUG(fmt, args...) \
-       do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
  extern __u32 sysctl_wmem_max;
  extern __u32 sysctl_rmem_max;
  
@@@ -37,27 -37,27 +37,27 @@@ header-y += aio_abi.
  header-y += apm_bios.h
  header-y += arcfb.h
  header-y += atalk.h
- header-y += atm.h
- header-y += atm_eni.h
- header-y += atm_he.h
- header-y += atm_idt77105.h
- header-y += atm_nicstar.h
- header-y += atm_tcp.h
- header-y += atm_zatm.h
  header-y += atmapi.h
  header-y += atmarp.h
  header-y += atmbr2684.h
  header-y += atmclip.h
  header-y += atmdev.h
+ header-y += atm_eni.h
+ header-y += atm.h
+ header-y += atm_he.h
+ header-y += atm_idt77105.h
  header-y += atmioc.h
  header-y += atmlec.h
  header-y += atmmpc.h
+ header-y += atm_nicstar.h
  header-y += atmppp.h
  header-y += atmsap.h
  header-y += atmsvc.h
+ header-y += atm_tcp.h
+ header-y += atm_zatm.h
  header-y += audit.h
- header-y += auto_fs.h
  header-y += auto_fs4.h
+ header-y += auto_fs.h
  header-y += auxvec.h
  header-y += ax25.h
  header-y += b1lli.h
@@@ -67,8 -67,8 +67,8 @@@ header-y += bfs_fs.
  header-y += binfmts.h
  header-y += blkpg.h
  header-y += blktrace_api.h
- header-y += bpf.h
  header-y += bpf_common.h
+ header-y += bpf.h
  header-y += bpqether.h
  header-y += bsg.h
  header-y += btrfs.h
@@@ -93,21 -93,21 +93,21 @@@ header-y += cyclades.
  header-y += cycx_cfm.h
  header-y += dcbnl.h
  header-y += dccp.h
- header-y += dlm.h
+ header-y += dlmconstants.h
  header-y += dlm_device.h
+ header-y += dlm.h
  header-y += dlm_netlink.h
  header-y += dlm_plock.h
- header-y += dlmconstants.h
  header-y += dm-ioctl.h
  header-y += dm-log-userspace.h
  header-y += dn.h
  header-y += dqblk_xfs.h
  header-y += edd.h
  header-y += efs_fs_sb.h
+ header-y += elfcore.h
  header-y += elf-em.h
  header-y += elf-fdpic.h
  header-y += elf.h
- header-y += elfcore.h
  header-y += errno.h
  header-y += errqueue.h
  header-y += ethtool.h
@@@ -131,15 -131,15 +131,15 @@@ header-y += fsl_hypervisor.
  header-y += fuse.h
  header-y += futex.h
  header-y += gameport.h
- header-y += gen_stats.h
  header-y += genetlink.h
+ header-y += gen_stats.h
  header-y += gfs2_ondisk.h
  header-y += gigaset_dev.h
- header-y += hdlc.h
  header-y += hdlcdrv.h
+ header-y += hdlc.h
  header-y += hdreg.h
- header-y += hid.h
  header-y += hiddev.h
+ header-y += hid.h
  header-y += hidraw.h
  header-y += hpet.h
  header-y += hsr_netlink.h
@@@ -151,7 -151,6 +151,6 @@@ header-y += i2o-dev.
  header-y += i8k.h
  header-y += icmp.h
  header-y += icmpv6.h
- header-y += if.h
  header-y += if_addr.h
  header-y += if_addrlabel.h
  header-y += if_alg.h
@@@ -165,6 -164,7 +164,7 @@@ header-y += if_ether.
  header-y += if_fc.h
  header-y += if_fddi.h
  header-y += if_frad.h
+ header-y += if.h
  header-y += if_hippi.h
  header-y += if_infiniband.h
  header-y += if_link.h
@@@ -182,40 -182,40 +182,40 @@@ header-y += if_tunnel.
  header-y += if_vlan.h
  header-y += if_x25.h
  header-y += igmp.h
- header-y += in.h
  header-y += in6.h
- header-y += in_route.h
  header-y += inet_diag.h
+ header-y += in.h
  header-y += inotify.h
  header-y += input.h
+ header-y += in_route.h
  header-y += ioctl.h
- header-y += ip.h
  header-y += ip6_tunnel.h
- header-y += ip_vs.h
  header-y += ipc.h
+ header-y += ip.h
  header-y += ipmi.h
  header-y += ipmi_msgdefs.h
  header-y += ipsec.h
  header-y += ipv6.h
  header-y += ipv6_route.h
+ header-y += ip_vs.h
  header-y += ipx.h
  header-y += irda.h
  header-y += irqnr.h
- header-y += isdn.h
  header-y += isdn_divertif.h
- header-y += isdn_ppp.h
+ header-y += isdn.h
  header-y += isdnif.h
+ header-y += isdn_ppp.h
  header-y += iso_fs.h
- header-y += ivtv.h
  header-y += ivtvfb.h
+ header-y += ivtv.h
  header-y += ixjuser.h
  header-y += jffs2.h
  header-y += joystick.h
- header-y += kd.h
  header-y += kdev_t.h
- header-y += kernel-page-flags.h
- header-y += kernel.h
+ header-y += kd.h
  header-y += kernelcapi.h
+ header-y += kernel.h
+ header-y += kernel-page-flags.h
  header-y += kexec.h
  header-y += keyboard.h
  header-y += keyctl.h
@@@ -231,6 -231,7 +231,7 @@@ ifneq ($(wildcard $(srctree)/arch/$(SRC
  header-y += kvm_para.h
  endif
  
+ header-y += hw_breakpoint.h
  header-y += l2tp.h
  header-y += libc-compat.h
  header-y += limits.h
@@@ -243,7 -244,6 +244,7 @@@ header-y += map_to_7segment.
  header-y += matroxfb.h
  header-y += mdio.h
  header-y += media.h
 +header-y += media-bus-format.h
  header-y += mei.h
  header-y += memfd.h
  header-y += mempolicy.h
@@@ -256,43 -256,43 +257,43 @@@ header-y += mman.
  header-y += mmtimer.h
  header-y += mpls.h
  header-y += mqueue.h
- header-y += mroute.h
  header-y += mroute6.h
+ header-y += mroute.h
  header-y += msdos_fs.h
  header-y += msg.h
  header-y += mtio.h
- header-y += n_r3964.h
  header-y += nbd.h
- header-y += ncp.h
  header-y += ncp_fs.h
+ header-y += ncp.h
  header-y += ncp_mount.h
  header-y += ncp_no.h
  header-y += neighbour.h
- header-y += net.h
- header-y += net_dropmon.h
- header-y += net_tstamp.h
  header-y += netconf.h
  header-y += netdevice.h
- header-y += netlink_diag.h
- header-y += netfilter.h
+ header-y += net_dropmon.h
  header-y += netfilter_arp.h
  header-y += netfilter_bridge.h
  header-y += netfilter_decnet.h
+ header-y += netfilter.h
  header-y += netfilter_ipv4.h
  header-y += netfilter_ipv6.h
+ header-y += net.h
+ header-y += netlink_diag.h
  header-y += netlink.h
  header-y += netrom.h
+ header-y += net_tstamp.h
  header-y += nfc.h
- header-y += nfs.h
  header-y += nfs2.h
  header-y += nfs3.h
  header-y += nfs4.h
  header-y += nfs4_mount.h
+ header-y += nfsacl.h
  header-y += nfs_fs.h
+ header-y += nfs.h
  header-y += nfs_idmap.h
  header-y += nfs_mount.h
- header-y += nfsacl.h
  header-y += nl80211.h
+ header-y += n_r3964.h
  header-y += nubus.h
  header-y += nvme.h
  header-y += nvram.h
@@@ -312,16 -312,16 +313,16 @@@ header-y += pfkeyv2.
  header-y += pg.h
  header-y += phantom.h
  header-y += phonet.h
+ header-y += pktcdvd.h
  header-y += pkt_cls.h
  header-y += pkt_sched.h
- header-y += pktcdvd.h
  header-y += pmu.h
  header-y += poll.h
  header-y += posix_types.h
  header-y += ppdev.h
  header-y += ppp-comp.h
- header-y += ppp-ioctl.h
  header-y += ppp_defs.h
+ header-y += ppp-ioctl.h
  header-y += pps.h
  header-y += prctl.h
  header-y += psci.h
@@@ -353,13 -353,13 +354,13 @@@ header-y += seccomp.
  header-y += securebits.h
  header-y += selinux_netlink.h
  header-y += sem.h
- header-y += serial.h
  header-y += serial_core.h
+ header-y += serial.h
  header-y += serial_reg.h
  header-y += serio.h
  header-y += shm.h
- header-y += signal.h
  header-y += signalfd.h
+ header-y += signal.h
  header-y += smiapp.h
  header-y += snmp.h
  header-y += sock_diag.h
@@@ -368,8 -368,8 +369,8 @@@ header-y += sockios.
  header-y += som.h
  header-y += sonet.h
  header-y += sonypi.h
- header-y += sound.h
  header-y += soundcard.h
+ header-y += sound.h
  header-y += stat.h
  header-y += stddef.h
  header-y += string.h
@@@ -388,11 -388,12 +389,12 @@@ header-y += time.
  header-y += times.h
  header-y += timex.h
  header-y += tiocl.h
- header-y += tipc.h
  header-y += tipc_config.h
+ header-y += tipc_netlink.h
+ header-y += tipc.h
  header-y += toshiba.h
- header-y += tty.h
  header-y += tty_flags.h
+ header-y += tty.h
  header-y += types.h
  header-y += udf_fs_i.h
  header-y += udp.h
@@@ -424,12 -425,10 +426,12 @@@ header-y += virtio_blk.
  header-y += virtio_config.h
  header-y += virtio_console.h
  header-y += virtio_ids.h
- header-y += virtio_types.h
  header-y += virtio_net.h
  header-y += virtio_pci.h
  header-y += virtio_ring.h
  header-y += virtio_rng.h
 +header-y += virtio_scsi.h
++header-y += virtio_types.h
  header-y += vm_sockets.h
  header-y += vt.h
  header-y += wait.h
@@@ -440,6 -439,5 +442,5 @@@ header-y += wireless.
  header-y += x25.h
  header-y += xattr.h
  header-y += xfrm.h
- header-y += hw_breakpoint.h
  header-y += zorro.h
  header-y += zorro_ids.h
diff --combined lib/Makefile
@@@ -13,7 -13,7 +13,7 @@@ lib-y := ctype.o string.o vsprintf.o cm
         sha1.o md5.o irq_regs.o argv_split.o \
         proportions.o flex_proportions.o ratelimit.o show_mem.o \
         is_single_threaded.o plist.o decompress.o kobject_uevent.o \
 -       earlycpio.o
 +       earlycpio.o seq_buf.o
  
  obj-$(CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS) += usercopy.o
  lib-$(CONFIG_MMU) += ioremap.o
@@@ -26,7 -26,7 +26,7 @@@ obj-y += bcd.o div64.o sort.o parser.o 
         bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
         gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \
         bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \
-        percpu-refcount.o percpu_ida.o hash.o rhashtable.o reciprocal_div.o
+        percpu-refcount.o percpu_ida.o rhashtable.o reciprocal_div.o
  obj-y += string_helpers.o
  obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
  obj-y += kstrtox.o
@@@ -78,8 -78,10 +78,10 @@@ static struct rfcomm_session *rfcomm_se
  #define __get_type(b)     ((b & 0xef))
  
  #define __test_ea(b)      ((b & 0x01))
- #define __test_cr(b)      ((b & 0x02))
- #define __test_pf(b)      ((b & 0x10))
+ #define __test_cr(b)      (!!(b & 0x02))
+ #define __test_pf(b)      (!!(b & 0x10))
+ #define __session_dir(s)  ((s)->initiator ? 0x00 : 0x01)
  
  #define __addr(cr, dlci)       (((dlci & 0x3f) << 2) | (cr << 1) | 0x01)
  #define __ctrl(type, pf)       (((type & 0xef) | (pf << 4)))
  #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1)
  #define __get_rpn_parity(line)    (((line) >> 3) & 0x7)
  
 +static DECLARE_WAIT_QUEUE_HEAD(rfcomm_wq);
 +
  static void rfcomm_schedule(void)
  {
 -      if (!rfcomm_thread)
 -              return;
 -      wake_up_process(rfcomm_thread);
 +      wake_up_all(&rfcomm_wq);
  }
  
  /* ---- RFCOMM FCS computation ---- */
@@@ -388,7 -390,7 +390,7 @@@ static int __rfcomm_dlc_open(struct rfc
                        return err;
        }
  
-       dlci = __dlci(!s->initiator, channel);
+       dlci = __dlci(__session_dir(s), channel);
  
        /* Check if DLCI already exists */
        if (rfcomm_dlc_get(s, dlci))
@@@ -543,7 -545,7 +545,7 @@@ struct rfcomm_dlc *rfcomm_dlc_exists(bd
        rfcomm_lock();
        s = rfcomm_session_get(src, dst);
        if (s) {
-               dlci = __dlci(!s->initiator, channel);
+               dlci = __dlci(__session_dir(s), channel);
                dlc = rfcomm_dlc_get(s, dlci);
        }
        rfcomm_unlock();
@@@ -904,7 -906,7 +906,7 @@@ static int rfcomm_send_nsc(struct rfcom
        hdr->len  = __len8(sizeof(*mcc) + 1);
  
        mcc = (void *) ptr; ptr += sizeof(*mcc);
-       mcc->type = __mcc_type(cr, RFCOMM_NSC);
+       mcc->type = __mcc_type(0, RFCOMM_NSC);
        mcc->len  = __len8(1);
  
        /* Type that we didn't like */
@@@ -2086,22 -2088,24 +2088,22 @@@ static void rfcomm_kill_listener(void
  
  static int rfcomm_run(void *unused)
  {
 +      DEFINE_WAIT_FUNC(wait, woken_wake_function);
        BT_DBG("");
  
        set_user_nice(current, -10);
  
        rfcomm_add_listener(BDADDR_ANY);
  
 -      while (1) {
 -              set_current_state(TASK_INTERRUPTIBLE);
 -
 -              if (kthread_should_stop())
 -                      break;
 +      add_wait_queue(&rfcomm_wq, &wait);
 +      while (!kthread_should_stop()) {
  
                /* Process stuff */
                rfcomm_process_sessions();
  
 -              schedule();
 +              wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
        }
 -      __set_current_state(TASK_RUNNING);
 +      remove_wait_queue(&rfcomm_wq, &wait);
  
        rfcomm_kill_listener();
  
diff --combined net/core/dev.c
  #include <linux/if_vlan.h>
  #include <linux/ip.h>
  #include <net/ip.h>
+ #include <net/mpls.h>
  #include <linux/ipv6.h>
  #include <linux/in.h>
  #include <linux/jhash.h>
  #include <linux/vmalloc.h>
  #include <linux/if_macvlan.h>
  #include <linux/errqueue.h>
+ #include <linux/hrtimer.h>
  
  #include "net-sysfs.h"
  
@@@ -1435,22 -1437,17 +1437,17 @@@ EXPORT_SYMBOL(dev_close)
   */
  void dev_disable_lro(struct net_device *dev)
  {
-       /*
-        * If we're trying to disable lro on a vlan device
-        * use the underlying physical device instead
-        */
-       if (is_vlan_dev(dev))
-               dev = vlan_dev_real_dev(dev);
-       /* the same for macvlan devices */
-       if (netif_is_macvlan(dev))
-               dev = macvlan_dev_real_dev(dev);
+       struct net_device *lower_dev;
+       struct list_head *iter;
  
        dev->wanted_features &= ~NETIF_F_LRO;
        netdev_update_features(dev);
  
        if (unlikely(dev->features & NETIF_F_LRO))
                netdev_WARN(dev, "failed to disable LRO!\n");
+       netdev_for_each_lower_dev(dev, lower_dev, iter)
+               dev_disable_lro(lower_dev);
  }
  EXPORT_SYMBOL(dev_disable_lro);
  
@@@ -2530,7 -2527,7 +2527,7 @@@ static netdev_features_t net_mpls_featu
                                           netdev_features_t features,
                                           __be16 type)
  {
-       if (type == htons(ETH_P_MPLS_UC) || type == htons(ETH_P_MPLS_MC))
+       if (eth_p_mpls(type))
                features &= skb->dev->mpls_features;
  
        return features;
@@@ -2647,12 -2644,8 +2644,8 @@@ static struct sk_buff *validate_xmit_vl
                                          netdev_features_t features)
  {
        if (vlan_tx_tag_present(skb) &&
-           !vlan_hw_offload_capable(features, skb->vlan_proto)) {
-               skb = __vlan_put_tag(skb, skb->vlan_proto,
-                                    vlan_tx_tag_get(skb));
-               if (skb)
-                       skb->vlan_tci = 0;
-       }
+           !vlan_hw_offload_capable(features, skb->vlan_proto))
+               skb = __vlan_hwaccel_push_inside(skb);
        return skb;
  }
  
@@@ -3304,7 -3297,7 +3297,7 @@@ static int enqueue_to_backlog(struct sk
        rps_lock(sd);
        qlen = skb_queue_len(&sd->input_pkt_queue);
        if (qlen <= netdev_max_backlog && !skb_flow_limit(skb, qlen)) {
-               if (skb_queue_len(&sd->input_pkt_queue)) {
+               if (qlen) {
  enqueue:
                        __skb_queue_tail(&sd->input_pkt_queue, skb);
                        input_queue_tail_incr_save(sd, qtail);
@@@ -4179,7 -4172,7 +4172,7 @@@ struct sk_buff *napi_get_frags(struct n
        struct sk_buff *skb = napi->skb;
  
        if (!skb) {
-               skb = netdev_alloc_skb_ip_align(napi->dev, GRO_MAX_HEAD);
+               skb = napi_alloc_skb(napi, GRO_MAX_HEAD);
                napi->skb = skb;
        }
        return skb;
@@@ -4316,20 -4309,28 +4309,28 @@@ static void net_rps_action_and_irq_enab
                local_irq_enable();
  }
  
+ static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
+ {
+ #ifdef CONFIG_RPS
+       return sd->rps_ipi_list != NULL;
+ #else
+       return false;
+ #endif
+ }
  static int process_backlog(struct napi_struct *napi, int quota)
  {
        int work = 0;
        struct softnet_data *sd = container_of(napi, struct softnet_data, backlog);
  
- #ifdef CONFIG_RPS
        /* Check if we have pending ipi, its better to send them now,
         * not waiting net_rx_action() end.
         */
-       if (sd->rps_ipi_list) {
+       if (sd_has_rps_ipi_waiting(sd)) {
                local_irq_disable();
                net_rps_action_and_irq_enable(sd);
        }
- #endif
        napi->weight = weight_p;
        local_irq_disable();
        while (1) {
                         * We can use a plain write instead of clear_bit(),
                         * and we dont need an smp_mb() memory barrier.
                         */
-                       list_del(&napi->poll_list);
                        napi->state = 0;
                        rps_unlock(sd);
  
   * __napi_schedule - schedule for receive
   * @n: entry to schedule
   *
-  * The entry's receive function will be scheduled to run
+  * The entry's receive function will be scheduled to run.
+  * Consider using __napi_schedule_irqoff() if hard irqs are masked.
   */
  void __napi_schedule(struct napi_struct *n)
  {
  }
  EXPORT_SYMBOL(__napi_schedule);
  
+ /**
+  * __napi_schedule_irqoff - schedule for receive
+  * @n: entry to schedule
+  *
+  * Variant of __napi_schedule() assuming hard irqs are masked
+  */
+ void __napi_schedule_irqoff(struct napi_struct *n)
+ {
+       ____napi_schedule(this_cpu_ptr(&softnet_data), n);
+ }
+ EXPORT_SYMBOL(__napi_schedule_irqoff);
  void __napi_complete(struct napi_struct *n)
  {
        BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state));
-       BUG_ON(n->gro_list);
  
-       list_del(&n->poll_list);
+       list_del_init(&n->poll_list);
        smp_mb__before_atomic();
        clear_bit(NAPI_STATE_SCHED, &n->state);
  }
  EXPORT_SYMBOL(__napi_complete);
  
- void napi_complete(struct napi_struct *n)
+ void napi_complete_done(struct napi_struct *n, int work_done)
  {
        unsigned long flags;
  
        if (unlikely(test_bit(NAPI_STATE_NPSVC, &n->state)))
                return;
  
-       napi_gro_flush(n, false);
-       local_irq_save(flags);
-       __napi_complete(n);
-       local_irq_restore(flags);
+       if (n->gro_list) {
+               unsigned long timeout = 0;
+               if (work_done)
+                       timeout = n->dev->gro_flush_timeout;
+               if (timeout)
+                       hrtimer_start(&n->timer, ns_to_ktime(timeout),
+                                     HRTIMER_MODE_REL_PINNED);
+               else
+                       napi_gro_flush(n, false);
+       }
+       if (likely(list_empty(&n->poll_list))) {
+               WARN_ON_ONCE(!test_and_clear_bit(NAPI_STATE_SCHED, &n->state));
+       } else {
+               /* If n->poll_list is not empty, we need to mask irqs */
+               local_irq_save(flags);
+               __napi_complete(n);
+               local_irq_restore(flags);
+       }
  }
- EXPORT_SYMBOL(napi_complete);
+ EXPORT_SYMBOL(napi_complete_done);
  
  /* must be called under rcu_read_lock(), as we dont take a reference */
  struct napi_struct *napi_by_id(unsigned int napi_id)
@@@ -4469,10 -4497,23 +4497,23 @@@ void napi_hash_del(struct napi_struct *
  }
  EXPORT_SYMBOL_GPL(napi_hash_del);
  
+ static enum hrtimer_restart napi_watchdog(struct hrtimer *timer)
+ {
+       struct napi_struct *napi;
+       napi = container_of(timer, struct napi_struct, timer);
+       if (napi->gro_list)
+               napi_schedule(napi);
+       return HRTIMER_NORESTART;
+ }
  void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
                    int (*poll)(struct napi_struct *, int), int weight)
  {
        INIT_LIST_HEAD(&napi->poll_list);
+       hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
+       napi->timer.function = napi_watchdog;
        napi->gro_count = 0;
        napi->gro_list = NULL;
        napi->skb = NULL;
  }
  EXPORT_SYMBOL(netif_napi_add);
  
+ void napi_disable(struct napi_struct *n)
+ {
+       might_sleep();
+       set_bit(NAPI_STATE_DISABLE, &n->state);
+       while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
+               msleep(1);
+       hrtimer_cancel(&n->timer);
+       clear_bit(NAPI_STATE_DISABLE, &n->state);
+ }
+ EXPORT_SYMBOL(napi_disable);
  void netif_napi_del(struct napi_struct *napi)
  {
        list_del_init(&napi->dev_list);
@@@ -4507,29 -4562,28 +4562,28 @@@ static void net_rx_action(struct softir
        struct softnet_data *sd = this_cpu_ptr(&softnet_data);
        unsigned long time_limit = jiffies + 2;
        int budget = netdev_budget;
+       LIST_HEAD(list);
+       LIST_HEAD(repoll);
        void *have;
  
        local_irq_disable();
+       list_splice_init(&sd->poll_list, &list);
+       local_irq_enable();
  
-       while (!list_empty(&sd->poll_list)) {
+       while (!list_empty(&list)) {
                struct napi_struct *n;
                int work, weight;
  
-               /* If softirq window is exhuasted then punt.
+               /* If softirq window is exhausted then punt.
                 * Allow this to run for 2 jiffies since which will allow
                 * an average latency of 1.5/HZ.
                 */
                if (unlikely(budget <= 0 || time_after_eq(jiffies, time_limit)))
                        goto softnet_break;
  
-               local_irq_enable();
  
-               /* Even though interrupts have been re-enabled, this
-                * access is safe because interrupts can only add new
-                * entries to the tail of this list, and only ->poll()
-                * calls can remove this head entry from the list.
-                */
-               n = list_first_entry(&sd->poll_list, struct napi_struct, poll_list);
+               n = list_first_entry(&list, struct napi_struct, poll_list);
+               list_del_init(&n->poll_list);
  
                have = netpoll_poll_lock(n);
  
  
                budget -= work;
  
-               local_irq_disable();
                /* Drivers must not modify the NAPI state if they
                 * consume the entire weight.  In such cases this code
                 * still "owns" the NAPI instance and therefore can
                 */
                if (unlikely(work == weight)) {
                        if (unlikely(napi_disable_pending(n))) {
-                               local_irq_enable();
                                napi_complete(n);
-                               local_irq_disable();
                        } else {
                                if (n->gro_list) {
                                        /* flush too old packets
                                         * If HZ < 1000, flush all packets.
                                         */
-                                       local_irq_enable();
                                        napi_gro_flush(n, HZ >= 1000);
-                                       local_irq_disable();
                                }
-                               list_move_tail(&n->poll_list, &sd->poll_list);
+                               list_add_tail(&n->poll_list, &repoll);
                        }
                }
  
                netpoll_poll_unlock(have);
        }
+       if (!sd_has_rps_ipi_waiting(sd) &&
+           list_empty(&list) &&
+           list_empty(&repoll))
+               return;
  out:
+       local_irq_disable();
+       list_splice_tail_init(&sd->poll_list, &list);
+       list_splice_tail(&repoll, &list);
+       list_splice(&list, &sd->poll_list);
+       if (!list_empty(&sd->poll_list))
+               __raise_softirq_irqoff(NET_RX_SOFTIRQ);
        net_rps_action_and_irq_enable(sd);
  
        return;
  
  softnet_break:
        sd->time_squeeze++;
-       __raise_softirq_irqoff(NET_RX_SOFTIRQ);
        goto out;
  }
  
@@@ -5786,7 -5846,7 +5846,7 @@@ EXPORT_SYMBOL(dev_change_carrier)
   *    Get device physical port ID
   */
  int dev_get_phys_port_id(struct net_device *dev,
-                        struct netdev_phys_port_id *ppid)
+                        struct netdev_phys_item_id *ppid)
  {
        const struct net_device_ops *ops = dev->netdev_ops;
  
@@@ -5865,6 -5925,8 +5925,8 @@@ static void rollback_registered_many(st
        synchronize_net();
  
        list_for_each_entry(dev, head, unreg_list) {
+               struct sk_buff *skb = NULL;
                /* Shutdown queueing discipline. */
                dev_shutdown(dev);
  
                */
                call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
  
+               if (!dev->rtnl_link_ops ||
+                   dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
+                       skb = rtmsg_ifinfo_build_skb(RTM_DELLINK, dev, ~0U,
+                                                    GFP_KERNEL);
                /*
                 *      Flush the unicast and multicast chains
                 */
                if (dev->netdev_ops->ndo_uninit)
                        dev->netdev_ops->ndo_uninit(dev);
  
-               if (!dev->rtnl_link_ops ||
-                   dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
-                       rtmsg_ifinfo(RTM_DELLINK, dev, ~0U, GFP_KERNEL);
+               if (skb)
+                       rtmsg_ifinfo_send(skb, dev, GFP_KERNEL);
  
                /* Notifier chain MUST detach us all upper devices. */
                WARN_ON(netdev_has_any_upper_dev(dev));
@@@ -7200,10 -7266,11 +7266,10 @@@ static void __net_exit rtnl_lock_unregi
         */
        struct net *net;
        bool unregistering;
 -      DEFINE_WAIT(wait);
 +      DEFINE_WAIT_FUNC(wait, woken_wake_function);
  
 +      add_wait_queue(&netdev_unregistering_wq, &wait);
        for (;;) {
 -              prepare_to_wait(&netdev_unregistering_wq, &wait,
 -                              TASK_UNINTERRUPTIBLE);
                unregistering = false;
                rtnl_lock();
                list_for_each_entry(net, net_list, exit_list) {
                if (!unregistering)
                        break;
                __rtnl_unlock();
 -              schedule();
 +
 +              wait_woken(&wait, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
        }
 -      finish_wait(&netdev_unregistering_wq, &wait);
 +      remove_wait_queue(&netdev_unregistering_wq, &wait);
  }
  
  static void __net_exit default_device_exit_batch(struct list_head *net_list)
diff --combined net/core/rtnetlink.c
@@@ -36,6 -36,7 +36,7 @@@
  #include <linux/mutex.h>
  #include <linux/if_addr.h>
  #include <linux/if_bridge.h>
+ #include <linux/if_vlan.h>
  #include <linux/pci.h>
  #include <linux/etherdevice.h>
  
@@@ -43,6 -44,7 +44,7 @@@
  
  #include <linux/inet.h>
  #include <linux/netdevice.h>
+ #include <net/switchdev.h>
  #include <net/ip.h>
  #include <net/protocol.h>
  #include <net/arp.h>
@@@ -365,10 -367,11 +367,10 @@@ static void rtnl_lock_unregistering_all
  {
        struct net *net;
        bool unregistering;
 -      DEFINE_WAIT(wait);
 +      DEFINE_WAIT_FUNC(wait, woken_wake_function);
  
 +      add_wait_queue(&netdev_unregistering_wq, &wait);
        for (;;) {
 -              prepare_to_wait(&netdev_unregistering_wq, &wait,
 -                              TASK_UNINTERRUPTIBLE);
                unregistering = false;
                rtnl_lock();
                for_each_net(net) {
                if (!unregistering)
                        break;
                __rtnl_unlock();
 -              schedule();
 +
 +              wait_woken(&wait, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
        }
 -      finish_wait(&netdev_unregistering_wq, &wait);
 +      remove_wait_queue(&netdev_unregistering_wq, &wait);
  }
  
  /**
@@@ -868,7 -870,8 +870,8 @@@ static noinline size_t if_nlmsg_size(co
               + rtnl_port_size(dev, ext_filter_mask) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
               + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
               + rtnl_link_get_af_size(dev) /* IFLA_AF_SPEC */
-              + nla_total_size(MAX_PHYS_PORT_ID_LEN); /* IFLA_PHYS_PORT_ID */
+              + nla_total_size(MAX_PHYS_ITEM_ID_LEN) /* IFLA_PHYS_PORT_ID */
+              + nla_total_size(MAX_PHYS_ITEM_ID_LEN); /* IFLA_PHYS_SWITCH_ID */
  }
  
  static int rtnl_vf_ports_fill(struct sk_buff *skb, struct net_device *dev)
@@@ -952,7 -955,7 +955,7 @@@ static int rtnl_port_fill(struct sk_buf
  static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)
  {
        int err;
-       struct netdev_phys_port_id ppid;
+       struct netdev_phys_item_id ppid;
  
        err = dev_get_phys_port_id(dev, &ppid);
        if (err) {
        return 0;
  }
  
+ static int rtnl_phys_switch_id_fill(struct sk_buff *skb, struct net_device *dev)
+ {
+       int err;
+       struct netdev_phys_item_id psid;
+       err = netdev_switch_parent_id_get(dev, &psid);
+       if (err) {
+               if (err == -EOPNOTSUPP)
+                       return 0;
+               return err;
+       }
+       if (nla_put(skb, IFLA_PHYS_SWITCH_ID, psid.id_len, psid.id))
+               return -EMSGSIZE;
+       return 0;
+ }
  static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
                            int type, u32 pid, u32 seq, u32 change,
                            unsigned int flags, u32 ext_filter_mask)
        if (rtnl_phys_port_id_fill(skb, dev))
                goto nla_put_failure;
  
+       if (rtnl_phys_switch_id_fill(skb, dev))
+               goto nla_put_failure;
        attr = nla_reserve(skb, IFLA_STATS,
                        sizeof(struct rtnl_link_stats));
        if (attr == NULL)
@@@ -1196,8 -1220,9 +1220,9 @@@ static const struct nla_policy ifla_pol
        [IFLA_PROMISCUITY]      = { .type = NLA_U32 },
        [IFLA_NUM_TX_QUEUES]    = { .type = NLA_U32 },
        [IFLA_NUM_RX_QUEUES]    = { .type = NLA_U32 },
-       [IFLA_PHYS_PORT_ID]     = { .type = NLA_BINARY, .len = MAX_PHYS_PORT_ID_LEN },
+       [IFLA_PHYS_PORT_ID]     = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN },
        [IFLA_CARRIER_CHANGES]  = { .type = NLA_U32 },  /* ignored */
+       [IFLA_PHYS_SWITCH_ID]   = { .type = NLA_BINARY, .len = MAX_PHYS_ITEM_ID_LEN },
  };
  
  static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
@@@ -2221,8 -2246,8 +2246,8 @@@ static int rtnl_dump_all(struct sk_buf
        return skb->len;
  }
  
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned int change,
-                 gfp_t flags)
struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
+                                      unsigned int change, gfp_t flags)
  {
        struct net *net = dev_net(dev);
        struct sk_buff *skb;
                kfree_skb(skb);
                goto errout;
        }
-       rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, flags);
-       return;
+       return skb;
  errout:
        if (err < 0)
                rtnl_set_sk_err(net, RTNLGRP_LINK, err);
+       return NULL;
+ }
+ void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev, gfp_t flags)
+ {
+       struct net *net = dev_net(dev);
+       rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, flags);
+ }
+ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned int change,
+                 gfp_t flags)
+ {
+       struct sk_buff *skb;
+       skb = rtmsg_ifinfo_build_skb(type, dev, change, flags);
+       if (skb)
+               rtmsg_ifinfo_send(skb, dev, flags);
  }
  EXPORT_SYMBOL(rtmsg_ifinfo);
  
@@@ -2313,7 -2355,7 +2355,7 @@@ errout
  int ndo_dflt_fdb_add(struct ndmsg *ndm,
                     struct nlattr *tb[],
                     struct net_device *dev,
-                    const unsigned char *addr,
+                    const unsigned char *addr, u16 vid,
                     u16 flags)
  {
        int err = -EINVAL;
  }
  EXPORT_SYMBOL(ndo_dflt_fdb_add);
  
+ static int fdb_vid_parse(struct nlattr *vlan_attr, u16 *p_vid)
+ {
+       u16 vid = 0;
+       if (vlan_attr) {
+               if (nla_len(vlan_attr) != sizeof(u16)) {
+                       pr_info("PF_BRIDGE: RTM_NEWNEIGH with invalid vlan\n");
+                       return -EINVAL;
+               }
+               vid = nla_get_u16(vlan_attr);
+               if (!vid || vid >= VLAN_VID_MASK) {
+                       pr_info("PF_BRIDGE: RTM_NEWNEIGH with invalid vlan id %d\n",
+                               vid);
+                       return -EINVAL;
+               }
+       }
+       *p_vid = vid;
+       return 0;
+ }
  static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
  {
        struct net *net = sock_net(skb->sk);
        struct nlattr *tb[NDA_MAX+1];
        struct net_device *dev;
        u8 *addr;
+       u16 vid;
        int err;
  
        err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL);
  
        addr = nla_data(tb[NDA_LLADDR]);
  
+       err = fdb_vid_parse(tb[NDA_VLAN], &vid);
+       if (err)
+               return err;
        err = -EOPNOTSUPP;
  
        /* Support fdb on master device the net/bridge default case */
                struct net_device *br_dev = netdev_master_upper_dev_get(dev);
                const struct net_device_ops *ops = br_dev->netdev_ops;
  
-               err = ops->ndo_fdb_add(ndm, tb, dev, addr, nlh->nlmsg_flags);
+               err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid,
+                                      nlh->nlmsg_flags);
                if (err)
                        goto out;
                else
        if ((ndm->ndm_flags & NTF_SELF)) {
                if (dev->netdev_ops->ndo_fdb_add)
                        err = dev->netdev_ops->ndo_fdb_add(ndm, tb, dev, addr,
+                                                          vid,
                                                           nlh->nlmsg_flags);
                else
-                       err = ndo_dflt_fdb_add(ndm, tb, dev, addr,
+                       err = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid,
                                               nlh->nlmsg_flags);
  
                if (!err) {
@@@ -2410,7 -2481,7 +2481,7 @@@ out
  int ndo_dflt_fdb_del(struct ndmsg *ndm,
                     struct nlattr *tb[],
                     struct net_device *dev,
-                    const unsigned char *addr)
+                    const unsigned char *addr, u16 vid)
  {
        int err = -EINVAL;
  
@@@ -2439,6 -2510,7 +2510,7 @@@ static int rtnl_fdb_del(struct sk_buff 
        struct net_device *dev;
        int err = -EINVAL;
        __u8 *addr;
+       u16 vid;
  
        if (!netlink_capable(skb, CAP_NET_ADMIN))
                return -EPERM;
  
        addr = nla_data(tb[NDA_LLADDR]);
  
+       err = fdb_vid_parse(tb[NDA_VLAN], &vid);
+       if (err)
+               return err;
        err = -EOPNOTSUPP;
  
        /* Support fdb on master device the net/bridge default case */
                const struct net_device_ops *ops = br_dev->netdev_ops;
  
                if (ops->ndo_fdb_del)
-                       err = ops->ndo_fdb_del(ndm, tb, dev, addr);
+                       err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid);
  
                if (err)
                        goto out;
        /* Embedded bridge, macvlan, and any other device support */
        if (ndm->ndm_flags & NTF_SELF) {
                if (dev->netdev_ops->ndo_fdb_del)
-                       err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr);
+                       err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr,
+                                                          vid);
                else
-                       err = ndo_dflt_fdb_del(ndm, tb, dev, addr);
+                       err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid);
  
                if (!err) {
                        rtnl_fdb_notify(dev, addr, RTM_DELNEIGH);
@@@ -2628,12 -2705,22 +2705,22 @@@ static int rtnl_fdb_dump(struct sk_buf
        return skb->len;
  }
  
+ static int brport_nla_put_flag(struct sk_buff *skb, u32 flags, u32 mask,
+                              unsigned int attrnum, unsigned int flag)
+ {
+       if (mask & flag)
+               return nla_put_u8(skb, attrnum, !!(flags & flag));
+       return 0;
+ }
  int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
-                           struct net_device *dev, u16 mode)
+                           struct net_device *dev, u16 mode,
+                           u32 flags, u32 mask)
  {
        struct nlmsghdr *nlh;
        struct ifinfomsg *ifm;
        struct nlattr *br_afspec;
+       struct nlattr *protinfo;
        u8 operstate = netif_running(dev) ? dev->operstate : IF_OPER_DOWN;
        struct net_device *br_dev = netdev_master_upper_dev_get(dev);
  
        if (!br_afspec)
                goto nla_put_failure;
  
-       if (nla_put_u16(skb, IFLA_BRIDGE_FLAGS, BRIDGE_FLAGS_SELF) ||
-           nla_put_u16(skb, IFLA_BRIDGE_MODE, mode)) {
+       if (nla_put_u16(skb, IFLA_BRIDGE_FLAGS, BRIDGE_FLAGS_SELF)) {
                nla_nest_cancel(skb, br_afspec);
                goto nla_put_failure;
        }
+       if (mode != BRIDGE_MODE_UNDEF) {
+               if (nla_put_u16(skb, IFLA_BRIDGE_MODE, mode)) {
+                       nla_nest_cancel(skb, br_afspec);
+                       goto nla_put_failure;
+               }
+       }
        nla_nest_end(skb, br_afspec);
  
+       protinfo = nla_nest_start(skb, IFLA_PROTINFO | NLA_F_NESTED);
+       if (!protinfo)
+               goto nla_put_failure;
+       if (brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_MODE, BR_HAIRPIN_MODE) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_GUARD, BR_BPDU_GUARD) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_FAST_LEAVE,
+                               BR_MULTICAST_FAST_LEAVE) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_PROTECT, BR_ROOT_BLOCK) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_LEARNING, BR_LEARNING) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_LEARNING_SYNC, BR_LEARNING_SYNC) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_UNICAST_FLOOD, BR_FLOOD) ||
+           brport_nla_put_flag(skb, flags, mask,
+                               IFLA_BRPORT_PROXYARP, BR_PROXYARP)) {
+               nla_nest_cancel(skb, protinfo);
+               goto nla_put_failure;
+       }
+       nla_nest_end(skb, protinfo);
        return nlmsg_end(skb, nlh);
  nla_put_failure:
        nlmsg_cancel(skb, nlh);
diff --combined net/netfilter/nf_log.c
@@@ -19,6 -19,9 +19,9 @@@
  static struct nf_logger __rcu *loggers[NFPROTO_NUMPROTO][NF_LOG_TYPE_MAX] __read_mostly;
  static DEFINE_MUTEX(nf_log_mutex);
  
+ #define nft_log_dereference(logger) \
+       rcu_dereference_protected(logger, lockdep_is_held(&nf_log_mutex))
  static struct nf_logger *__find_logger(int pf, const char *str_logger)
  {
        struct nf_logger *log;
@@@ -28,8 -31,7 +31,7 @@@
                if (loggers[pf][i] == NULL)
                        continue;
  
-               log = rcu_dereference_protected(loggers[pf][i],
-                                               lockdep_is_held(&nf_log_mutex));
+               log = nft_log_dereference(loggers[pf][i]);
                if (!strncasecmp(str_logger, log->name, strlen(log->name)))
                        return log;
        }
@@@ -45,8 -47,7 +47,7 @@@ void nf_log_set(struct net *net, u_int8
                return;
  
        mutex_lock(&nf_log_mutex);
-       log = rcu_dereference_protected(net->nf.nf_loggers[pf],
-                                       lockdep_is_held(&nf_log_mutex));
+       log = nft_log_dereference(net->nf.nf_loggers[pf]);
        if (log == NULL)
                rcu_assign_pointer(net->nf.nf_loggers[pf], logger);
  
@@@ -61,8 -62,7 +62,7 @@@ void nf_log_unset(struct net *net, cons
  
        mutex_lock(&nf_log_mutex);
        for (i = 0; i < NFPROTO_NUMPROTO; i++) {
-               log = rcu_dereference_protected(net->nf.nf_loggers[i],
-                               lockdep_is_held(&nf_log_mutex));
+               log = nft_log_dereference(net->nf.nf_loggers[i]);
                if (log == logger)
                        RCU_INIT_POINTER(net->nf.nf_loggers[i], NULL);
        }
@@@ -75,6 -75,7 +75,7 @@@ EXPORT_SYMBOL(nf_log_unset)
  int nf_log_register(u_int8_t pf, struct nf_logger *logger)
  {
        int i;
+       int ret = 0;
  
        if (pf >= ARRAY_SIZE(init_net.nf.nf_loggers))
                return -EINVAL;
        mutex_lock(&nf_log_mutex);
  
        if (pf == NFPROTO_UNSPEC) {
+               for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) {
+                       if (rcu_access_pointer(loggers[i][logger->type])) {
+                               ret = -EEXIST;
+                               goto unlock;
+                       }
+               }
                for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++)
                        rcu_assign_pointer(loggers[i][logger->type], logger);
        } else {
-               /* register at end of list to honor first register win */
+               if (rcu_access_pointer(loggers[pf][logger->type])) {
+                       ret = -EEXIST;
+                       goto unlock;
+               }
                rcu_assign_pointer(loggers[pf][logger->type], logger);
        }
  
+ unlock:
        mutex_unlock(&nf_log_mutex);
-       return 0;
+       return ret;
  }
  EXPORT_SYMBOL(nf_log_register);
  
@@@ -144,8 -154,7 +154,7 @@@ int nf_logger_find_get(int pf, enum nf_
        struct nf_logger *logger;
        int ret = -ENOENT;
  
-       logger = loggers[pf][type];
-       if (logger == NULL)
+       if (rcu_access_pointer(loggers[pf][type]) == NULL)
                request_module("nf-logger-%u-%u", pf, type);
  
        rcu_read_lock();
@@@ -294,39 -303,35 +303,37 @@@ static int seq_show(struct seq_file *s
  {
        loff_t *pos = v;
        const struct nf_logger *logger;
 -      int i, ret;
 +      int i;
        struct net *net = seq_file_net(s);
  
-       logger = rcu_dereference_protected(net->nf.nf_loggers[*pos],
-                                          lockdep_is_held(&nf_log_mutex));
+       logger = nft_log_dereference(net->nf.nf_loggers[*pos]);
  
        if (!logger)
 -              ret = seq_printf(s, "%2lld NONE (", *pos);
 +              seq_printf(s, "%2lld NONE (", *pos);
        else
 -              ret = seq_printf(s, "%2lld %s (", *pos, logger->name);
 +              seq_printf(s, "%2lld %s (", *pos, logger->name);
  
 -      if (ret < 0)
 -              return ret;
 +      if (seq_has_overflowed(s))
 +              return -ENOSPC;
  
        for (i = 0; i < NF_LOG_TYPE_MAX; i++) {
                if (loggers[*pos][i] == NULL)
                        continue;
  
-               logger = rcu_dereference_protected(loggers[*pos][i],
-                                          lockdep_is_held(&nf_log_mutex));
+               logger = nft_log_dereference(loggers[*pos][i]);
 -              ret = seq_printf(s, "%s", logger->name);
 -              if (ret < 0)
 -                      return ret;
 -              if (i == 0 && loggers[*pos][i + 1] != NULL) {
 -                      ret = seq_printf(s, ",");
 -                      if (ret < 0)
 -                              return ret;
 -              }
 +              seq_printf(s, "%s", logger->name);
 +              if (i == 0 && loggers[*pos][i + 1] != NULL)
 +                      seq_printf(s, ",");
 +
 +              if (seq_has_overflowed(s))
 +                      return -ENOSPC;
        }
  
 -      return seq_printf(s, ")\n");
 +      seq_printf(s, ")\n");
 +
 +      if (seq_has_overflowed(s))
 +              return -ENOSPC;
 +      return 0;
  }
  
  static const struct seq_operations nflog_seq_ops = {
@@@ -387,8 -392,7 +394,7 @@@ static int nf_log_proc_dostring(struct 
                mutex_unlock(&nf_log_mutex);
        } else {
                mutex_lock(&nf_log_mutex);
-               logger = rcu_dereference_protected(net->nf.nf_loggers[tindex],
-                                                  lockdep_is_held(&nf_log_mutex));
+               logger = nft_log_dereference(net->nf.nf_loggers[tindex]);
                if (!logger)
                        table->data = "NONE";
                else
diff --combined net/packet/af_packet.c
@@@ -1676,7 -1676,7 +1676,7 @@@ retry
                        if (len < hhlen)
                                skb_reset_network_header(skb);
                }
-               err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
+               err = memcpy_from_msg(skb_put(skb, len), msg, len);
                if (err)
                        goto out_free;
                goto retry;
@@@ -2095,6 -2095,18 +2095,18 @@@ static void tpacket_destruct_skb(struc
        sock_wfree(skb);
  }
  
+ static bool ll_header_truncated(const struct net_device *dev, int len)
+ {
+       /* net device doesn't like empty head */
+       if (unlikely(len <= dev->hard_header_len)) {
+               net_warn_ratelimited("%s: packet size is too short (%d < %d)\n",
+                                    current->comm, len, dev->hard_header_len);
+               return true;
+       }
+       return false;
+ }
  static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
                void *frame, struct net_device *dev, int size_max,
                __be16 proto, unsigned char *addr, int hlen)
                if (unlikely(err < 0))
                        return -EINVAL;
        } else if (dev->hard_header_len) {
-               /* net device doesn't like empty head */
-               if (unlikely(tp_len <= dev->hard_header_len)) {
-                       pr_err("packet size is too short (%d < %d)\n",
-                              tp_len, dev->hard_header_len);
+               if (ll_header_truncated(dev, tp_len))
                        return -EINVAL;
-               }
  
                skb_push(skb, dev->hard_header_len);
                err = skb_store_bits(skb, 0, data,
@@@ -2400,6 -2408,7 +2408,7 @@@ static int packet_snd(struct socket *so
        unsigned short gso_type = 0;
        int hlen, tlen;
        int extra_len = 0;
+       ssize_t n;
  
        /*
         *      Get and verify the address.
  
                len -= vnet_hdr_len;
  
-               err = memcpy_fromiovec((void *)&vnet_hdr, msg->msg_iov,
-                                      vnet_hdr_len);
-               if (err < 0)
+               err = -EFAULT;
+               n = copy_from_iter(&vnet_hdr, vnet_hdr_len, &msg->msg_iter);
+               if (n != vnet_hdr_len)
                        goto out_unlock;
  
                if ((vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
 -                  (vnet_hdr.csum_start + vnet_hdr.csum_offset + 2 >
 -                    vnet_hdr.hdr_len))
 -                      vnet_hdr.hdr_len = vnet_hdr.csum_start +
 -                                               vnet_hdr.csum_offset + 2;
 +                  (__virtio16_to_cpu(false, vnet_hdr.csum_start) +
 +                   __virtio16_to_cpu(false, vnet_hdr.csum_offset) + 2 >
 +                    __virtio16_to_cpu(false, vnet_hdr.hdr_len)))
 +                      vnet_hdr.hdr_len = __cpu_to_virtio16(false,
 +                               __virtio16_to_cpu(false, vnet_hdr.csum_start) +
 +                              __virtio16_to_cpu(false, vnet_hdr.csum_offset) + 2);
  
                err = -EINVAL;
 -              if (vnet_hdr.hdr_len > len)
 +              if (__virtio16_to_cpu(false, vnet_hdr.hdr_len) > len)
                        goto out_unlock;
  
                if (vnet_hdr.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
        err = -ENOBUFS;
        hlen = LL_RESERVED_SPACE(dev);
        tlen = dev->needed_tailroom;
 -      skb = packet_alloc_skb(sk, hlen + tlen, hlen, len, vnet_hdr.hdr_len,
 +      skb = packet_alloc_skb(sk, hlen + tlen, hlen, len,
 +                             __virtio16_to_cpu(false, vnet_hdr.hdr_len),
                               msg->msg_flags & MSG_DONTWAIT, &err);
        if (skb == NULL)
                goto out_unlock;
        skb_set_network_header(skb, reserve);
  
        err = -EINVAL;
-       if (sock->type == SOCK_DGRAM &&
-           (offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len)) < 0)
-               goto out_free;
+       if (sock->type == SOCK_DGRAM) {
+               offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len);
+               if (unlikely(offset) < 0)
+                       goto out_free;
+       } else {
+               if (ll_header_truncated(dev, len))
+                       goto out_free;
+       }
  
        /* Returns -EFAULT on error */
-       err = skb_copy_datagram_from_iovec(skb, offset, msg->msg_iov, 0, len);
+       err = skb_copy_datagram_from_iter(skb, offset, &msg->msg_iter, len);
        if (err)
                goto out_free;
  
  
        if (po->has_vnet_hdr) {
                if (vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
 -                      if (!skb_partial_csum_set(skb, vnet_hdr.csum_start,
 -                                                vnet_hdr.csum_offset)) {
 +                      u16 s = __virtio16_to_cpu(false, vnet_hdr.csum_start);
 +                      u16 o = __virtio16_to_cpu(false, vnet_hdr.csum_offset);
 +                      if (!skb_partial_csum_set(skb, s, o)) {
                                err = -EINVAL;
                                goto out_free;
                        }
                }
  
 -              skb_shinfo(skb)->gso_size = vnet_hdr.gso_size;
 +              skb_shinfo(skb)->gso_size =
 +                      __virtio16_to_cpu(false, vnet_hdr.gso_size);
                skb_shinfo(skb)->gso_type = gso_type;
  
                /* Header must be checked, and gso_segs computed. */
@@@ -2917,10 -2926,8 +2931,10 @@@ static int packet_recvmsg(struct kiocb 
                        struct skb_shared_info *sinfo = skb_shinfo(skb);
  
                        /* This is a hint as to how much should be linear. */
 -                      vnet_hdr.hdr_len = skb_headlen(skb);
 -                      vnet_hdr.gso_size = sinfo->gso_size;
 +                      vnet_hdr.hdr_len =
 +                              __cpu_to_virtio16(false, skb_headlen(skb));
 +                      vnet_hdr.gso_size =
 +                              __cpu_to_virtio16(false, sinfo->gso_size);
                        if (sinfo->gso_type & SKB_GSO_TCPV4)
                                vnet_hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
                        else if (sinfo->gso_type & SKB_GSO_TCPV6)
  
                if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
 -                      vnet_hdr.csum_start = skb_checksum_start_offset(skb);
 -                      vnet_hdr.csum_offset = skb->csum_offset;
 +                      vnet_hdr.csum_start = __cpu_to_virtio16(false,
 +                                        skb_checksum_start_offset(skb));
 +                      vnet_hdr.csum_offset = __cpu_to_virtio16(false,
 +                                                       skb->csum_offset);
                } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
                        vnet_hdr.flags = VIRTIO_NET_HDR_F_DATA_VALID;
                } /* else everything is zero */
  
-               err = memcpy_toiovec(msg->msg_iov, (void *)&vnet_hdr,
-                                    vnet_hdr_len);
+               err = memcpy_to_msg(msg, (void *)&vnet_hdr, vnet_hdr_len);
                if (err < 0)
                        goto out_free;
        }
                msg->msg_flags |= MSG_TRUNC;
        }
  
-       err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
+       err = skb_copy_datagram_msg(skb, 0, msg, copied);
        if (err)
                goto out_free;