1. 27 Apr, 2016 2 commits
  2. 22 Apr, 2016 9 commits
  3. 21 Apr, 2016 29 commits
    • cpaul@redhat.com's avatar
      drm/dp/mst: Validate port in drm_dp_payload_send_msg() · deba0a2a
      cpaul@redhat.com authored
      With the joys of things running concurrently, there's always a chance
      that the port we get passed in drm_dp_payload_send_msg() isn't actually
      valid anymore. Because of this, we need to make sure we validate the
      reference to the port before we use it otherwise we risk running into
      various race conditions. For instance, on the Dell MST monitor I have
      here for testing, hotplugging it enough times causes us to kernel panic:
      
      [drm:intel_mst_enable_dp] 1
      [drm:drm_dp_update_payload_part2] payload 0 1
      [drm:intel_get_hpd_pins] hotplug event received, stat 0x00200000, dig 0x10101011, pins 0x00000020
      [drm:intel_hpd_irq_handler] digital hpd port B - short
      [drm:intel_dp_hpd_pulse] got hpd irq on port B - short
      [drm:intel_dp_check_mst_status] got esi 00 10 00
      [drm:drm_dp_update_payload_part2] payload 1 1
      general protection fault: 0000 [#1] SMP
      …
      Call Trace:
       [<ffffffffa012b632>] drm_dp_update_payload_part2+0xc2/0x130 [drm_kms_helper]
       [<ffffffffa032ef08>] intel_mst_enable_dp+0xf8/0x180 [i915]
       [<ffffffffa0310dbd>] haswell_crtc_enable+0x3ed/0x8c0 [i915]
       [<ffffffffa030c84d>] intel_atomic_commit+0x5ad/0x1590 [i915]
       [<ffffffffa01db877>] ? drm_atomic_set_crtc_for_connector+0x57/0xe0 [drm]
       [<ffffffffa01dc4e7>] drm_atomic_commit+0x37/0x60 [drm]
       [<ffffffffa0130a3a>] drm_atomic_helper_set_config+0x7a/0xb0 [drm_kms_helper]
       [<ffffffffa01cc482>] drm_mode_set_config_internal+0x62/0x100 [drm]
       [<ffffffffa01d02ad>] drm_mode_setcrtc+0x3cd/0x4e0 [drm]
       [<ffffffffa01c18e3>] drm_ioctl+0x143/0x510 [drm]
       [<ffffffffa01cfee0>] ? drm_mode_setplane+0x1b0/0x1b0 [drm]
       [<ffffffff810f79a7>] ? hrtimer_start_range_ns+0x1b7/0x3a0
       [<ffffffff81212962>] do_vfs_ioctl+0x92/0x570
       [<ffffffff81590852>] ? __sys_recvmsg+0x42/0x80
       [<ffffffff81212eb9>] SyS_ioctl+0x79/0x90
       [<ffffffff816b4e32>] entry_SYSCALL_64_fastpath+0x1a/0xa4
      RIP  [<ffffffffa012b026>] drm_dp_payload_send_msg+0x146/0x1f0 [drm_kms_helper]
      
      Which occurs because of the hotplug event shown in the log, which ends
      up causing DRM's dp helpers to drop the port we're updating the payload
      on and panic.
      
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarLyude <cpaul@redhat.com>
      Reviewed-by: default avatarDavid Airlie <airlied@linux.ie>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      deba0a2a
    • Dave Airlie's avatar
      Merge branch 'linux-4.6' of git://github.com/skeggsb/linux into drm-fixes · 3addc4e3
      Dave Airlie authored
      Single nouveau regression fix
      * 'linux-4.6' of git://github.com/skeggsb/linux:
        drm/nouveau/kms: fix setting of default values for dithering properties
      3addc4e3
    • Ben Skeggs's avatar
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2016-04-21' of git://anongit.freedesktop.org/drm-intel into drm-fixes · 762ce445
      Dave Airlie authored
      Hi Dave, fixes all around, all but one are cc: stable material, the most
      important ones are likely the Skylake hang fixes from Mika.
      
      * tag 'drm-intel-fixes-2016-04-21' of git://anongit.freedesktop.org/drm-intel:
        drm/i915: Use fw_domains_put_with_fifo() on HSW
        drm/i915: Force ringbuffers to not be at offset 0
        drm/i915: Adjust size of PIPE_CONTROL used for gen8 render seqno write
        drm/i915/skl: Fix spurious gpu hang with gt3/gt4 revs
        drm/i915/skl: Fix rc6 based gpu/system hang
        drm/i915/userptr: Hold mmref whilst calling get-user-pages
        drm/i915: Fixup the free space logic in ring_prepare
        drm/i915/skl+: Use plane size for relative data rate calculation
      762ce445
    • Linus Torvalds's avatar
      Merge tag 'rtc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · 5f44abd0
      Linus Torvalds authored
      Pull RTC fixes from Alexandre Belloni:
       "A few fixes for the RTC subsystem.  The documentation fix already
        missed 4.5 so I think it is worth taking it now:
      
        A documentation fix for s3c and two fixes for the ds1307"
      
      * tag 'rtc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
        rtc: ds1307: Use irq when available for wakeup-source device
        rtc: ds1307: ds3231 temperature s16 overflow
        rtc: s3c: Document in binding that only s3c6410 needs a src clk
      5f44abd0
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f78fe081
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "Two fixes for issues introduced recently, one for an intel_pstate
        driver problem uncovered by the recent switch over from using timers
        and the other one for a potential cpufreq core problem related to
        system suspend/resume.
      
        Specifics:
      
         - Fix an intel_pstate driver problem causing CPUs to get stuck in the
           highest P-state when completely idle uncovered by the recent switch
           over from using timers (Rafael Wysocki).
      
         - Avoid attempts to get the current CPU frequency when all devices
           (like I2C controllers that may be nedded for that purpose) have
           been suspended during system suspend/resume (Rafael Wysocki)"
      
      * tag 'pm+acpi-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set
        intel_pstate: Avoid getting stuck in high P-states when idle
      f78fe081
    • Nishanth Menon's avatar
      rtc: ds1307: Use irq when available for wakeup-source device · 38a7a73e
      Nishanth Menon authored
      With commit 8bc2a407 ("rtc: ds1307: add support for the
      DT property 'wakeup-source'") we lost the ability for rtc irq
      functionality for devices that are actually hooked on a real IRQ
      line and have capability to wakeup as well. This is not an expected
      behavior. So, instead of just not requesting IRQ, skip the IRQ
      requirement only if interrupts are not defined for the device.
      
      Fixes: 8bc2a407 ("rtc: ds1307: add support for the DT property 'wakeup-source'")
      Reported-by: default avatarTony Lindgren <tony@atomide.com>
      Cc: Michael Lange <linuxstuff@milaw.biz>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      38a7a73e
    • Zhuang Yuyao's avatar
      rtc: ds1307: ds3231 temperature s16 overflow · 9a3dce62
      Zhuang Yuyao authored
      while retrieving temperature from ds3231, the result may be overflow
      since s16 is too small for a multiplication with 250.
      
      ie. if temp_buf[0] == 0x2d, the result (s16 temp) will be negative.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Tested-by: default avatarMichael Tatarinov <kukabu@gmail.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      9a3dce62
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c5edde3a
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix memory leak in iwlwifi, from Matti Gottlieb.
      
       2) Add missing registration of netfilter arp_tables into initial
          namespace, from Florian Westphal.
      
       3) Fix potential NULL deref in DecNET routing code.
      
       4) Restrict NETLINK_URELEASE to truly bound sockets only, from Dmitry
          Ivanov.
      
       5) Fix dst ref counting in VRF, from David Ahern.
      
       6) Fix TSO segmenting limits in i40e driver, from Alexander Duyck.
      
       7) Fix heap leak in PACKET_DIAG_MCLIST, from Mathias Krause.
      
       8) Ravalidate IPV6 datagram socket cached routes properly, particularly
          with UDP, from Martin KaFai Lau.
      
       9) Fix endian bug in RDS dp_ack_seq handling, from Qing Huang.
      
      10) Fix stats typing in bcmgenet driver, from Eric Dumazet.
      
      11) Openvswitch needs to orphan SKBs before ipv6 fragmentation handing,
          from Joe Stringer.
      
      12) SPI device reference leak in spi_ks8895 PHY driver, from Mark Brown.
      
      13) atl2 doesn't actually support scatter-gather, so don't advertise the
          feature.  From Ben Hucthings.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
        openvswitch: use flow protocol when recalculating ipv6 checksums
        Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
        atl2: Disable unimplemented scatter/gather feature
        net/mlx4_en: Split SW RX dropped counter per RX ring
        net/mlx4_core: Don't allow to VF change global pause settings
        net/mlx4_core: Avoid repeated calls to pci enable/disable
        net/mlx4_core: Implement pci_resume callback
        net: phy: spi_ks8895: Don't leak references to SPI devices
        net: ethernet: davinci_emac: Fix platform_data overwrite
        net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable
        qede: Fix single MTU sized packet from firmware GRO flow
        qede: Fix setting Skb network header
        qede: Fix various memory allocation error flows for fastpath
        tcp: Merge tx_flags and tskey in tcp_shifted_skb
        tcp: Merge tx_flags and tskey in tcp_collapse_retrans
        drivers: net: cpsw: fix wrong regs access in cpsw_ndo_open
        tcp: Fix SOF_TIMESTAMPING_TX_ACK when handling dup acks
        openvswitch: Orphan skbs before IPv6 defrag
        Revert "Prevent NUll pointer dereference with two PHYs on cpsw"
        VSOCK: Only check error on skb_recv_datagram when skb is NULL
        ...
      c5edde3a
    • Simon Horman's avatar
      openvswitch: use flow protocol when recalculating ipv6 checksums · b4f70527
      Simon Horman authored
      When using masked actions the ipv6_proto field of an action
      to set IPv6 fields may be zero rather than the prevailing protocol
      which will result in skipping checksum recalculation.
      
      This patch resolves the problem by relying on the protocol
      in the flow key rather than that in the set field action.
      
      Fixes: 83d2b9ba ("net: openvswitch: Support masked set actions.")
      Cc: Jarno Rajahalme <jrajahalme@nicira.com>
      Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4f70527
    • Shrikrishna Khare's avatar
      Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets · f0d43780
      Shrikrishna Khare authored
      For IPv6, if the device indicates that the checksum is correct, set
      CHECKSUM_UNNECESSARY.
      Reported-by: default avatarSubbarao Narahari <snarahari@vmware.com>
      Signed-off-by: default avatarShrikrishna Khare <skhare@vmware.com>
      Signed-off-by: default avatarJin Heo <heoj@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0d43780
    • Ben Hutchings's avatar
      atl2: Disable unimplemented scatter/gather feature · f43bfaed
      Ben Hutchings authored
      atl2 includes NETIF_F_SG in hw_features even though it has no support
      for non-linear skbs.  This bug was originally harmless since the
      driver does not claim to implement checksum offload and that used to
      be a requirement for SG.
      
      Now that SG and checksum offload are independent features, if you
      explicitly enable SG *and* use one of the rare protocols that can use
      SG without checkusm offload, this potentially leaks sensitive
      information (before you notice that it just isn't working).  Therefore
      this obscure bug has been designated CVE-2016-2117.
      Reported-by: default avatarJustin Yackoski <jyackoski@crypto-nite.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Fixes: ec5f0615 ("net: Kill link between CSUM and SG features.")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f43bfaed
    • David S. Miller's avatar
      Merge branch 'mlx4-fixes' · 669c00c0
      David S. Miller authored
      Or Gerlitz says:
      
      ====================
      Mellaox 40G driver fixes for 4.6-rc
      
      With the fix for ARM bug being under the works, these are
      few other fixes for mlx4 we have ready to go.
      
      Eran addressed the problematic/wrong reporting of dropped packets, Daniel
      fixed some matters related to PPC EEH's and Jenny's patch makes sure
      VFs can't change the port's pause settings.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      669c00c0
    • Eran Ben Elisha's avatar
      net/mlx4_en: Split SW RX dropped counter per RX ring · d21ed3a3
      Eran Ben Elisha authored
      Count SW packet drops per RX ring instead of a global counter. This
      will allow monitoring the number of rx drops per ring.
      
      In addition, SW rx_dropped counter was overwritten by HW rx_dropped
      counter, sum both of them instead to show the accurate value.
      
      Fixes: a3333b35 ('net/mlx4_en: Moderate ethtool callback to [...] ')
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Reported-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d21ed3a3
    • Eugenia Emantayev's avatar
      net/mlx4_core: Don't allow to VF change global pause settings · 2a500090
      Eugenia Emantayev authored
      Currently changing global pause settings is done via SET_PORT
      command with input modifier GENERAL. This command is allowed
      for each VF since MTU setting is done via the same command.
      
      Change the above to the following scheme: before passing the
      request to the FW, the PF will check whether it was issued
      by a slave. If yes, don't change global pause and warn,
      otherwise change to the requested value and store for
      further reference.
      Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a500090
    • Daniel Jurgens's avatar
      net/mlx4_core: Avoid repeated calls to pci enable/disable · 4bfd2e6e
      Daniel Jurgens authored
      Maintain the PCI status and provide wrappers for enabling and disabling
      the PCI device.  Performing the actions more than once without doing
      its opposite results in warning logs.
      
      This occurred when EEH hotplugged the device causing a warning for
      disabling an already disabled device.
      
      Fixes: 2ba5fbd6 ('net/mlx4_core: Handle AER flow properly')
      Signed-off-by: default avatarDaniel Jurgens <danielj@mellanox.com>
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bfd2e6e
    • Daniel Jurgens's avatar
      net/mlx4_core: Implement pci_resume callback · c12833ac
      Daniel Jurgens authored
      Move resume related activities to a new pci_resume function instead of
      performing them in mlx4_pci_slot_reset.  This change is needed to avoid
      a hotplug during EEH recovery due to commit f2da4ccf ("powerpc/eeh:
      More relaxed hotplug criterion").
      
      Fixes: 2ba5fbd6 ('net/mlx4_core: Handle AER flow properly')
      Signed-off-by: default avatarDaniel Jurgens <danielj@mellanox.com>
      Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c12833ac
    • Mark Brown's avatar
      net: phy: spi_ks8895: Don't leak references to SPI devices · a1459c1c
      Mark Brown authored
      The ks8895 driver is using spi_dev_get() apparently just to take a copy
      of the SPI device used to instantiate it but never calls spi_dev_put()
      to free it.  Since the device is guaranteed to exist between probe() and
      remove() there should be no need for the driver to take an extra
      reference to it so fix the leak by just using a straight assignment.
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1459c1c
    • Neil Armstrong's avatar
      net: ethernet: davinci_emac: Fix platform_data overwrite · 210990b0
      Neil Armstrong authored
      When the DaVinci emac driver is removed and re-probed, the actual
      pdev->dev.platform_data is populated with an unwanted valid pointer saved by
      the previous davinci_emac_of_get_pdata() call, causing a kernel crash when
      calling priv->int_disable() in emac_int_disable().
      
      Unable to handle kernel paging request at virtual address c8622a80
      ...
      [<c0426fb4>] (emac_int_disable) from [<c0427700>] (emac_dev_open+0x290/0x5f8)
      [<c0427700>] (emac_dev_open) from [<c04c00ec>] (__dev_open+0xb8/0x120)
      [<c04c00ec>] (__dev_open) from [<c04c0370>] (__dev_change_flags+0x88/0x14c)
      [<c04c0370>] (__dev_change_flags) from [<c04c044c>] (dev_change_flags+0x18/0x48)
      [<c04c044c>] (dev_change_flags) from [<c052bafc>] (devinet_ioctl+0x6b4/0x7ac)
      [<c052bafc>] (devinet_ioctl) from [<c04a1428>] (sock_ioctl+0x1d8/0x2c0)
      [<c04a1428>] (sock_ioctl) from [<c014f054>] (do_vfs_ioctl+0x41c/0x600)
      [<c014f054>] (do_vfs_ioctl) from [<c014f2a4>] (SyS_ioctl+0x6c/0x7c)
      [<c014f2a4>] (SyS_ioctl) from [<c000ff60>] (ret_fast_syscall+0x0/0x1c)
      
      Fixes: 42f59967 ("net: ethernet: davinci_emac: add OF support")
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      210990b0
    • Neil Armstrong's avatar
      net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable · 99164f9e
      Neil Armstrong authored
      In order to avoid an Unbalanced pm_runtime_enable in the DaVinci
      emac driver when the device is removed and re-probed, and a
      pm_runtime_disable() call in davinci_emac_remove().
      
      Actually, using unbind/bind on a TI DM8168 SoC gives :
      $ echo 4a120000.ethernet > /sys/bus/platform/drivers/davinci_emac/unbind
      net eth1: DaVinci EMAC: davinci_emac_remove()
      $ echo 4a120000.ethernet > /sys/bus/platform/drivers/davinci_emac/bind
      davinci_emac 4a120000.ethernet: Unbalanced pm_runtime_enable
      
      Cc: Brian Hutchinson <b.hutchman@gmail.com>
      Fixes: 3ba97381 ("net: ethernet: davinci_emac: add pm_runtime support")
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99164f9e
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-cpufreq-fixes' · 395da125
      Rafael J. Wysocki authored
      * pm-cpufreq-fixes:
        cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set
        intel_pstate: Avoid getting stuck in high P-states when idle
      395da125
    • David S. Miller's avatar
      Merge branch 'qed-fixes' · 3ad97799
      David S. Miller authored
      Manish Chopra says:
      
      ====================
      qede: Bug fixes
      
      This series fixes -
      
      * various memory allocation failure flows for fastpath
      * issues with respect to driver GRO packets handling
      
      V1->V2
      
      * Send series against net instead of net-next.
      
      Please consider applying this series to "net"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ad97799
    • Manish Chopra's avatar
      qede: Fix single MTU sized packet from firmware GRO flow · ee2fa8e6
      Manish Chopra authored
      In firmware assisted GRO flow there could be a single MTU sized
      segment arriving due to firmware aggregation timeout/last segment
      in an aggregation flow, which is not expected to be an actual gro
      packet. So If a skb has zero frags from the GRO flow then simply
      push it in the stack as non gso skb.
      Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <yuval.mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee2fa8e6
    • Manish Chopra's avatar
      qede: Fix setting Skb network header · aad94c04
      Manish Chopra authored
      Skb's network header needs to be set before extracting IPv4/IPv6
      headers from it.
      Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <yuval.mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aad94c04
    • Manish Chopra's avatar
      qede: Fix various memory allocation error flows for fastpath · f86af2df
      Manish Chopra authored
      This patch handles memory allocation failures for fastpath
      gracefully in the driver.
      Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <yuval.mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f86af2df
    • David S. Miller's avatar
      Merge branch 'tcp-coalesce-merge-timestamps' · 5bec11cf
      David S. Miller authored
      Martin KaFai Lau says:
      
      ====================
      tcp: Merge timestamp info when coalescing skbs
      
      This series is separated from the RFC series related to
      tcp_sendmsg(MSG_EOR) and it is targeting for the net branch.
      This patchset is focusing on fixing cases where TCP
      timestamp could be lost after coalescing skbs.
      
      A BPF prog is used to kprobe to sock_queue_err_skb()
      and print out the value of serr->ee.ee_data.  The BPF
      prog (run-able from bcc) is attached here:
      
      BPF prog used for testing:
      ~~~~~
      
      from __future__ import print_function
      from bcc import BPF
      
      bpf_text = """
      
      int trace_err_skb(struct pt_regs *ctx)
      {
      	struct sk_buff *skb = (struct sk_buff *)ctx->si;
      	struct sock *sk = (struct sock *)ctx->di;
      	struct sock_exterr_skb *serr;
      	u32 ee_data = 0;
      
      	if (!sk || !skb)
      		return 0;
      
      	serr = SKB_EXT_ERR(skb);
      	bpf_probe_read(&ee_data, sizeof(ee_data), &serr->ee.ee_data);
      	bpf_trace_printk("ee_data:%u\\n", ee_data);
      
      	return 0;
      };
      """
      
      b = BPF(text=bpf_text)
      b.attach_kprobe(event="sock_queue_err_skb", fn_name="trace_err_skb")
      print("Attached to kprobe")
      b.trace_print()
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5bec11cf
    • Martin KaFai Lau's avatar
      tcp: Merge tx_flags and tskey in tcp_shifted_skb · cfea5a68
      Martin KaFai Lau authored
      After receiving sacks, tcp_shifted_skb() will collapse
      skbs if possible.  tx_flags and tskey also have to be
      merged.
      
      This patch reuses the tcp_skb_collapse_tstamp() to handle
      them.
      
      BPF Output Before:
      ~~~~~
      <no-output-due-to-missing-tstamp-event>
      
      BPF Output After:
      ~~~~~
      <...>-2024  [007] d.s.    88.644374: : ee_data:14599
      
      Packetdrill Script:
      ~~~~~
      +0 `sysctl -q -w net.ipv4.tcp_min_tso_segs=10`
      +0 `sysctl -q -w net.ipv4.tcp_no_metrics_save=1`
      +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
      +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
      +0 bind(3, ..., ...) = 0
      +0 listen(3, 1) = 0
      
      0.100 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 7>
      0.100 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 7>
      0.200 < . 1:1(0) ack 1 win 257
      0.200 accept(3, ..., ...) = 4
      +0 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
      
      0.200 write(4, ..., 1460) = 1460
      +0 setsockopt(4, SOL_SOCKET, 37, [2688], 4) = 0
      0.200 write(4, ..., 13140) = 13140
      
      0.200 > P. 1:1461(1460) ack 1
      0.200 > . 1461:8761(7300) ack 1
      0.200 > P. 8761:14601(5840) ack 1
      
      0.300 < . 1:1(0) ack 1 win 257 <sack 1461:14601,nop,nop>
      0.300 > P. 1:1461(1460) ack 1
      0.400 < . 1:1(0) ack 14601 win 257
      
      0.400 close(4) = 0
      0.400 > F. 14601:14601(0) ack 1
      0.500 < F. 1:1(0) ack 14602 win 257
      0.500 > . 14602:14602(0) ack 2
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Tested-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfea5a68
    • Martin KaFai Lau's avatar
      tcp: Merge tx_flags and tskey in tcp_collapse_retrans · 082ac2d5
      Martin KaFai Lau authored
      If two skbs are merged/collapsed during retransmission, the current
      logic does not merge the tx_flags and tskey.  The end result is
      the SCM_TSTAMP_ACK timestamp could be missing for a packet.
      
      The patch:
      1. Merge the tx_flags
      2. Overwrite the prev_skb's tskey with the next_skb's tskey
      
      BPF Output Before:
      ~~~~~~
      <no-output-due-to-missing-tstamp-event>
      
      BPF Output After:
      ~~~~~~
      packetdrill-2092  [001] d.s.   453.998486: : ee_data:1459
      
      Packetdrill Script:
      ~~~~~~
      +0 `sysctl -q -w net.ipv4.tcp_min_tso_segs=10`
      +0 `sysctl -q -w net.ipv4.tcp_no_metrics_save=1`
      +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
      +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
      +0 bind(3, ..., ...) = 0
      +0 listen(3, 1) = 0
      
      0.100 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 7>
      0.100 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 7>
      0.200 < . 1:1(0) ack 1 win 257
      0.200 accept(3, ..., ...) = 4
      +0 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
      
      0.200 write(4, ..., 730) = 730
      +0 setsockopt(4, SOL_SOCKET, 37, [2688], 4) = 0
      0.200 write(4, ..., 730) = 730
      +0 setsockopt(4, SOL_SOCKET, 37, [2176], 4) = 0
      0.200 write(4, ..., 11680) = 11680
      +0 setsockopt(4, SOL_SOCKET, 37, [2688], 4) = 0
      
      0.200 > P. 1:731(730) ack 1
      0.200 > P. 731:1461(730) ack 1
      0.200 > . 1461:8761(7300) ack 1
      0.200 > P. 8761:13141(4380) ack 1
      
      0.300 < . 1:1(0) ack 1 win 257 <sack 1461:2921,nop,nop>
      0.300 < . 1:1(0) ack 1 win 257 <sack 1461:4381,nop,nop>
      0.300 < . 1:1(0) ack 1 win 257 <sack 1461:5841,nop,nop>
      0.300 > P. 1:1461(1460) ack 1
      0.400 < . 1:1(0) ack 13141 win 257
      
      0.400 close(4) = 0
      0.400 > F. 13141:13141(0) ack 1
      0.500 < F. 1:1(0) ack 13142 win 257
      0.500 > . 13142:13142(0) ack 2
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Tested-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      082ac2d5
    • Grygorii Strashko's avatar
      drivers: net: cpsw: fix wrong regs access in cpsw_ndo_open · 3fa88c51
      Grygorii Strashko authored
      The cpsw_ndo_open() could try to access CPSW registers before
      calling pm_runtime_get_sync(). This will trigger L3 error:
      
       WARNING: CPU: 0 PID: 21 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x220/0x34c()
       44000000.ocp:L3 Custom Error: MASTER M2 (64-bit) TARGET L4_FAST (Idle): Data Access in Supervisor mode during Functional access
      
      and CPSW will stop functioning.
      
      Hence, fix it by moving pm_runtime_get_sync() before the first access
      to CPSW registers in cpsw_ndo_open().
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3fa88c51