1. 09 10月, 2013 3 次提交
    • E
      tcp/dccp: remove twchain · 05dbc7b5
      Eric Dumazet 提交于
      TCP listener refactoring, part 3 :
      
      Our goal is to hash SYN_RECV sockets into main ehash for fast lookup,
      and parallel SYN processing.
      
      Current inet_ehash_bucket contains two chains, one for ESTABLISH (and
      friend states) sockets, another for TIME_WAIT sockets only.
      
      As the hash table is sized to get at most one socket per bucket, it
      makes little sense to have separate twchain, as it makes the lookup
      slightly more complicated, and doubles hash table memory usage.
      
      If we make sure all socket types have the lookup keys at the same
      offsets, we can use a generic and faster lookup. It turns out TIME_WAIT
      and ESTABLISHED sockets already have common lookup fields for IPv4.
      
      [ INET_TW_MATCH() is no longer needed ]
      
      I'll provide a follow-up to factorize IPv6 lookup as well, to remove
      INET6_TW_MATCH()
      
      This way, SYN_RECV pseudo sockets will be supported the same.
      
      A new sock_gen_put() helper is added, doing either a sock_put() or
      inet_twsk_put() [ and will support SYN_RECV later ].
      
      Note this helper should only be called in real slow path, when rcu
      lookup found a socket that was moved to another identity (freed/reused
      immediately), but could eventually be used in other contexts, like
      sock_edemux()
      
      Before patch :
      
      dmesg | grep "TCP established"
      
      TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
      
      After patch :
      
      TCP established hash table entries: 524288 (order: 10, 4194304 bytes)
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05dbc7b5
    • S
      net: ipv4 only populate IP_PKTINFO when needed · fbf8866d
      Shawn Bohrer 提交于
      The since the removal of the routing cache computing
      fib_compute_spec_dst() does a fib_table lookup for each UDP multicast
      packet received.  This has introduced a performance regression for some
      UDP workloads.
      
      This change skips populating the packet info for sockets that do not have
      IP_PKTINFO set.
      
      Benchmark results from a netperf UDP_RR test:
      Before 89789.68 transactions/s
      After  90587.62 transactions/s
      
      Benchmark results from a fio 1 byte UDP multicast pingpong test
      (Multicast one way unicast response):
      Before 12.63us RTT
      After  12.48us RTT
      Signed-off-by: NShawn Bohrer <sbohrer@rgmadvisors.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fbf8866d
    • S
      udp: ipv4: Add udp early demux · 421b3885
      Shawn Bohrer 提交于
      The removal of the routing cache introduced a performance regression for
      some UDP workloads since a dst lookup must be done for each packet.
      This change caches the dst per socket in a similar manner to what we do
      for TCP by implementing early_demux.
      
      For UDP multicast we can only cache the dst if there is only one
      receiving socket on the host.  Since caching only works when there is
      one receiving socket we do the multicast socket lookup using RCU.
      
      For UDP unicast we only demux sockets with an exact match in order to
      not break forwarding setups.  Additionally since the hash chains may be
      long we only check the first socket to see if it is a match and not
      waste extra time searching the whole chain when we might not find an
      exact match.
      
      Benchmark results from a netperf UDP_RR test:
      Before 87961.22 transactions/s
      After  89789.68 transactions/s
      
      Benchmark results from a fio 1 byte UDP multicast pingpong test
      (Multicast one way unicast response):
      Before 12.97us RTT
      After  12.63us RTT
      Signed-off-by: NShawn Bohrer <sbohrer@rgmadvisors.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      421b3885
  2. 08 10月, 2013 1 次提交
    • A
      net: fix unsafe set_memory_rw from softirq · d45ed4a4
      Alexei Starovoitov 提交于
      on x86 system with net.core.bpf_jit_enable = 1
      
      sudo tcpdump -i eth1 'tcp port 22'
      
      causes the warning:
      [   56.766097]  Possible unsafe locking scenario:
      [   56.766097]
      [   56.780146]        CPU0
      [   56.786807]        ----
      [   56.793188]   lock(&(&vb->lock)->rlock);
      [   56.799593]   <Interrupt>
      [   56.805889]     lock(&(&vb->lock)->rlock);
      [   56.812266]
      [   56.812266]  *** DEADLOCK ***
      [   56.812266]
      [   56.830670] 1 lock held by ksoftirqd/1/13:
      [   56.836838]  #0:  (rcu_read_lock){.+.+..}, at: [<ffffffff8118f44c>] vm_unmap_aliases+0x8c/0x380
      [   56.849757]
      [   56.849757] stack backtrace:
      [   56.862194] CPU: 1 PID: 13 Comm: ksoftirqd/1 Not tainted 3.12.0-rc3+ #45
      [   56.868721] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
      [   56.882004]  ffffffff821944c0 ffff88080bbdb8c8 ffffffff8175a145 0000000000000007
      [   56.895630]  ffff88080bbd5f40 ffff88080bbdb928 ffffffff81755b14 0000000000000001
      [   56.909313]  ffff880800000001 ffff880800000000 ffffffff8101178f 0000000000000001
      [   56.923006] Call Trace:
      [   56.929532]  [<ffffffff8175a145>] dump_stack+0x55/0x76
      [   56.936067]  [<ffffffff81755b14>] print_usage_bug+0x1f7/0x208
      [   56.942445]  [<ffffffff8101178f>] ? save_stack_trace+0x2f/0x50
      [   56.948932]  [<ffffffff810cc0a0>] ? check_usage_backwards+0x150/0x150
      [   56.955470]  [<ffffffff810ccb52>] mark_lock+0x282/0x2c0
      [   56.961945]  [<ffffffff810ccfed>] __lock_acquire+0x45d/0x1d50
      [   56.968474]  [<ffffffff810cce6e>] ? __lock_acquire+0x2de/0x1d50
      [   56.975140]  [<ffffffff81393bf5>] ? cpumask_next_and+0x55/0x90
      [   56.981942]  [<ffffffff810cef72>] lock_acquire+0x92/0x1d0
      [   56.988745]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   56.995619]  [<ffffffff817628f1>] _raw_spin_lock+0x41/0x50
      [   57.002493]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   57.009447]  [<ffffffff8118f52a>] vm_unmap_aliases+0x16a/0x380
      [   57.016477]  [<ffffffff8118f44c>] ? vm_unmap_aliases+0x8c/0x380
      [   57.023607]  [<ffffffff810436b0>] change_page_attr_set_clr+0xc0/0x460
      [   57.030818]  [<ffffffff810cfb8d>] ? trace_hardirqs_on+0xd/0x10
      [   57.037896]  [<ffffffff811a8330>] ? kmem_cache_free+0xb0/0x2b0
      [   57.044789]  [<ffffffff811b59c3>] ? free_object_rcu+0x93/0xa0
      [   57.051720]  [<ffffffff81043d9f>] set_memory_rw+0x2f/0x40
      [   57.058727]  [<ffffffff8104e17c>] bpf_jit_free+0x2c/0x40
      [   57.065577]  [<ffffffff81642cba>] sk_filter_release_rcu+0x1a/0x30
      [   57.072338]  [<ffffffff811108e2>] rcu_process_callbacks+0x202/0x7c0
      [   57.078962]  [<ffffffff81057f17>] __do_softirq+0xf7/0x3f0
      [   57.085373]  [<ffffffff81058245>] run_ksoftirqd+0x35/0x70
      
      cannot reuse jited filter memory, since it's readonly,
      so use original bpf insns memory to hold work_struct
      
      defer kfree of sk_filter until jit completed freeing
      
      tested on x86_64 and i386
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d45ed4a4
  3. 04 10月, 2013 3 次提交
  4. 03 10月, 2013 8 次提交
    • D
      Bluetooth: Add the definition for Slave Page Response Timeout · 2ed01805
      DoHyun Pyun 提交于
      The Slave Page Response Timeout event indicates to the Host that a
      slave page response timeout has occurred in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 110
      
      "7.7.72 Slave Page Response Timeout Event [New Section]
      ...
      Note: this event will be generated if the slave BR/EDR Controller
      responds to a page but does not receive the master FHS packet
      (see Baseband, Section 8.3.3) within pagerespTO.
      
      Event Parameters: NONE"
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2ed01805
    • D
      Bluetooth: Add the definition and stcuture for Sync Train Complete · 2b359445
      DoHyun Pyun 提交于
      The Synchronization Train Complete event indicates that the Start
      Synchronization Train command has completed.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 103
      
      "7.7.67 Synchronization Train Complete Event [New Section]
      ...
      
      Event Parameters:
      
      Status 0x00       Start Synchronization Train command completed
                        successfully.
             0x01-0xFF  Start Synchronization Train command failed.
                        See Part D, Error Codes, for error codes and
                        descriptions."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2b359445
    • D
      Bluetooth: Add the definition for Start Synchronization Train · cefded98
      DoHyun Pyun 提交于
      The Start_Synchronization_Train command controls the Synchronization
      Train functionality in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 86
      
      "7.1.51 Start Synchronization Train Command [New Section]
      ...
      If connectionless slave broadcast mode is not enabled, the Command
      Disallowed (0x0C) error code shall be returned. After receiving this
      command and returning a Command Status event, the Baseband starts
      attempting to send synchronization train packets containing information
      related to the enabled Connectionless Slave Broadcast packet timing.
      
      Note: The AFH_Channel_Map used in the synchronization train packets is
      configured by the Set_AFH_Channel_Classification command and the local
      channel classification in the BR/EDR Controller.
      
      The synchronization train packets will be sent using the parameters
      specified by the latest Write_Synchronization_Train_Parameters command.
      The Synchronization Train will continue until synchronization_trainTO
      slots (as specified in the last Write_Synchronization_Train command)
      have passed or until the Host disables the Connectionless Slave Broadcast
      logical transport."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      cefded98
    • D
      Bluetooth: Add the definition and structure for Set CSB · 8c9a041b
      DoHyun Pyun 提交于
      he Set_Connectionless_Slave_Broadcast command controls the
      Connectionless Slave Broadcast functionality in the BR/EDR
      Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 78
      
      "7.1.49 Set Connectionless Slave Broadcast Command [New Section]
      ...
      The LT_ADDR indicated in the Set_Connectionless_Slave_Broadcast shall be
      pre-allocated using the HCI_Set_Reserved_LT_ADDR command. If the
      LT_ADDR has not been reserved, the Unknown Connection Identifier (0x02)
      error code shall be returned. If the controller is unable to reserve
      sufficient bandwidth for the requested activity, the Connection Rejected
      Due to Limited Resources (0x0D) error code shall be returned.
      
      The LPO_Allowed parameter informs the BR/EDR Controller whether it is
      allowed to sleep.
      
      The Packet_Type parameter specifies which packet types are allowed. The
      Host shall either enable BR packet types only, or shall enable EDR and DM1
      packet types only.
      
      The Interval_Min and Interval_Max parameters specify the range from which
      the BR/EDR Controller must select the Connectionless Slave Broadcast
      Interval. The selected Interval is returned."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      8c9a041b
    • D
      Bluetooth: Add the structure for Write Sync Train Parameters · a9b07a64
      DoHyun Pyun 提交于
      The Write_Synchronization_Train_Parameters command configures
      the Synchronization Train functionality in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 97
      
      "7.3.90 Write Synchronization Train Parameters Command [New Section]
      ...
      Note: The AFH_Channel_Map used in the Synchronization Train packets is
      configured by the Set_AFH_Channel_Classification command and the local
      channel classification in the BR/EDR Controller.
      
      Interval_Min and Interval_Max specify the allowed range of
      Sync_Train_Interval. Refer to [Vol. 2], Part B, section 2.7.2 for
      a detailed description of Sync_Train_Interval. The BR/EDR Controller shall
      select an interval from this range and return it in Sync_Train_Interval.
      If the Controller is unable to select a value from this range, it shall
      return the Invalid HCI Command Parameters (0x12) error code.
      
      Once started (via the Start_Synchronization_Train Command) the
      Synchronization Train will continue until synchronization_trainTO slots have
      passed or Connectionless Slave Broadcast has been disabled."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a9b07a64
    • D
      Bluetooth: Add the definition and structure for Set CSB Data · 7d1dab49
      DoHyun Pyun 提交于
      The Set_Connectionless_Slave_Broadcast_Data command provides the
      ability for the Host to set Connectionless Slave Broadcast data in
      the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 93
      
      "7.3.88 Set Connectionless Slave Broadcast Data Command [New Section]
      ...
      If connectionless slave broadcast mode is disabled, this data shall be
      kept by the BR/EDR Controller and used once connectionless slave broadcast
      mode is enabled. If connectionless slave broadcast mode is enabled,
      and this command is successful, this data will be sent starting with
      the next Connectionless Slave Broadcast instant.
      
      The Data_Length field may be zero, in which case no data needs to be
      provided.
      
      The Host may fragment the data using the Fragment field in the command. If
      the combined length of the fragments exceeds the capacity of the largest
      allowed packet size specified in the Set Connectionless Slave Broadcast
      command, all fragments associated with the data being assembled shall be
      discarded and the Invalid HCI Command Parameters error (0x12) shall be
      returned."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      7d1dab49
    • D
      Bluetooth: Add the definition and structure for Delete Reserved LT_ADDR · 6a20eaf4
      DoHyun Pyun 提交于
      The Delete_Reserved_LT_ADDR command requests that the BR/EDR
      Controller cancel the reservation for a specific LT_ADDR reserved for the
      purposes of Connectionless Slave Broadcast.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 92
      
      "7.3.87 Delete Reserved LT_ADDR Command [New Section]
      ...
      If the LT_ADDR indicated in the LT_ADDR parameter is not reserved by the
      BR/EDR Controller, it shall return the Unknown Connection Identifier (0x02)
      error code.
      If connectionless slave broadcast mode is still active, then the Controller
      shall return the Command Disallowed (0x0C) error code."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6a20eaf4
    • D
      Bluetooth: Add the definition and structure for Set Reserved LT_ADDR · d0bf75a5
      DoHyun Pyun 提交于
      The Set_Reserved_LT_ADDR command allows the host to request that the
      BR/EDR Controller reserve a specific LT_ADDR for Connectionless Slave
      Broadcast.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 90
      
      "7.3.86 Set Reserved LT_ADDR Command [New Section]
      ...
      If the LT_ADDR indicated in the LT_ADDR parameter is already in use by the
      BR/EDR Controller, it shall return the ACL Connection Already Exists (0x0B)
      error code. If the LT_ADDR indicated in the LT_ADDR parameter is out of
      range, the controller shall return the Invalid HCI Command Parameters (0x12)
      error code. If the command succeeds, then the reserved LT_ADDR shall be
      used when issuing subsequent Set Connectionless Slave Broadcast Data and
      Set Connectionless Slave Broadcast commands.
      To ensure that the reserved LT_ADDR is not already allocated, it is
      recommended that this command be issued at some point after HCI_Reset is
      issued but before page scanning is enabled or paging is initiated."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d0bf75a5
  5. 02 10月, 2013 5 次提交
    • M
      Bluetooth: Add management command for setting static address · d13eafce
      Marcel Holtmann 提交于
      On dual-mode BR/EDR/LE and LE only controllers it is possible
      to configure a random address. There are two types or random
      addresses, one is static and the other private. Since the
      random private addresses require special privacy feature to
      be supported, the configuration of these two are kept separate.
      
      This command allows for setting the static random address. It is
      only supported on controllers with LE support. The static random
      address is suppose to be valid for the lifetime of the controller
      or at least until the next power cycle. To ensure such behavior,
      setting of the address is limited to when the controller is
      powered off.
      
      The special BDADDR_ANY address (00:00:00:00:00:00) can be used to
      disable the static address. This is also the default value.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      d13eafce
    • J
      Bluetooth: Add a new mgmt_set_bredr command · 0663ca2a
      Johan Hedberg 提交于
      This patch introduces a new mgmt command for enabling/disabling BR/EDR
      functionality. This can be convenient when one wants to make a dual-mode
      controller behave like a single-mode one. The command is only available
      for dual-mode controllers and requires that LE is enabled before using
      it. The BR/EDR setting can be enabled at any point, however disabling it
      requires the controller to be powered off (otherwise a "rejected"
      response will be sent).
      
      Disabling the BR/EDR setting will automatically disable all other BR/EDR
      related settings.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0663ca2a
    • J
      Bluetooth: Introduce a new HCI_BREDR_ENABLED flag · 56f87901
      Johan Hedberg 提交于
      To allow treating dual-mode (BR/EDR/LE) controllers as single-mode ones
      (LE-only) we want to introduce a new HCI_BREDR_ENABLED flag to track
      whether BR/EDR is enabled or not (previously we simply looked at the
      feature bit with lmp_bredr_enabled).
      
      This patch add the new flag and updates the relevant places to test
      against it instead of using lmp_bredr_enabled. The flag is by default
      enabled when registering an adapter and only cleared if necessary once
      the local features have been read during the HCI init procedure.
      
      We cannot completely block BR/EDR usage in case user space uses raw HCI
      sockets but the patch tries to block this in places where possible, such
      as the various BR/EDR specific ioctls.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      56f87901
    • M
      Bluetooth: Provide high speed configuration option · 848566b3
      Marcel Holtmann 提交于
      Hiding the Bluetooth high speed support behind a module parameter is
      not really useful. This can be enabled and disabled at runtime via
      the management interface. This also has the advantage that this can
      now be changed per controller and not just global.
      
      This patch removes the module parameter and exposes the high speed
      setting of the management interface to all controllers.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      848566b3
    • M
      Bluetooth: Replace BDADDR_LOCAL with BDADDR_NONE · a59ac2f7
      Marcel Holtmann 提交于
      The BDADDR_LOCAL is a relict from userspace and has never been used
      within the kernel. So remove that constant and replace it with a new
      BDADDR_NONE that is similar to HCI_DEV_NONE with all bits set.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      a59ac2f7
  6. 01 10月, 2013 3 次提交
  7. 30 9月, 2013 1 次提交
  8. 29 9月, 2013 6 次提交
    • E
      net: introduce SO_MAX_PACING_RATE · 62748f32
      Eric Dumazet 提交于
      As mentioned in commit afe4fd06 ("pkt_sched: fq: Fair Queue packet
      scheduler"), this patch adds a new socket option.
      
      SO_MAX_PACING_RATE offers the application the ability to cap the
      rate computed by transport layer. Value is in bytes per second.
      
      u32 val = 1000000;
      setsockopt(sockfd, SOL_SOCKET, SO_MAX_PACING_RATE, &val, sizeof(val));
      
      To be effectively paced, a flow must use FQ packet scheduler.
      
      Note that a packet scheduler takes into account the headers for its
      computations. The effective payload rate depends on MSS and retransmits
      if any.
      
      I chose to make this pacing rate a SOL_SOCKET option instead of a
      TCP one because this can be used by other protocols.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Steinar H. Gunderson <sesse@google.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62748f32
    • F
      ipv4: processing ancillary IP_TOS or IP_TTL · aa661581
      Francesco Fusco 提交于
      If IP_TOS or IP_TTL are specified as ancillary data, then sendmsg() sends out
      packets with the specified TTL or TOS overriding the socket values specified
      with the traditional setsockopt().
      
      The struct inet_cork stores the values of TOS, TTL and priority that are
      passed through the struct ipcm_cookie. If there are user-specified TOS
      (tos != -1) or TTL (ttl != 0) in the struct ipcm_cookie, these values are
      used to override the per-socket values. In case of TOS also the priority
      is changed accordingly.
      
      Two helper functions get_rttos and get_rtconn_flags are defined to take
      into account the presence of a user specified TOS value when computing
      RT_TOS and RT_CONN_FLAGS.
      Signed-off-by: NFrancesco Fusco <ffusco@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa661581
    • F
      ipv4: IP_TOS and IP_TTL can be specified as ancillary data · f02db315
      Francesco Fusco 提交于
      This patch enables the IP_TTL and IP_TOS values passed from userspace to
      be stored in the ipcm_cookie struct. Three fields are added to the struct:
      
      - the TTL, expressed as __u8.
        The allowed values are in the [1-255].
        A value of 0 means that the TTL is not specified.
      
      - the TOS, expressed as __s16.
        The allowed values are in the range [0,255].
        A value of -1 means that the TOS is not specified.
      
      - the priority, expressed as a char and computed when
        handling the ancillary data.
      Signed-off-by: NFrancesco Fusco <ffusco@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f02db315
    • E
      net: net_secret should not depend on TCP · 9a3bab6b
      Eric Dumazet 提交于
      A host might need net_secret[] and never open a single socket.
      
      Problem added in commit aebda156
      ("net: defer net_secret[] initialization")
      
      Based on prior patch from Hannes Frederic Sowa.
      Reported-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NHannes Frederic Sowa <hannes@strressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a3bab6b
    • E
      net: Delay default_device_exit_batch until no devices are unregistering v2 · 50624c93
      Eric W. Biederman 提交于
      There is currently serialization network namespaces exiting and
      network devices exiting as the final part of netdev_run_todo does not
      happen under the rtnl_lock.  This is compounded by the fact that the
      only list of devices unregistering in netdev_run_todo is local to the
      netdev_run_todo.
      
      This lack of serialization in extreme cases results in network devices
      unregistering in netdev_run_todo after the loopback device of their
      network namespace has been freed (making dst_ifdown unsafe), and after
      the their network namespace has exited (making the NETDEV_UNREGISTER,
      and NETDEV_UNREGISTER_FINAL callbacks unsafe).
      
      Add the missing serialization by a per network namespace count of how
      many network devices are unregistering and having a wait queue that is
      woken up whenever the count is decreased.  The count and wait queue
      allow default_device_exit_batch to wait until all of the unregistration
      activity for a network namespace has finished before proceeding to
      unregister the loopback device and then allowing the network namespace
      to exit.
      
      Only a single global wait queue is used because there is a single global
      lock, and there is a single waiter, per network namespace wait queues
      would be a waste of resources.
      
      The per network namespace count of unregistering devices gives a
      progress guarantee because the number of network devices unregistering
      in an exiting network namespace must ultimately drop to zero (assuming
      network device unregistration completes).
      
      The basic logic remains the same as in v1.  This patch is now half
      comment and half rtnl_lock_unregistering an expanded version of
      wait_event performs no extra work in the common case where no network
      devices are unregistering when we get to default_device_exit_batch.
      Reported-by: NFrancesco Ruggeri <fruggeri@aristanetworks.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50624c93
    • C
      IPv6 NAT: Do not drop DNATed 6to4/6rd packets · 7df37ff3
      Catalin\(ux\) M. BOIE 提交于
      When a router is doing DNAT for 6to4/6rd packets the latest
      anti-spoofing commit 218774dc ("ipv6: add anti-spoofing checks for
      6to4 and 6rd") will drop them because the IPv6 address embedded does
      not match the IPv4 destination. This patch will allow them to pass by
      testing if we have an address that matches on 6to4/6rd interface.  I
      have been hit by this problem using Fedora and IPV6TO4_IPV4ADDR.
      Also, log the dropped packets (with rate limit).
      Signed-off-by: NCatalin(ux) M. BOIE <catab@embedromix.ro>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7df37ff3
  9. 28 9月, 2013 1 次提交
  10. 26 9月, 2013 3 次提交
  11. 24 9月, 2013 6 次提交