1. 11 1月, 2014 1 次提交
    • J
      net: core: explicitly select a txq before doing l2 forwarding · f663dd9a
      Jason Wang 提交于
      Currently, the tx queue were selected implicitly in ndo_dfwd_start_xmit(). The
      will cause several issues:
      
      - NETIF_F_LLTX were removed for macvlan, so txq lock were done for macvlan
        instead of lower device which misses the necessary txq synchronization for
        lower device such as txq stopping or frozen required by dev watchdog or
        control path.
      - dev_hard_start_xmit() was called with NULL txq which bypasses the net device
        watchdog.
      - dev_hard_start_xmit() does not check txq everywhere which will lead a crash
        when tso is disabled for lower device.
      
      Fix this by explicitly introducing a new param for .ndo_select_queue() for just
      selecting queues in the case of l2 forwarding offload. netdev_pick_tx() was also
      extended to accept this parameter and dev_queue_xmit_accel() was used to do l2
      forwarding transmission.
      
      With this fixes, NETIF_F_LLTX could be preserved for macvlan and there's no need
      to check txq against NULL in dev_hard_start_xmit(). Also there's no need to keep
      a dedicated ndo_dfwd_start_xmit() and we can just reuse the code of
      dev_queue_xmit() to do the transmission.
      
      In the future, it was also required for macvtap l2 forwarding support since it
      provides a necessary synchronization method.
      
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: e1000-devel@lists.sourceforge.net
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f663dd9a
  2. 06 1月, 2014 1 次提交
  3. 03 1月, 2014 1 次提交
    • W
      ipv4: fix tunneled VM traffic over hw VXLAN/GRE GSO NIC · 7a7ffbab
      Wei-Chun Chao 提交于
      VM to VM GSO traffic is broken if it goes through VXLAN or GRE
      tunnel and the physical NIC on the host supports hardware VXLAN/GRE
      GSO offload (e.g. bnx2x and next-gen mlx4).
      
      Two issues -
      (VXLAN) VM traffic has SKB_GSO_DODGY and SKB_GSO_UDP_TUNNEL with
      SKB_GSO_TCP/UDP set depending on the inner protocol. GSO header
      integrity check fails in udp4_ufo_fragment if inner protocol is
      TCP. Also gso_segs is calculated incorrectly using skb->len that
      includes tunnel header. Fix: robust check should only be applied
      to the inner packet.
      
      (VXLAN & GRE) Once GSO header integrity check passes, NULL segs
      is returned and the original skb is sent to hardware. However the
      tunnel header is already pulled. Fix: tunnel header needs to be
      restored so that hardware can perform GSO properly on the original
      packet.
      Signed-off-by: NWei-Chun Chao <weichunc@plumgrid.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a7ffbab
  4. 01 1月, 2014 1 次提交
    • D
      vlan: Fix header ops passthru when doing TX VLAN offload. · 2205369a
      David S. Miller 提交于
      When the vlan code detects that the real device can do TX VLAN offloads
      in hardware, it tries to arrange for the real device's header_ops to
      be invoked directly.
      
      But it does so illegally, by simply hooking the real device's
      header_ops up to the VLAN device.
      
      This doesn't work because we will end up invoking a set of header_ops
      routines which expect a device type which matches the real device, but
      will see a VLAN device instead.
      
      Fix this by providing a pass-thru set of header_ops which will arrange
      to pass the proper real device instead.
      
      To facilitate this add a dev_rebuild_header().  There are
      implementations which provide a ->cache and ->create but not a
      ->rebuild (f.e. PLIP).  So we need a helper function just like
      dev_hard_header() to avoid crashes.
      
      Use this helper in the one existing place where the
      header_ops->rebuild was being invoked, the neighbour code.
      
      With lots of help from Florian Westphal.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2205369a
  5. 29 12月, 2013 1 次提交
    • R
      ACPI / hotplug / driver core: Handle containers in a special way · caa73ea1
      Rafael J. Wysocki 提交于
      ACPI container devices require special hotplug handling, at least
      on some systems, since generally user space needs to carry out
      system-specific cleanup before it makes sense to offline devices in
      the container.  However, the current ACPI hotplug code for containers
      first attempts to offline devices in the container and only then it
      notifies user space of the container offline.
      
      Moreover, after commit 202317a5 (ACPI / scan: Add acpi_device
      objects for all device nodes in the namespace), ACPI device objects
      representing containers are present as long as the ACPI namespace
      nodes corresponding to them are present, which may be forever, even
      if the container devices are physically detached from the system (the
      return values of the corresponding _STA methods change in those
      cases, but generally the namespace nodes themselves are still there).
      Thus it is useful to introduce entities representing containers that
      will go away during container hot-unplug.
      
      The goal of this change is to address both the above issues.
      
      The idea is to create a "companion" container system device for each
      of the ACPI container device objects during the initial namespace
      scan or on a hotplug event making the container present.  That system
      device will be unregistered on container removal.  A new bus type
      for container devices is added for this purpose, because device
      offline and online operations need to be defined for them.  The
      online operation is a trivial function that is always successful
      and the offline uses a callback pointed to by the container device's
      offline member.
      
      For ACPI containers that callback simply walks the list of ACPI
      device objects right below the container object (its children) and
      checks if all of their physical companion devices are offline.  If
      that's not the case, it returns -EBUSY and the container system
      devivce cannot be put offline.  Consequently, to put the container
      system device offline, it is necessary to put all of the physical
      devices depending on its ACPI companion object offline beforehand.
      
      Container system devices created for ACPI container objects are
      initially online.  They are created by the container ACPI scan
      handler whose hotplug.demand_offline flag is set.  That causes
      acpi_scan_hot_remove() to check if the companion container system
      device is offline before attempting to remove an ACPI container or
      any devices below it.  If the check fails, a KOBJ_CHANGE uevent is
      emitted for the container system device in question and user space
      is expected to offline all devices below the container and the
      container itself in response to it.  Then, user space can finalize
      the removal of the container with the help of its ACPI device
      object's eject attribute in sysfs.
      Tested-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      caa73ea1
  6. 28 12月, 2013 1 次提交
  7. 25 12月, 2013 1 次提交
  8. 22 12月, 2013 1 次提交
    • B
      aio/migratepages: make aio migrate pages sane · 8e321fef
      Benjamin LaHaise 提交于
      The arbitrary restriction on page counts offered by the core
      migrate_page_move_mapping() code results in rather suspicious looking
      fiddling with page reference counts in the aio_migratepage() operation.
      To fix this, make migrate_page_move_mapping() take an extra_count parameter
      that allows aio to tell the code about its own reference count on the page
      being migrated.
      
      While cleaning up aio_migratepage(), make it validate that the old page
      being passed in is actually what aio_migratepage() expects to prevent
      misbehaviour in the case of races.
      Signed-off-by: NBenjamin LaHaise <bcrl@kvack.org>
      8e321fef
  9. 21 12月, 2013 2 次提交
  10. 19 12月, 2013 5 次提交
  11. 18 12月, 2013 1 次提交
  12. 17 12月, 2013 1 次提交
  13. 13 12月, 2013 5 次提交
  14. 12 12月, 2013 1 次提交
  15. 11 12月, 2013 5 次提交
  16. 08 12月, 2013 2 次提交
  17. 07 12月, 2013 5 次提交
    • L
      ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module · 9d24622c
      Lv Zheng 提交于
      To avoid build problems and breaking dependencies between ACPI header
      files, <acpi/acpi.h> should not be included directly by code outside
      of the ACPI core subsystem, but this is done by the ACPI iSCSI
      Boot Firmware code.
      
      The iBFT specification doesn't mention whether or not it can appear
      on a non-ACPI platform, but is says that ACPI 3.0b defines the
      mechanism.  The current CONFIG_ISCSI_IBFT_FIND code doesn't use the
      ACPI tables API to locate the table, so it doesn't rely on CONFIG_ACPI
      directly.
      
      However, since iBFT is is an ACPI-based mechanism (please refer to
      the documentation link below for more information), it should be
      correct to make CONFIG_ISCSI_IBFT_FIND depend on CONFIG_ACPI (even
      though the table location can be implemented without using ACPI
      tables API).
      
      After that change, include/linux/iscsi_ibft.h can be modified to
      include <linux/acpi.h> instead of <acpi/acpi.h> as appropriate.
      
      References: http://www.microsoft.com/whdc/system/platform/firmware/ibft.mspx
      Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Cc: Peter Jones <pjones@redhat.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9d24622c
    • L
      ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> · 27d50c82
      Lv Zheng 提交于
      To avoid build problems and breaking dependencies between ACPI header
      files, <acpi/acpi.h> should not be included directly by code outside
      of the ACPI core subsystem.  However, that is possible if
      <linux/acpi_io.h> is included, because that file contains
      a direct inclusion of <acpi/acpi.h>.
      
      For this reason, remove the direct <acpi/acpi.h> inclusion from
      <linux/acpi_io.h>, move that file from include/linux/ to include/acpi/
      and make <linux/acpi.h> include it for CONFIG_ACPI set along with the
      other ACPI header files.  Accordingly, Remove the inclusions of
      <linux/acpi_io.h> from everywhere.
      
      Of course, that causes the contents of the new <acpi/acpi_io.h> file
      to be available for CONFIG_ACPI set only, so intel_opregion.o that
      depends on it should also depend on CONFIG_ACPI (and it really should
      not be compiled for CONFIG_ACPI unset anyway).
      
      References: https://01.org/linuxgraphics/sites/default/files/documentation/acpi_igd_opregion_spec.pdf
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      27d50c82
    • L
      SFI / ACPI: Fix warnings reported during builds with W=1 · c099eacb
      Lv Zheng 提交于
      The following warnings can be seen in W=1 builds, because the original
      sfi_acpi.[ch] header inclusions are incorrect:
      
      include/linux/sfi_acpi.h:72:2: error: implicit declaration of function 'acpi_table_parse' [-Werror=implicit-function-declaration]
      drivers/sfi/sfi_acpi.c:154:5: warning: no previous prototype for 'sfi_acpi_table_parse' [-Wmissing-prototypes]
      
      Fix linux/sfi_acpi.h and modify drivers/sfi/sfi_acpi.c accordingly.
      Reported-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c099eacb
    • R
      ACPI / bind: Redefine acpi_preset_companion() · 9c5ad36d
      Rafael J. Wysocki 提交于
      Modify acpi_preset_companion() to take a struct acpi_device pointer
      instead of an ACPI handle as its second argument and redefine it as
      a static inline wrapper around ACPI_COMPANION_SET() passing the
      return value of acpi_find_child_device() directly as the second
      argument to it.  Update its users to pass struct acpi_device
      pointers instead of ACPI handles to it.
      
      This allows some unnecessary acpi_bus_get_device() calls to be
      avoided.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAaron Lu <aaron.lu@intel.com>
      Tested-by: Aaron Lu <aaron.lu@intel.com> # for ATA binding
      9c5ad36d
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  18. 06 12月, 2013 2 次提交
    • P
      xen-netback: fix fragment detection in checksum setup · 1431fb31
      Paul Durrant 提交于
      The code to detect fragments in checksum_setup() was missing for IPv4 and
      too eager for IPv6. (It transpires that Windows seems to send IPv6 packets
      with a fragment header even if they are not a fragment - i.e. offset is zero,
      and M bit is not set).
      
      This patch also incorporates a fix to callers of maybe_pull_tail() where
      skb->network_header was being erroneously added to the length argument.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Signed-off-by: NZoltan Kiss <zoltan.kiss@citrix.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David Vrabel <david.vrabel@citrix.com>
      cc: David Miller <davem@davemloft.net>
      Acked-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1431fb31
    • T
      percpu: fix spurious sparse warnings from DEFINE_PER_CPU() · b1a0fbfd
      Tejun Heo 提交于
      When CONFIG_DEBUG_FORCE_WEAK_PER_CPU or CONFIG_ARCH_NEEDS_WEAK_PER_CPU
      is set, DEFINE_PER_CPU() explodes into cryptic series of definitions
      to still allow using "static" for percpu variables while keeping all
      per-cpu symbols unique in the kernel image which is required for weak
      symbols.  This ultimately converts the actual symbol to global whether
      DEFINE_PER_CPU() is prefixed with static or not.
      
      Unfortunately, the macro forgot to add explicit extern declartion of
      the actual symbol ending up defining global symbol without preceding
      declaration for static definitions which naturally don't have matching
      DECLARE_PER_CPU().  The only ill effect is triggering of the following
      warnings.
      
       fs/inode.c:74:8: warning: symbol 'nr_inodes' was not declared. Should it be static?
       fs/inode.c:75:8: warning: symbol 'nr_unused' was not declared. Should it be static?
      
      Fix it by adding extern declaration in the DEFINE_PER_CPU() macro.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      Tested-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      b1a0fbfd
  19. 03 12月, 2013 3 次提交