1. 31 1月, 2013 1 次提交
  2. 30 1月, 2013 1 次提交
    • J
      ipv4: introduce address lifetime · 5c766d64
      Jiri Pirko 提交于
      There are some usecase when lifetime of ipv4 addresses might be helpful.
      For example:
      1) initramfs networkmanager uses a DHCP daemon to learn network
      configuration parameters
      2) initramfs networkmanager addresses, routes and DNS configuration
      3) initramfs networkmanager is requested to stop
      4) initramfs networkmanager stops all daemons including dhclient
      5) there are addresses and routes configured but no daemon running. If
      the system doesn't start networkmanager for some reason, addresses and
      routes will be used forever, which violates RFC 2131.
      
      This patch is essentially a backport of ivp6 address lifetime mechanism
      for ipv4 addresses.
      
      Current "ip" tool supports this without any patch (since it does not
      distinguish between ipv4 and ipv6 addresses in this perspective.
      
      Also, this should be back-compatible with all current netlink users.
      Reported-by: NPavel Šimerda <psimerda@redhat.com>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c766d64
  3. 29 1月, 2013 3 次提交
  4. 28 1月, 2013 1 次提交
    • E
      net: fix possible wrong checksum generation · cef401de
      Eric Dumazet 提交于
      Pravin Shelar mentioned that GSO could potentially generate
      wrong TX checksum if skb has fragments that are overwritten
      by the user between the checksum computation and transmit.
      
      He suggested to linearize skbs but this extra copy can be
      avoided for normal tcp skbs cooked by tcp_sendmsg().
      
      This patch introduces a new SKB_GSO_SHARED_FRAG flag, set
      in skb_shinfo(skb)->gso_type if at least one frag can be
      modified by the user.
      
      Typical sources of such possible overwrites are {vm}splice(),
      sendfile(), and macvtap/tun/virtio_net drivers.
      
      Tested:
      
      $ netperf -H 7.7.8.84
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      7.7.8.84 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3959.52
      
      $ netperf -H 7.7.8.84 -t TCP_SENDFILE
      TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 ()
      port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3216.80
      
      Performance of the SENDFILE is impacted by the extra allocation and
      copy, and because we use order-0 pages, while the TCP_STREAM uses
      bigger pages.
      Reported-by: NPravin Shelar <pshelar@nicira.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cef401de
  5. 27 1月, 2013 3 次提交
  6. 26 1月, 2013 4 次提交
    • O
      can: add private data space for CAN sk_buffs · 156c2bb9
      Oliver Hartkopp 提交于
      The struct can_skb_priv is used to transport additional information along
      with the stored struct can(fd)_frame that can not be contained in existing
      struct sk_buff elements.
      
      can_skb_priv is located in the skb headroom, which does not touch the existing
      CAN sk_buff usage with skb->data and skb->len, so that even out-of-tree
      CAN drivers can be used without changes.
      
      Btw. out-of-tree CAN drivers without can_skb_priv in the sk_buff headroom
      would not support features based on can_skb_priv.
      
      The can_skb_priv->ifindex contains the first interface where the CAN frame
      appeared on the local host. Unfortunately skb->skb_iif can not be used as this
      value is overwritten in every netif_receive_skb() call.
      Signed-off-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      156c2bb9
    • K
      can: rename LED trigger name on netdev renames · a1ef7bd9
      Kurt Van Dijck 提交于
      The LED trigger name for CAN devices is based on the initial
      CAN device name, but does never change. The LED trigger name
      is not guaranteed to be unique in case of hotplugging CAN devices.
      
      This patch tries to address this problem by modifying the
      LED trigger name according to the CAN device name when
      the latter changes.
      
      v1 - Kurt Van Dijck
      v2 - Fabio Baltieri
      - remove rename blocking if trigger is bound
      - use led-subsystem function for the actual rename (still WiP)
      - call init/exit functions from dev.c
      v3 - Kurt Van Dijck
      - safe operation for non-candev based devices (vcan, slcan)
      	based on earlier patch
      v4 - Kurt Van Dijck
      - trivial patch mistakes fixed
      Signed-off-by: NKurt Van Dijck <kurt.van.dijck@eia.be>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      a1ef7bd9
    • K
      can: export a safe netdev_priv wrapper for candev · bf03a537
      Kurt Van Dijck 提交于
      In net_device notifier calls, it was impossible to determine
      if a CAN device is based on candev in a safe way.
      This patch adds such test in order to access candev storage
      from within those notifiers.
      Signed-off-by: NKurt Van Dijck <kurt.van.dijck@eia.be>
      Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      bf03a537
    • F
      can: add tx/rx LED trigger support · 996a953d
      Fabio Baltieri 提交于
      This patch implements the functions to add two LED triggers, named
      <ifname>-tx and <ifname>-rx, to a canbus device driver.
      
      Triggers are called from specific handlers by each CAN device driver and
      can be disabled altogether with a Kconfig option.
      
      The implementation keeps the LED on when the interface is UP and blinks
      the LED on network activity at a configurable rate.
      
      This only supports can-dev based drivers, as it uses some support field
      in the can_priv structure.
      
      Supported drivers should call devm_can_led_init() and can_led_event() as
      needed.
      
      Cleanup is handled automatically by devres, so no *_exit function is
      needed.
      
      Supported events are:
      - CAN_LED_EVENT_OPEN: turn on tx/rx LEDs
      - CAN_LED_EVENT_STOP: turn off tx/rx LEDs
      - CAN_LED_EVENT_TX: trigger tx LED blink
      - CAN_LED_EVENT_RX: trigger tx LED blink
      
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@gmail.com>
      Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      996a953d
  7. 24 1月, 2013 1 次提交
  8. 23 1月, 2013 2 次提交
    • O
      ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up() · 910ffdb1
      Oleg Nesterov 提交于
      Cleanup and preparation for the next change.
      
      signal_wake_up(resume => true) is overused. None of ptrace/jctl callers
      actually want to wakeup a TASK_WAKEKILL task, but they can't specify the
      necessary mask.
      
      Turn signal_wake_up() into signal_wake_up_state(state), reintroduce
      signal_wake_up() as a trivial helper, and add ptrace_signal_wake_up()
      which adds __TASK_TRACED.
      
      This way ptrace_signal_wake_up() can work "inside" ptrace_request()
      even if the tracee doesn't have the TASK_WAKEKILL bit set.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      910ffdb1
    • L
      mfd: Fix compile errors and warnings when !CONFIG_AB8500_BM · 00441b5e
      Lee Jones 提交于
      drivers/mfd/ab8500-core.c:1015:21: error: ‘ab8500_bm_data’ undeclared here
      
      include/linux/mfd/abx500/ab8500-bm.h:445:13: warning: ‘ab8500_fg_reinit’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:448:13: warning: ‘ab8500_charger_usb_state_changed’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:451:29: warning: ‘ab8500_btemp_get’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:455:12: warning: ‘ab8500_btemp_get_batctrl_temp’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:463:12: warning: ‘ab8500_fg_inst_curr_blocking’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:442:12: warning: ‘ab8500_fg_inst_curr_done’ defined but not used
      include/linux/mfd/abx500/ab8500-bm.h:447:26: warning: ‘ab8500_fg_get’ defined but not used
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      00441b5e
  9. 22 1月, 2013 3 次提交
  10. 21 1月, 2013 1 次提交
  11. 18 1月, 2013 1 次提交
    • K
      netfilter: nf_ct_sip: support Cisco 7941/7945 IP phones · 7266507d
      Kevin Cernekee 提交于
      Most SIP devices use a source port of 5060/udp on SIP requests, so the
      response automatically comes back to port 5060:
      
          phone_ip:5060 -> proxy_ip:5060   REGISTER
          proxy_ip:5060 -> phone_ip:5060   100 Trying
      
      The newer Cisco IP phones, however, use a randomly chosen high source
      port for the SIP request but expect the response on port 5060:
      
          phone_ip:49173 -> proxy_ip:5060  REGISTER
          proxy_ip:5060 -> phone_ip:5060   100 Trying
      
      Standard Linux NAT, with or without nf_nat_sip, will send the reply back
      to port 49173, not 5060:
      
          phone_ip:49173 -> proxy_ip:5060  REGISTER
          proxy_ip:5060 -> phone_ip:49173  100 Trying
      
      But the phone is not listening on 49173, so it will never see the reply.
      
      This patch modifies nf_*_sip to work around this quirk by extracting
      the SIP response port from the Via: header, iff the source IP in the
      packet header matches the source IP in the SIP request.
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      7266507d
  12. 17 1月, 2013 2 次提交
  13. 15 1月, 2013 5 次提交
    • D
      cpuidle: remove the power_specified field in the driver · 8aef33a7
      Daniel Lezcano 提交于
      We realized that the power usage field is never filled and when it
      is filled for tegra, the power_specified flag is not set causing all
      of these values to be reset when the driver is initialized with
      set_power_state().
      
      However, the power_specified flag can be simply removed under the
      assumption that the states are always backward sorted, which is the
      case with the current code.
      
      This change allows the menu governor select function and the
      cpuidle_play_dead() to be simplified.  Moreover, the
      set_power_states() function can removed as it does not make sense
      any more.
      
      Drop the power_specified flag from struct cpuidle_driver and make
      the related changes as described above.
      
      As a consequence, this also fixes the bug where on the dynamic
      C-states system, the power fields are not initialized.
      
      [rjw: Changelog]
      References: https://bugzilla.kernel.org/show_bug.cgi?id=42870
      References: https://bugzilla.kernel.org/show_bug.cgi?id=43349
      References: https://lkml.org/lkml/2012/10/16/518Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8aef33a7
    • P
      tun: fix LSM/SELinux labeling of tun/tap devices · 5dbbaf2d
      Paul Moore 提交于
      This patch corrects some problems with LSM/SELinux that were introduced
      with the multiqueue patchset.  The problem stems from the fact that the
      multiqueue work changed the relationship between the tun device and its
      associated socket; before the socket persisted for the life of the
      device, however after the multiqueue changes the socket only persisted
      for the life of the userspace connection (fd open).  For non-persistent
      devices this is not an issue, but for persistent devices this can cause
      the tun device to lose its SELinux label.
      
      We correct this problem by adding an opaque LSM security blob to the
      tun device struct which allows us to have the LSM security state, e.g.
      SELinux labeling information, persist for the lifetime of the tun
      device.  In the process we tweak the LSM hooks to work with this new
      approach to TUN device/socket labeling and introduce a new LSM hook,
      security_tun_dev_attach_queue(), to approve requests to attach to a
      TUN queue via TUNSETQUEUE.
      
      The SELinux code has been adjusted to match the new LSM hooks, the
      other LSMs do not make use of the LSM TUN controls.  This patch makes
      use of the recently added "tun_socket:attach_queue" permission to
      restrict access to the TUNSETQUEUE operation.  On older SELinux
      policies which do not define the "tun_socket:attach_queue" permission
      the access control decision for TUNSETQUEUE will be handled according
      to the SELinux policy's unknown permission setting.
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Acked-by: NEric Paris <eparis@parisplace.org>
      Tested-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5dbbaf2d
    • F
      net: phy: remove flags argument from phy_{attach, connect, connect_direct} · f9a8f83b
      Florian Fainelli 提交于
      The flags argument of the phy_{attach,connect,connect_direct} functions
      is then used to assign a struct phy_device dev_flags with its value.
      All callers but the tg3 driver pass the flag 0, which results in the
      underlying PHY drivers in drivers/net/phy/ not being able to actually
      use any of the flags they would set in dev_flags. This patch gets rid of
      the flags argument, and passes phydev->dev_flags to the internal PHY
      library call phy_attach_direct() such that drivers which actually modify
      a phy device dev_flags get the value preserved for use by the underlying
      phy driver.
      Acked-by: NKosta Zertsekel <konszert@marvell.com>
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9a8f83b
    • N
      bcma: fix bcm4716/bcm4748 i2s irqflag · 6bf2e546
      Nathan Hintz 提交于
      The default irqflag assignment for the I2S core on some Broadcom
      4716/4748 devices is invalid and needs to be corrected (from the
      Broadcom SDK).
      Signed-off-by: NNathan Hintz <nlhintz@hotmail.com>
      Acked-by: NHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      6bf2e546
    • S
      [libata] replace sata_settings with devslp_timing · 803739d2
      Shane Huang 提交于
      NCQ capability was used to check availability of SATA Settings page
      from Identify Device Data Log, which contains DevSlp timing variables.
      It does not work on some HDDs and leads to error messages.
      
      IDENTIFY word 78 bit 5(Hardware Feature Control) can't work either
      because it is only the sufficient condition of Identify Device data
      log, not the necessary condition.
      
      This patch replaced ata_device->sata_settings with ->devslp_timing
      to only save DevSlp timing variables(8 bytes), instead of the whole
      SATA Settings page(512 bytes).
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=51881Reported-by: NBorislav Petkov <bp@alien8.de>
      Signed-off-by: NShane Huang <shane.huang@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      803739d2
  14. 14 1月, 2013 3 次提交
  15. 12 1月, 2013 9 次提交