1. 27 Jun, 2014 16 commits
    • Jon Paul Maloy's avatar
      tipc: connection oriented transport uses new send functions · 4ccfe5e0
      Jon Paul Maloy authored
      We move the message sending across established connections
      to use the message preparation and send functions introduced
      earlier in this series. We now do the message preparation
      and call to the link send function directly from the socket,
      instead of going via the port layer.
      
      As a consequence of this change, the functions tipc_send(),
      tipc_port_iovec_rcv(), tipc_port_iovec_reject() and tipc_reject_msg()
      become unreferenced and can be eliminated from port.c. For the same
      reason, the functions tipc_link_xmit_fast(), tipc_link_iovec_xmit_long()
      and tipc_link_iovec_fast() can be eliminated from link.c.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ccfe5e0
    • Jon Paul Maloy's avatar
      tipc: RDM/DGRAM transport uses new fragmenting and sending functions · e2dafe87
      Jon Paul Maloy authored
      We merge the code for sending port name and port identity addressed
      messages into the corresponding send functions in socket.c, and start
      using the new fragmenting and transmit functions we just have introduced.
      
      This saves a call level and quite a few code lines, as well as making
      this part of the code easier to follow. As a consequence, the functions
      tipc_send2name() and tipc_send2port() in port.c can be removed.
      
      For practical reasons, we break out the code for sending multicast messages
      from tipc_sendmsg() and move it into a separate function, tipc_sendmcast(),
      but we do not yet convert it into using the new build/send functions.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2dafe87
    • Jon Paul Maloy's avatar
      tipc: introduce message evaluation function · 5a379074
      Jon Paul Maloy authored
      When a message arrives in a node and finds no destination
      socket, we may need to drop it, reject it, or forward it after
      a secondary destination lookup. The latter two cases currently
      results in a code path that is perceived as complex, because it
      follows a deep call chain via obscure functions such as
      net_route_named_msg() and net_route_msg().
      
      We now introduce a function, tipc_msg_eval(), that takes the
      decision about whether such a message should be rejected or
      forwarded, but leaves it to the caller to actually perform
      the indicated action.
      
      If the decision is 'reject', it is still the task of the recently
      introduced function tipc_msg_reverse() to take the final decision
      about whether the message is rejectable or not. In the latter case
      it drops the message.
      
      As a result of this change, we can finally eliminate the function
      net_route_named_msg(), and hence become independent of net_route_msg().
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a379074
    • Jon Paul Maloy's avatar
      tipc: separate building and sending of rejected messages · 8db1bae3
      Jon Paul Maloy authored
      The way we build and send rejected message is currenty perceived as
      hard to follow, partly because we let the transmission go via deep
      call chains through functions such as tipc_reject_msg() and
      net_route_msg().
      
      We want to remove those functions, and make the call sequences shallower
      and simpler. For this purpose, we separate building and sending of
      rejected messages. We build the reject message using the new function
      tipc_msg_reverse(), and let the transmission go via the newly introduced
      tipc_link_xmit2() function, as all transmission eventually will do. We
      also ensure that all calls to tipc_link_xmit2() are made outside
      port_lock/bh_lock_sock.
      
      Finally, we replace all calls to tipc_reject_msg() with the two new
      calls at all locations in the code that we want to keep. The remaining
      calls are made from code that we are planning to remove, along with
      tipc_reject_msg() itself.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8db1bae3
    • Jon Paul Maloy's avatar
      tipc: introduce direct iovec to buffer chain fragmentation function · 067608e9
      Jon Paul Maloy authored
      Fragmentation at message sending is currently performed in two
      places in link.c, depending on whether data to be transmitted
      is delivered in the form of an iovec or as a big sk_buff. Those
      functions are also tightly entangled with the send functions
      that are using them.
      
      We now introduce a re-entrant, standalone function, tipc_msg_build2(),
      that builds a packet chain directly from an iovec. Each fragment is
      sized according to the MTU value given by the caller, and is prepended
      with a correctly built fragment header, when needed. The function is
      independent from who is calling and where the chain will be delivered,
      as long as the caller is able to indicate a correct MTU.
      
      The function is tested, but not called by anybody yet. Since it is
      incompatible with the existing tipc_msg_build(), and we cannot yet
      remove that function, we have given it a temporary name.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      067608e9
    • Jon Paul Maloy's avatar
      tipc: make link mtu easily accessible from socket · 16e166b8
      Jon Paul Maloy authored
      Message fragmentation is currently performed at link level, inside
      the protection of node_lock. This potentially binds up the sending
      link structure for a long time, instead of letting it do other tasks,
      such as handle reception of new packets.
      
      In this commit, we make the MTUs of each active link become easily
      accessible from the socket level, i.e., without taking any spinlock
      or dereferencing the target link pointer. This way, we make it possible
      to perform fragmentation in the sending socket, before sending the
      whole fragment chain to the link for transport.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16e166b8
    • Jon Paul Maloy's avatar
      tipc: introduce send functions for chained buffers in link · 4f1688b2
      Jon Paul Maloy authored
      The current link implementation provides several different transmit
      functions, depending on the characteristics of the message to be
      sent: if it is an iovec or an sk_buff, if it needs fragmentation or
      not, if the caller holds the node_lock or not. The permutation of
      these options gives us an unwanted amount of unnecessarily complex
      code.
      
      As a first step towards simplifying the send path for all messages,
      we introduce two new send functions at link level, tipc_link_xmit2()
      and __tipc_link_xmit2(). The former looks up a link to the message
      destination, and if one is found, it grabs the node lock and calls
      the second function, which works exclusively inside the node lock
      protection. If no link is found, and the destination is on the same
      node, it delivers the message directly to the local destination
      socket.
      
      The new functions take a buffer chain where all packet headers are
      already prepared, and the correct MTU has been used. These two
      functions will later replace all other link-level transmit functions.
      
      The functions are not backwards compatible, so we have added them
      as new functions with temporary names. They are tested, but have no
      users yet. Those will be added later in this series.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f1688b2
    • Jon Paul Maloy's avatar
      tipc: use negative error return values in functions · e4de5fab
      Jon Paul Maloy authored
      In some places, TIPC functions returns positive integers as return
      codes. This goes against standard Linux coding practice, and may
      even cause problems in some cases.
      
      We now change the return values of the functions filter_rcv()
      and filter_connect() to become signed integers, and return
      negative error codes when needed. The codes we use in these
      particular cases are still TIPC specific, since they are both
      part of the TIPC API and have no correspondence in errno.h
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4de5fab
    • Jon Paul Maloy's avatar
      tipc: eliminate case of writing to freed memory · 3d09fc42
      Jon Paul Maloy authored
      In the function tipc_nodesub_notify() we call a function pointer
      aggregated into the object to be notified, whereafter we set
      the function pointer to NULL. However, in some cases the function
      pointed to will free the struct containing the function pointer,
      resulting in a write to already freed memory.
      
      This bug seems to always have been there, without causing any
      notable harm.
      
      In this commit we fix the problem by inverting the order of the
      zeroing and the function call.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d09fc42
    • David S. Miller's avatar
      Merge branch 'xgbe-next' · f5b26503
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD 10Gb Ethernet driver updates
      
      The following series fixes some bugs and provides new/changed support
      in the driver.
      
      - Make all the defines in the xgbe.h file unique by prefixing them with
        XGBE_ if they are not currently using the prefix.
      - VLAN CTAGs are supplied in context descriptors. Tell the hardware to
        look in the Tx context descriptor, and not a register, for the VLAN CTAG
        to be inserted in the packet.
      - The hardware will indicate a VLAN packet has been received even if VLAN
        CTAG stripping is currently disabled.  Only indicate that a VLAN CTAG
        has been stripped for the current packet if stripping is enabled.
      - Add support for VLAN filtering
      - Modify destination address filtering to use the hardware hash tables
      - Eliminate a checkpatch warning by replacing sscanf with kstrtouint
      
      This patch series is based on net-next.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f5b26503
    • Lendacky, Thomas's avatar
      amd-xgbe: Resolve checkpatch warning about sscanf usage · 66f95c35
      Lendacky, Thomas authored
      Checkpatch issued a warning preferring to use kstrto<type> when
      using a single variable sscanf.  Change the sscanf invocation to
      a kstrtouint call.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      66f95c35
    • Lendacky, Thomas's avatar
      amd-xgbe: Change destination address filtering support · b85e4d89
      Lendacky, Thomas authored
      Currently the driver makes use of the additional mac address
      registers in the hardware to provide perfect filtering.  The
      hardware can also have a set of hash table registers that can
      be used for imperfect filtering.  By using imperfect filtering
      the additional mac address registers can be used for layer 2
      filtering support.  Use the hash table registers if the device
      has them.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b85e4d89
    • Lendacky, Thomas's avatar
      amd-xgbe: Add support for VLAN filtering · 801c62d9
      Lendacky, Thomas authored
      This patch adds support for (imperfect) filtering of
      VLAN tag ids using a 16-bit filter hash table.  When
      VLANs are added, a 4-bit hash is calculated with the
      result indicating the bit in the hash table to set.
      This table is used by the hardware to drop packets with
      a VLAN id that does not hash to a set bit in the table.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      801c62d9
    • Lendacky, Thomas's avatar
      amd-xgbe: VLAN Rx tag stripping fix · c52e9c63
      Lendacky, Thomas authored
      When receiving a VLAN packet check to be sure that VLAN
      RX CTAG stripping is enabled before indicating that the
      tag has been stripped in the packet information data
      structure.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c52e9c63
    • Lendacky, Thomas's avatar
      amd-xgbe: VLAN Tx tag insertion fix · 6e5eed04
      Lendacky, Thomas authored
      The MAC_VLAN_Incl register (0x0060) must be set to indicate
      that the VLAN tag to be inserted comes from a Tx context
      descriptor and not the MAC_VLAN_Incl register.  Also, even
      though it is the default, explicitly set the type of tag to
      be inserted as a CTAG.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e5eed04
    • Lendacky, Thomas's avatar
      amd-xgbe: Make defines in xgbe.h unique · d0a8ba6c
      Lendacky, Thomas authored
      In order to avoid conflicts with other include files, add
      a prefix to the defines in xgbe.h.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0a8ba6c
  2. 26 Jun, 2014 11 commits
    • David S. Miller's avatar
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · d7933ab7
      Linus Torvalds authored
      Pull CIFS fixes from Steve French:
       "Small set of misc cifs/smb3 fixes"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        [CIFS] fix mount failure with broken pathnames when smb3 mount with mapchars option
        cifs: revalidate mapping prior to satisfying read_iter request with cache=loose
        fs/cifs: fix regression in cifs_create_mf_symlink()
      d7933ab7
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 2a80ff86
      Linus Torvalds authored
      Pull hwmon fixes from Guenter Roeck:
       "Various minor fixes"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (gpio-fan) Change name used in hwmon_device_register_with_groups
        hwmon: (emc1403) Fix missing 'select REGMAP_I2C' in Kconfig
        hwmon: (ntc_thermistor) Use the manufacturer name properly
        devicetree: bindings: Document murata vendor prefix
        hwmon: (w83l786ng) Report correct minimum fan speed
      2a80ff86
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f40ede39
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix crash in ipvs tot_stats estimator, from Julian Anastasov.
      
       2) Fix OOPS in nf_nat on netns removal, from Florian Westphal.
      
       3) Really really really fix locking issues in slip and slcan tty write
          wakeups, from Tyler Hall.
      
       4) Fix checksum offloading in fec driver, from Fugang Duan.
      
       5) Off by one in BPF instruction limit test, from Kees Cook.
      
       6) Need to clear all TSO capability flags when doing software TSO in
          tg3 driver, from Prashant Sreedharan.
      
       7) Fix memory leak in vlan_reorder_header() error path, from Li
          RongQing.
      
       8) Fix various bugs in xen-netfront and xen-netback multiqueue support,
          from David Vrabel and Wei Liu.
      
       9) Fix deadlock in cxgb4 driver, from Li RongQing.
      
      10) Prevent double free of no-cache DST entries, from Eric Dumazet.
      
      11) Bad csum_start handling in skb_segment() leads to crashes when
          forwarding, from Tom Herbert.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (76 commits)
        net: fix setting csum_start in skb_segment()
        ipv4: fix dst race in sk_dst_get()
        net: filter: Use kcalloc/kmalloc_array to allocate arrays
        trivial: net: filter: Change kerneldoc parameter order
        trivial: net: filter: Fix typo in comment
        net: allwinner: emac: Add missing free_irq
        cxgb4: use dev_port to identify ports
        xen-netback: bookkeep number of active queues in our own module
        tg3: Change nvram command timeout value to 50ms
        cxgb4: Not need to hold the adap_rcu_lock lock when read adap_rcu_list
        be2net: fix qnq mode detection on VFs
        of: mdio: fixup of_phy_register_fixed_link parsing of new bindings
        at86rf230: fix irq setup
        net: phy: at803x: fix coccinelle warnings
        net/mlx4_core: Fix the error flow when probing with invalid VF configuration
        tulip: Poll link status more frequently for Comet chips
        net: huawei_cdc_ncm: increase command buffer size
        drivers: net: cpsw: fix dual EMAC stall when connected to same switch
        xen-netfront: recreate queues correctly when reconnecting
        xen-netfront: fix oops when disconnected from backend
        ...
      f40ede39
    • Tom Herbert's avatar
      net: fix setting csum_start in skb_segment() · de843723
      Tom Herbert authored
      Dave Jones reported that a crash is occurring in
      
      csum_partial
      tcp_gso_segment
      inet_gso_segment
      ? update_dl_migration
      skb_mac_gso_segment
      __skb_gso_segment
      dev_hard_start_xmit
      sch_direct_xmit
      __dev_queue_xmit
      ? dev_hard_start_xmit
      dev_queue_xmit
      ip_finish_output
      ? ip_output
      ip_output
      ip_forward_finish
      ip_forward
      ip_rcv_finish
      ip_rcv
      __netif_receive_skb_core
      ? __netif_receive_skb_core
      ? trace_hardirqs_on
      __netif_receive_skb
      netif_receive_skb_internal
      napi_gro_complete
      ? napi_gro_complete
      dev_gro_receive
      ? dev_gro_receive
      napi_gro_receive
      
      It looks like a likely culprit is that SKB_GSO_CB()->csum_start is
      not set correctly when doing non-scatter gather. We are using
      offset as opposed to doffset.
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Tested-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Fixes: 7e2b10c1 ("net: Support for multiple checksums with gso")
      Acked-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de843723
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-3.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · ec71feae
      Linus Torvalds authored
      Pull NFS client fixes from Trond Myklebust:
       "Highlights include:
      
         - Stable fix for a data corruption case due to incorrect cache
           validation
         - Fix a couple of false positive cache invalidations
         - Fix NFSv4 security negotiation issues"
      
      * tag 'nfs-for-3.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFSv4: test SECINFO RPC_AUTH_GSS pseudoflavors for support
        NFS Return -EPERM if no supported or matching SECINFO flavor
        NFS check the return of nfs4_negotiate_security in nfs4_submount
        NFS: Don't mark the data cache as invalid if it has been flushed
        NFS: Clear NFS_INO_REVAL_PAGECACHE when we update the file size
        nfs: Fix cache_validity check in nfs_write_pageuptodate()
      ec71feae
    • Geert Uytterhoeven's avatar
      enic: Make dummy rfs functions inline to fix !CONFIG_RFS_ACCEL build · 644a918d
      Geert Uytterhoeven authored
      If CONFIG_RFS_ACCEL=n:
      
      drivers/net/ethernet/cisco/enic/enic_main.c: In function 'enic_open':
      drivers/net/ethernet/cisco/enic/enic_main.c:1603:2: error: implicit declaration of function 'enic_rfs_flw_tbl_init' [-Werror=implicit-function-declaration]
      drivers/net/ethernet/cisco/enic/enic_main.c: In function 'enic_stop':
      drivers/net/ethernet/cisco/enic/enic_main.c:1630:2: error: implicit declaration of function 'enic_rfs_flw_tbl_free' [-Werror=implicit-function-declaration]
      
      Introduced in commit a145df23 ("enic: Add
      Accelerated RFS support").
      
      Dummy functions are provided, but their prototypes are missing, causing the
      build failure.  Provide dummy static inline functions instead to fix this.
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      644a918d
    • Erik Hugne's avatar
      tipc: bump max configurable window size · a6eacef7
      Erik Hugne authored
      The maximum window size is limited by the sequence gap field, which
      was expanded with bd784533
      ("tipc: Expand link sequence gap field to 13 bits")
      We remove the artificial limit that prevents the link window to be
      set larger than 150.
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6eacef7
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · 0b2fda89
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2014-06-24
      
      This series contains updates to i40e and i40evf.
      
      Greg provides a patch to stop the VF device after setting its MAC address.
      This is due to if the host VMM administrator has changed the VF device's MAC
      address then the i40e driver needs to halt the VF device so that the
      administrator will be forced to reload the VF driver so that the VF driver
      will start using the newly assigned MAC address.
      
      Shannon provides several patches for i40e, first makes prep_for_test() a
      void function since the return value was being ignored for the most part
      by all its callers.  Adds a log warning when the firmware's API minor/major
      number is not what we expect to assist the user by informing them they
      may need to update their NVM or SW.  Cleans up a stray print message
      so that it is similar to other print messages.  Ensures to set the
      WoL flag when setting LAA and allow the user to set LAA again.  So do
      not short-circuit the LAA assignment when the driver thinks it has
      already been done as it is possible that the user might want to force
      the address setting again.  Provides a couple more LAA fixes to ensure
      the LAA gets restored after resets.
      
      Neerav provides a patch for i40e to add a PF reset when a malicious driver
      event for the PF occurs.  As per the specification when the PF driver
      receives a malicious driver event the queue that caused the event is
      already stopped and it is expected that the function that owns the queue
      will reset the queue, but in some cases it may not be possible to determine
      the queue, so it is suggested to reset the whole function.
      
      Carolyn fixes ethtool coalesce settings to allow 0 as a disable value and
      adds message to user about invalid values.
      
      Jesse removes a reserved type which was not removed from the code.
      
      Catherine provides a patch to add the ability to enable/disable link from
      set_link)restart_an() which will make it easy to toggle link without
      calling set_phy_config() when no other link settings need to change.
      
      Anjali provides a patch to ensure we do a PF reset on Tx hang and that
      way we avoid any Malicious Driver Detect (MDD) events because of a Tx
      queue disable failure.
      
      v2:
       - fixed the un-needed return in patch 2 based on feedback from Sergei Shtylyov
       - added punctuation to print statements and code comment based on
         feedback from Sergei Shtylyov
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b2fda89
    • Joe Perches's avatar
      mac_pton: Use bool not int return · a69f5edb
      Joe Perches authored
      Use bool instead of int as the return type.
      
      All uses are tested with !.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a69f5edb
    • Eric Dumazet's avatar
      ipv4: fix dst race in sk_dst_get() · f8864972
      Eric Dumazet authored
      When IP route cache had been removed in linux-3.6, we broke assumption
      that dst entries were all freed after rcu grace period. DST_NOCACHE
      dst were supposed to be freed from dst_release(). But it appears
      we want to keep such dst around, either in UDP sockets or tunnels.
      
      In sk_dst_get() we need to make sure dst refcount is not 0
      before incrementing it, or else we might end up freeing a dst
      twice.
      
      DST_NOCACHE set on a dst does not mean this dst can not be attached
      to a socket or a tunnel.
      
      Then, before actual freeing, we need to observe a rcu grace period
      to make sure all other cpus can catch the fact the dst is no longer
      usable.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarDormando <dormando@rydia.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8864972
  3. 25 Jun, 2014 13 commits