1. 06 6月, 2014 4 次提交
    • A
      dm9000: clean up reset code · 751bb6fd
      Andrew Ruder 提交于
      * Change a hard-coded 0x3 to NCR_RST | NCR_MAC_LBK in dm9000_reset
      
      * Every single place where dm9000_init_dm9000 was ran, a dm9000_reset
        was called immediately before-hand.  Bring dm9000_reset into
        dm9000_init_dm9000.
      
      * The following commit updated the dm9000_probe reset routine to use NCR_RST
        | NCR_MAC_LBK:
      
          6741f40d DM9000B: driver initialization upgrade
      
        and a later commit added a bug-fix to always reset the chip twice:
      
          09ee9f87 dm9000: Implement full reset of DM9000 network device
      
        Unfortunately, since the changes in 6741f40d were made by replacing the
        dm9000_probe dm9000_reset with the adjusted iow(), the changes in
        09ee9f87 were not incorporated into the dm9000_probe reset.
        Furthermore, it bypassed the requisite reset-delay causing some boards
        to get at least one "read wrong id ..." dev_err message during
        dm9000_probe.
      Signed-off-by: NAndrew Ruder <andrew.ruder@elecsyscorp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      751bb6fd
    • A
      dm9000: acquire irq flags from device tree · 6b50d038
      Andrew Ruder 提交于
      The DM9000 supports both active high interrupts and active low interrupts.
      This is configured via the attached EEPROM.  In the device-tree case, make sure
      that the DM9000 driver passes the correct flags to request_irq.
      Signed-off-by: NAndrew Ruder <andrew.ruder@elecsyscorp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b50d038
    • S
      MPLS: Use mpls_features to activate software MPLS GSO segmentation · 3b392ddb
      Simon Horman 提交于
      If an MPLS packet requires segmentation then use mpls_features
      to determine if the software implementation should be used.
      
      As no driver advertises MPLS GSO segmentation this will always be
      the case.
      
      I had not noticed that this was necessary before as software MPLS GSO
      segmentation was already being used in my test environment. I believe that
      the reason for that is the skbs in question always had fragments and the
      driver I used does not advertise NETIF_F_FRAGLIST (which seems to be the
      case for most drivers). Thus software segmentation was activated by
      skb_gso_ok().
      
      This introduces the overhead of an extra call to skb_network_protocol()
      in the case where where CONFIG_NET_MPLS_GSO is set and
      skb->ip_summed == CHECKSUM_NONE.
      
      Thanks to Jesse Gross for prompting me to investigate this.
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Acked-by: NYAMAMOTO Takashi <yamamoto@valinux.co.jp>
      Acked-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3b392ddb
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · d68de60f
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2014-06-05
      
      This series contains updates to i40e and i40evf.
      
      Jesse fixes an issue reported by Dave Jones where a couple of FD checks
      ended up using bitwise OR where it should have been bitwise AND.
      
      Neerav removes unused defines and macros for receive LRO.  Fix the driver
      from allowing the user to set a larger MTU size that the hardware was
      being configured to support.  Refactors send version which moves code in
      two places into a small helper function.
      
      Kamil modifies register diagnostics since register ranges can vary among
      the different NVMs to avoid false test results.  So now we try to identify
      the full range and use it for a register test and if we fail to define the
      proper register range, we will only test the first register from that
      group.  Then removes the check for large buffer since this was added in the
      case this structure changed in the future, since the AQ definition is now
      mature enough that this check is no longer necessary.
      
      Mitch fixes i40evf driver to allocate descriptors in groups of 32 since the
      hardware requires it.  Also fixes a crash when the ring size changed because
      it would change the count before deallocating resources, causing the driver
      to either free nonexistent buffers or leak leftover buffers.  Fixed the
      driver to notify the VF for all types of resets so the VF can attempt a
      graceful reinit.
      
      Shannon refactors stats collection to create a unifying stats update routine
      to call the various stat collection routines.  Removes rx_errors and
      rx_missed stats since they were removed from the chip design.  Added
      missing VSI statistics that the hardware offers but are not apart of the
      standard netdev stats.
      
      v2: dropped patch "i40e: Allow disabling of DCB via debugfs" from Neerav
          based on feedback from David Miller.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d68de60f
  2. 05 6月, 2014 36 次提交
    • S
      i40e: add missing VSI statistics · 41a9e55c
      Shannon Nelson 提交于
      Add a couple more statistics that the hardware offers but aren't part
      of the standard netdev stats.
      
      Change-ID: I201db2898f2c284aee3d9631470bc5edd349e9a5
      Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      41a9e55c
    • S
      i40e/i40evf: remove rx_errors and rx_missed · 03da6f6a
      Shannon Nelson 提交于
      The rx_errors (GLV_REPC) and rx_missed (GLV_RMPC) were removed
      from the chip design.
      
      Change-ID: Ifdeb69c90feac64ec95c36d3d32c75e3a06de3b7
      Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      03da6f6a
    • S
      i40e: refactor stats collection · 7812fddc
      Shannon Nelson 提交于
      Pull the PF stat collection out of the VSI collection routine, and
      add a unifying stats update routine to call the various stat collection
      routines.
      
      Change-ID: I224192455bb3a6e5dc0a426935e67dffc123e306
      Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      7812fddc
    • J
      i40e: refactor send version · 44033fac
      Jesse Brandeburg 提交于
      This change moves some common code in two places into a
      small helper function, and corrects a bug in one of the
      two places in the process.
      
      Change-ID: If3bba7152b240f13a7881eb0e8a781655fa66ce7
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      44033fac
    • K
      i40e/i40evf: VEB structure added, GTIME macro update · 4f4e17bd
      Kamil Krawczyk 提交于
      Structure for VEB context added. Update macro for
      transition from ms to GTIME (us) time units.
      
      Change-ID: Ib3a19587b4cf355348655df8f60c6f37bb1497a3
      Signed-off-by: NKamil Krawczyk <kamil.krawczyk@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4f4e17bd
    • M
      i40e: notify VF of all types of resets · 263fc48f
      Mitch Williams 提交于
      Currently, the PF driver only notifies the VFs for PF reset events.
      Instead, notify the VFs for all types of resets, so they can attempt a
      graceful reinit.
      
      Change-ID: I03eb7afde25727198ef620f8b4e78bb667a11370
      Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      263fc48f
    • M
      i40evf: fix crash when changing ring sizes · d732a184
      Mitch Williams 提交于
      i40evf_set_ringparam was broken in several ways. First, it only changed
      the size of the first ring, and second, changing the ring size would
      often result in a panic because it would change the count before
      deallocating resources, causing the driver to either free nonexistent
      buffers, or leak leftover buffers.
      
      Fix this by storing the descriptor count in the adapter structure, and
      updating the count for each ring each time we allocate them. This
      ensures that we always free the right size ring, and always end up with
      the requested count when the device is (re)opened.
      
      Change-ID: I298396cd3d452ba8509d9f2d33a93f25868a9a55
      Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d732a184
    • M
      i40evf: set descriptor multiple to 32 · 337eb08e
      Mitch Williams 提交于
      Hardware requires descriptors to be allocated in groups of 32.
      
      Change-ID: I752ccc96769d1bd8d3018c004b8aeff464045bf2
      Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
      Tested-by: NSibai Li <sibai.li@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      337eb08e
    • J
      i40e: clamp jumbo frame size · 61a46a4c
      Jesse Brandeburg 提交于
      The driver was allowing the user to set larger size MTU
      than the hardware was being configured to support.
      
      The driver was already using VLAN_HLEN when setting the
      hardware max receivable frame size, so just add it to the
      netdev MTU set entry point as well.
      
      Change-ID: Ie20e2a35d04f8c411253e255bea79ca69aaeaea3
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      61a46a4c
    • J
      i40e/i40evf: remove unused RX_LRO define · d0277054
      Jesse Brandeburg 提交于
      Remove unused defines and macros for RX_LRO.
      
      Change-ID: I8ca6715edfa62b56837417a1c4ff68c2345dab6e
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NJim Young <jamesx.m.young@intel.com>
      Tested-by: NSibai Li <sibai.li@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d0277054
    • K
      i40e: remove check for large buffer · c5cc0cfd
      Kamil Krawczyk 提交于
      We introduced this check in case this structure changed in the future,
      the AQ definition is now mature enough that this check is no longer necessary.
      
      Change-ID: Ic66321d0a08557dc9d8cb84029185352cb534330
      Signed-off-by: NKamil Krawczyk <kamil.krawczyk@intel.com>
      Tested-by: NJim Young <jamesx.m.young@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c5cc0cfd
    • K
      i40e: Rework register diagnostic · 22dd9ae8
      Kamil Krawczyk 提交于
      Register range, being subject to register diagnostic, can vary among
      different NVMs. We will try to identify the full range and use it for
      a register test. This is needed to avoid false test results. If we fail
      to define the proper register range we will test only the first register
      from that group.
      
      Change-ID: Ieee7173c719733b61d3733177a94dc557eb7b3fd
      Signed-off-by: NKamil Krawczyk <kamil.krawczyk@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      22dd9ae8
    • J
      i40e: don't use OR to check a value · d3a90b70
      Jesse Brandeburg 提交于
      A couple of FD checks ended up using bitwise OR to check
      a value, which ends up always being evaluated to true.
      
      This should fix the issue.  Thanks to DaveJ for noticing
      and reporting the issue!
      
      CC: Dave Jones <davej@redhat.com>
      Reported-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d3a90b70
    • W
      ipv4: use skb frags api in udp4_hwcsum() · ebbe495f
      WANG Cong 提交于
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebbe495f
    • W
      net: use the new API kvfree() · 4cb28970
      WANG Cong 提交于
      It is available since v3.15-rc5.
      
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cb28970
    • M
      dns_resolver: Do not accept domain names longer than 255 chars · 9638f671
      Manuel Schölling 提交于
      According to RFC1035 "[...] the total length of a domain name (i.e.,
      label octets and label length octets) is restricted to 255 octets or
      less."
      Signed-off-by: NManuel Schölling <manuel.schoelling@gmx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9638f671
    • D
      Merge branch 'isdn-capi' · 555878b9
      David S. Miller 提交于
      Tilman Schmidt says:
      
      ====================
      ISDN patches for net-next (v2)
      
      Here's v2 of the series of patches for the ISDN CAPI subsystem
      prepared by Paul Bolle and reviewed by yours truly. It reflects
      GregKH's review, resulting in a substantial simplification.
      Please merge via net-next.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      555878b9
    • P
      isdn/capi: fix (middleware) device nodes · d1cadce1
      Paul Bolle 提交于
      Since v2.4 the capi driver used the following device nodes if
      "middleware" support was enabled:
          /dev/capi20
          /dev/capi/0
          /dev/capi/1
          [...]
      
      /dev/capi20 is a character device node. /dev/capi/0 (and up) are tty
      device nodes (with a different major).
      
      This device node (naming) scheme is not documented anywhere, as far as I
      know. It was originally provided by the capifs pseudo filesystem (before
      udev became available). It is required for example by the pppd
      capiplugin. It was supported until a few years ago. But a number of
      developments broke it:
      - v2.6.6 (May 2004) renamed /dev/capi20 to /dev/capi and removed the
        "/" from the name of capi's tty driver. The explanation of the patch
        that did this included two examples of udev rules "to restore the old
        namespace";
      - either udev 154 (May 2010) or udev 179 (January 2012) stopped
        allowing to rename device nodes, and thus the ability to have
        /dev/capi20 appear instead of /dev/capi and /dev/capi/0 (and up)
        instead of /dev/capi0 (and up);
      - v3.0 (July 2011) also removed capifs. That disabled another method to
        create the /dev/capi/0 (and up) device nodes.
      
      So now users need to manually tweak their setup (eg, create /dev/capi/
      and fill that with symlinks) to get things working. This is all rather
      hacky and only discoverable by searching the web. Fix all this by
      renaming /dev/capi back to /dev/capi20, and by setting the name of the
      "capi_nc" tty driver to "capi!" so the tty device nodes appear as
      /dev/capi/0 (and up).
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NTilman Schmidt <tilman@imap.cc>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1cadce1
    • P
      isdn/capi: Make verbose reporting depend on capidrv · a79f5d26
      Paul Bolle 提交于
      The Kconfig symbol ISDN_DRV_AVMB1_VERBOSE_REASON is only used for
      capi_info2str(). That function is only used in capidrv.c. So setting it
      without setting ISDN_CAPI_CAPIDRV is pointless. Make it depend on
      ISDN_CAPI_CAPIDRV, rename it to ISDN_CAPI_CAPIDRV_VERBOSE and put its
      entry after ISDN_CAPI_CAPIDRV's entry.
      
      Since this symbol seems to be primarily used for debugging, keep it off
      by default. By now the last users of capidrv hopefully know all they
      need to know about the reasons for disconnecting.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NTilman Schmidt <tilman@imap.cc>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a79f5d26
    • P
      isdn/capi: move capi_info2str to capidrv.c · ca05e3a7
      Paul Bolle 提交于
      capi_info2str() is apparently meant to be of general utility. It is
      actually only used in capidrv.c. So move it from capiutil.c to
      capidrv.c and (obviously) stop exporting it.
      
      And, since we're touching this, merge the two versions of this
      function.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NTilman Schmidt <tilman@imap.cc>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca05e3a7
    • D
      Merge branch 'inet_csums' · 00d115fc
      David S. Miller 提交于
      Tom Herbert says:
      
      ====================
      net: Support checksum in UDP
      
      This patch series adds support for using checksums in UDP tunnels. With
      this it is possible that two or more checksums may be set within the
      same packet and we would like to do that efficiently.
      
      This series also creates some new helper functions to be used by various
      tunnel protocol implementations.
      
      v2: Fixed indentation in tcp_v6_send_check arguments.
      v3: Move udp_set_csum and udp6_set_csum to be not inlined
          Also have this functions call with a nocheck boolean argument
          instead of passing a sock structure.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00d115fc
    • T
      vxlan: Add support for UDP checksums (v4 sending, v6 zero csums) · 359a0ea9
      Tom Herbert 提交于
      Added VXLAN link configuration for sending UDP checksums, and allowing
      TX and RX of UDP6 checksums.
      
      Also, call common iptunnel_handle_offloads and added GSO support for
      checksums.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      359a0ea9
    • T
      gre: Call gso_make_checksum · 4749c09c
      Tom Herbert 提交于
      Call gso_make_checksum. This should have the benefit of using a
      checksum that may have been previously computed for the packet.
      
      This also adds NETIF_F_GSO_GRE_CSUM to differentiate devices that
      offload GRE GSO with and without the GRE checksum offloaed.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4749c09c
    • T
      net: Add GSO support for UDP tunnels with checksum · 0f4f4ffa
      Tom Herbert 提交于
      Added a new netif feature for GSO_UDP_TUNNEL_CSUM. This indicates
      that a device is capable of computing the UDP checksum in the
      encapsulating header of a UDP tunnel.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f4f4ffa
    • T
      tcp: Call gso_make_checksum · e9c3a24b
      Tom Herbert 提交于
      Call common gso_make_checksum when calculating checksum for a
      TCP GSO segment.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9c3a24b
    • T
      net: Support for multiple checksums with gso · 7e2b10c1
      Tom Herbert 提交于
      When creating a GSO packet segment we may need to set more than
      one checksum in the packet (for instance a TCP checksum and
      UDP checksum for VXLAN encapsulation). To be efficient, we want
      to do checksum calculation for any part of the packet at most once.
      
      This patch adds csum_start offset to skb_gso_cb. This tracks the
      starting offset for skb->csum which is initially set in skb_segment.
      When a protocol needs to compute a transport checksum it calls
      gso_make_checksum which computes the checksum value from the start
      of transport header to csum_start and then adds in skb->csum to get
      the full checksum. skb->csum and csum_start are then updated to reflect
      the checksum of the resultant packet starting from the transport header.
      
      This patch also adds a flag to skbuff, encap_hdr_csum, which is set
      in *gso_segment fucntions to indicate that a tunnel protocol needs
      checksum calculation
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e2b10c1
    • T
      l2tp: call udp{6}_set_csum · 77157e19
      Tom Herbert 提交于
      Call common functions to set checksum for UDP tunnel.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77157e19
    • T
      udp: Generic functions to set checksum · af5fcba7
      Tom Herbert 提交于
      Added udp_set_csum and udp6_set_csum functions to set UDP checksums
      in packets. These are for simple UDP packets such as those that might
      be created in UDP tunnels.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af5fcba7
    • D
      Merge branch 'bonding-macvlan' · 6579867c
      David S. Miller 提交于
      Vlad Yasevich says:
      
      ====================
      Fix support for macvlan devices on top bonding
      
      Currently, macvlan devices do not work well over bond interfaces.
      Everything works well, untill a failover is triggered in the bond
      device and then macvlan becomes unreachble untill arp entries
      are flushed.   This series adds needed functionality to
      handle correct notifications and update switches with mac addresses
      assigned to macvlans.
      
      The first patch simply addes IFF_UNICAST_FLT flag to bonds since they
      already correctly manage the unicast filter list of the slaves, so
      we might as well prevent the bond from needlessly going into promiscuous
      mode.
      
      The second patch adds notifier handler to macvlan to trigger correct
      ARP notifications.
      
      The third patch adds handling for TLB and RLB modes that use special
      ETH_P_LOOPBACK type packets to teach switch about mac addresses.
      It also allow ARPs for the macvlan mac addresses to be handled by
      RLB mode.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6579867c
    • V
      bonding: Support macvlans on top of tlb/rlb mode bonds · 14af9963
      Vlad Yasevich 提交于
      To make TLB mode work, the patch allows learning packets
      to be sent using mac addresses assigned to macvlan devices,
      also taking into an account vlans that may be between the
      bond and macvlan device.
      
      To make RLB work, all we have to do is accept ARP packets
      for addresses added to the bond dev->uc list.  Since RLB
      mode will take care to update the peers directly with
      correct mac addresses, learning packets for these addresses
      do not have be send to switch.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14af9963
    • V
      macvlan: Support bonding events · 4c991255
      Vlad Yasevich 提交于
      Bonding and team drivers generate specific events during failover
      that trigger switch updates.  When a macvlan device is configured
      on top of bonding, we want switches to learn about the macvlan
      devices as well.   This patch adds a handler to macvlan driver to
      propagate these events to all macvlan devices.  We let the generic
      inetdev event handler do the work.
      
      This allows macvlan to operated correctly over active-backup
      mode bond.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c991255
    • V
      bonding: Turn on IFF_UNICAST_FLT on bond devices · c565b488
      Vlad Yasevich 提交于
      Bonding devices manage the unicast filters of the underlying
      interfaces, but do not turn on IFF_UNICAST_FLT flag.  Thus
      anytime a unicast address is added to the bond, the bond is
      places in promiscuous mode.
      
      Turn on IFF_UNICAST_FLT on the bond device so that the bond does
      not go into promiscuous mode needlesly.  If an underlying device
      does not support unicast filtering, that device will automaticall
      enter promiscuous mode already.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c565b488
    • S
      net: Revert "fib_trie: use seq_file_net rather than seq->private" · f830b022
      Sasha Levin 提交于
      This reverts commit 30f38d2f.
      
      fib_triestat is surrounded by a big lie: while it claims that it's a
      seq_file (fib_triestat_seq_open, fib_triestat_seq_show), it isn't:
      
      	static const struct file_operations fib_triestat_fops = {
      	        .owner  = THIS_MODULE,
      	        .open   = fib_triestat_seq_open,
      	        .read   = seq_read,
      	        .llseek = seq_lseek,
      	        .release = single_release_net,
      	};
      
      Yes, fib_triestat is just a regular file.
      
      A small detail (assuming CONFIG_NET_NS=y) is that while for seq_files
      you could do seq_file_net() to get the net ptr, doing so for a regular
      file would be wrong and would dereference an invalid pointer.
      
      The fib_triestat lie claimed a victim, and trying to show the file would
      be bad for the kernel. This patch just reverts the issue and fixes
      fib_triestat, which still needs a rewrite to either be a seq_file or
      stop claiming it is.
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f830b022
    • A
      trivial: drivers/net/ethernet/nvidia/forcedeth.c: fix typo s/SUBSTRACT1/SUBTRACT1/ · cef33c81
      Antonio Ospite 提交于
      Signed-off-by: NAntonio Ospite <ao2@ao2.it>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexander Gordeev <agordeev@redhat.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cef33c81
    • X
      gianfar: Fix the section mismatch warnings. · 898157ed
      Xiubo Li 提交于
      Building with CONFIG_DEBUG_SECTION_MISMATCH enabled, the following
      WARNING is occured:
      
        LD      drivers/net/built-in.o
      WARNING: drivers/net/built-in.o(.text+0xcd4c): Section mismatch in
      reference from the function gfar_probe() to the function
      .init.text:gfar_init_addr_hash_table()
      The function gfar_probe() references
      the function __init gfar_init_addr_hash_table().
      This is often because gfar_probe lacks a __init
      annotation or the annotation of gfar_init_addr_hash_table is wrong.
      Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      898157ed
    • D
      Merge branch 'xen-netback-netfront-multiqueue' · 9ab89acc
      David S. Miller 提交于
      Wei Liu says:
      
      ====================
      This is rebased version of Andrew's V8 patch series. The original cover letter:
      
      --------------------
      xen-net{back,	front}: Multiple transmit and receive queues
      
      This patch series implements multiple transmit and receive queues (i.e.
      multiple shared rings) for the xen virtual network interfaces.
      
      The series is split up as follows:
       - Patch 1 brings the 'grant_copy_op' array back into struct xenvif, in
         preparation for multi-queue support. See the patch itself for more details.
      - Patches 2 and 4 factor out the queue-specific data for netback and
        netfront respectively, and modify the rest of the code to use these
        as appropriate.
      - Patches 3 and 5 introduce new XenStore keys to negotiate and use
        multiple shared rings and event channels, and code to connect these
        as appropriate.
      - Patch 6 documents the XenStore keys required for the new feature
        in include/xen/interface/io/netif.h
      
      All other transmit and receive processing remains unchanged, i.e. there
      is a kthread per queue and a NAPI context per queue.
      
      The performance of these patches has been analysed in detail, with
      results available at:
      
      http://wiki.xenproject.org/wiki/Xen-netback_and_xen-netfront_multi-queue_performance_testing
      
      To summarise:
        * Using multiple queues allows a VM to transmit at line rate on a 10
          Gbit/s NIC, compared with a maximum aggregate throughput of 6 Gbit/s
          with a single queue.
        * For intra-host VM--VM traffic, eight queues provide 171% of the
          throughput of a single queue; almost 12 Gbit/s instead of 6 Gbit/s.
        * There is a corresponding increase in total CPU usage, i.e. this is a
          scaling out over available resources, not an efficiency improvement.
        * Results depend on the availability of sufficient CPUs, as well as the
          distribution of interrupts and the distribution of TCP streams across
          the queues.
      
      Queue selection is currently achieved via an L4 hash on the packet (i.e.
      TCP src/dst port, IP src/dst address) and is not negotiated between the
      frontend and backend, since only one option exists. Future patches to
      support other frontends (particularly Windows) will need to add some
      capability to negotiate not only the hash algorithm selection, but also
      allow the frontend to specify some parameters to this.
      
      Note that queue selection is a decision by the transmitting system about
      which queue to use for a particular packet. In general, the algorithm
      may differ between the frontend and the backend with no adverse effects.
      
      Queue-specific XenStore entries for ring references and event channels
      are stored hierarchically, i.e. under .../queue-N/... where N varies
      from 0 to one less than the requested number of queues (inclusive). If
      only one queue is requested, it falls back to the flat structure where
      the ring references and event channels are written at the same level as
      other vif information.
      
      V8:
      - Squash the queue error handling code into patch 3.
      - Update the documentation (patch 6) according to comments on the
        equivalent patch to Xen.
      
      V7:
      - Rebase on latest net-next, which includes the netback grant mapping
        patch series from Zoltan Kiss
      - Reduce QUEUE_NAME_SIZE by 1 to avoid double-counting the trailing '\0'
      - Simplify the queue hashing by using (hash % num_queues) instead of
        multiply & shift.
      - Add ratelimited warning for invalid queue selection.
      - Fix error handling to correctly tear down already setup queues.
      - Use dev->real_num_tx_queues instead of separately maintaining a
        count of the number of queues.
      
      V6:
      - Use 'max_queues' as the module param. name for both netback and netfront.
      
      V5:
      - Fix bug in xenvif_free() that could lead to an attempt to transmit an
        skb after the queue structures had been freed.
      - Improve the XenStore protocol documentation in netif.h.
      - Fix IRQ_NAME_SIZE double-accounting for null terminator.
      - Move rx_gso_checksum_fixup stat into struct xenvif_stats (per-queue).
      - Don't initialise a local variable that is set in both branches (xspath).
      
      V4:
      - Add MODULE_PARM_DESC() for the multi-queue parameters for netback
        and netfront modules.
      - Move del_timer_sync() in netfront to after unregister_netdev, which
        restores the order in which these functions were called before applying
        these patches.
      
      V3:
      - Further indentation and style fixups.
      
      V2:
      - Rebase onto net-next.
      - Change queue->number to queue->id.
      - Add atomic operations around the small number of stats variables that
        are not queue-specific or per-cpu.
      - Fixup formatting and style issues.
      - XenStore protocol changes documented in netif.h.
      - Default max. number of queues to num_online_cpus().
      - Check requested number of queues does not exceed maximum.
      --------------------
      
      I rebased this on top of net-next. No functional change is introduced.  The
      patch that needed some extra care was "xen-netback: Factor queue-specific data
      into queue struct" because it clashed with a fix introduced in net. A simple
      test of creating guest, iperf, then shutting down guest worked as expected.
      
      The last patch fixes a minor problem that queue name is not initialised in
      xen-netfront, resulting in names like "-tx" "-rx" in /proc/interrupt.
      
      Changes since v9 (no functional change introduced):
      * include commit summary in the commit message of first patch
      * fold David Vrabel's Reviewed-by into last patch
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ab89acc