linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Ilya Lesokhin <ilyal@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.15 057/122] tcp: Honor the eor bit in tcp_mtu_probe
Date: Wed,  7 Mar 2018 11:37:49 -0800	[thread overview]
Message-ID: <20180307191737.450697477@linuxfoundation.org> (raw)
In-Reply-To: <20180307191729.190879024@linuxfoundation.org>

4.15-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilya Lesokhin <ilyal@mellanox.com>


[ Upstream commit 808cf9e38cd7923036a99f459ccc8cf2955e47af ]

Avoid SKB coalescing if eor bit is set in one of the relevant
SKBs.

Fixes: c134ecb87817 ("tcp: Make use of MSG_EOR in tcp_sendmsg")
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/tcp_output.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2026,6 +2026,24 @@ static inline void tcp_mtu_check_reprobe
 	}
 }
 
+static bool tcp_can_coalesce_send_queue_head(struct sock *sk, int len)
+{
+	struct sk_buff *skb, *next;
+
+	skb = tcp_send_head(sk);
+	tcp_for_write_queue_from_safe(skb, next, sk) {
+		if (len <= skb->len)
+			break;
+
+		if (unlikely(TCP_SKB_CB(skb)->eor))
+			return false;
+
+		len -= skb->len;
+	}
+
+	return true;
+}
+
 /* Create a new MTU probe if we are ready.
  * MTU probe is regularly attempting to increase the path MTU by
  * deliberately sending larger packets.  This discovers routing
@@ -2098,6 +2116,9 @@ static int tcp_mtu_probe(struct sock *sk
 			return 0;
 	}
 
+	if (!tcp_can_coalesce_send_queue_head(sk, probe_size))
+		return -1;
+
 	/* We're allowed to probe.  Build it now. */
 	nskb = sk_stream_alloc_skb(sk, probe_size, GFP_ATOMIC, false);
 	if (!nskb)
@@ -2133,6 +2154,10 @@ static int tcp_mtu_probe(struct sock *sk
 			/* We've eaten all the data from this skb.
 			 * Throw it away. */
 			TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags;
+			/* If this is the last SKB we copy and eor is set
+			 * we need to propagate it to the new skb.
+			 */
+			TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor;
 			tcp_unlink_write_queue(skb, sk);
 			sk_wmem_free_skb(sk, skb);
 		} else {

  parent reply	other threads:[~2018-03-07 19:37 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 19:36 [PATCH 4.15 000/122] 4.15.8-stable review Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 001/122] vsprintf: avoid misleading "(null)" for %px Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 002/122] hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers) Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 003/122] ipmi_si: Fix error handling of platform device Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 004/122] platform/x86: dell-laptop: Allocate buffer on heap rather than globally Greg Kroah-Hartman
2018-03-08  1:14   ` Mario.Limonciello
2018-03-08  1:46     ` Greg KH
2018-03-07 19:36 ` [PATCH 4.15 005/122] powerpc/pseries: Enable RAS hotplug events later Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 006/122] Bluetooth: btusb: Use DMI matching for QCA reset_resume quirking Greg Kroah-Hartman
2018-03-07 19:36 ` [PATCH 4.15 007/122] ixgbe: fix crash in build_skb Rx code path Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 008/122] tpm: st33zp24: fix potential buffer overruns caused by bit glitches on the bus Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 009/122] tpm: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 010/122] tpm_i2c_infineon: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 011/122] tpm_i2c_nuvoton: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 012/122] tpm_tis: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 013/122] ALSA: usb-audio: Add a quirck for B&W PX headphones Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 014/122] ALSA: control: Fix memory corruption risk in snd_ctl_elem_read Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 015/122] ALSA: x86: Fix missing spinlock and mutex initializations Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 016/122] ALSA: hda: Add a power_save blacklist Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 017/122] ALSA: hda - Fix pincfg at resume on Lenovo T470 dock Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 018/122] mmc: sdhci-pci: Fix S0i3 for Intel BYT-based controllers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 019/122] mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 020/122] mmc: dw_mmc: Avoid accessing registers in runtime suspended state Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 021/122] mmc: dw_mmc: Factor out dw_mci_init_slot_caps Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 022/122] mmc: dw_mmc: Fix out-of-bounds access for slots caps Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 023/122] timers: Forward timer base before migrating timers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 024/122] parisc: Use cr16 interval timers unconditionally on qemu Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 025/122] parisc: Reduce irq overhead when run in qemu Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 026/122] parisc: Fix ordering of cache and TLB flushes Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 027/122] parisc: Hide virtual kernel memory layout Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 028/122] btrfs: use proper endianness accessors for super_copy Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 029/122] block: fix the count of PGPGOUT for WRITE_SAME Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 030/122] block: kyber: fix domain token leak during requeue Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 031/122] block: pass inclusive lend parameter to truncate_inode_pages_range Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 032/122] vfio: disable filesystem-dax page pinning Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 033/122] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 034/122] dax: fix vma_is_fsdax() helper Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 035/122] direct-io: Fix sleep in atomic due to sync AIO Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 036/122] x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 037/122] x86/platform/intel-mid: Handle Intel Edison reboot correctly Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 038/122] x86/cpu_entry_area: Sync cpu_entry_area to initial_page_table Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 039/122] bridge: check brport attr show in brport_show Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 040/122] fib_semantics: Dont match route with mismatching tclassid Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 041/122] hdlc_ppp: carrier detect ok, dont turn off negotiation Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 042/122] ipv6 sit: work around bogus gcc-8 -Wrestrict warning Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 043/122] net: amd-xgbe: fix comparison to bitshift when dealing with a mask Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 044/122] net: ethernet: ti: cpsw: fix net watchdog timeout Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 045/122] net: fix race on decreasing number of TX queues Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 046/122] net: ipv4: dont allow setting net.ipv4.route.min_pmtu below 68 Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 047/122] netlink: ensure to loop over all netns in genlmsg_multicast_allns() Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 048/122] net: sched: report if filter is too large to dump Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 049/122] ppp: prevent unregistered channels from connecting to PPP units Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 050/122] sctp: verify size of a new chunk in _sctp_make_chunk() Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 051/122] udplite: fix partial checksum initialization Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 052/122] net/mlx5e: Fix TCP checksum in LRO buffers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 053/122] sctp: fix dst refcnt leak in sctp_v4_get_dst Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 054/122] mlxsw: spectrum_switchdev: Check success of FDB add operation Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 055/122] net/mlx5e: Specify numa node when allocating drop rq Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 056/122] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT Greg Kroah-Hartman
2018-03-07 19:37 ` Greg Kroah-Hartman [this message]
2018-03-07 19:37 ` [PATCH 4.15 058/122] rxrpc: Fix send in rxrpc_send_data_packet() Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 059/122] tcp_bbr: better deal with suboptimal GSO Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 060/122] doc: Change the min default value of tcp_wmem/tcp_rmem Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 061/122] net/mlx5e: Fix loopback self test when GRO is off Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 062/122] net_sched: gen_estimator: fix broken estimators based on percpu stats Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 063/122] net/sched: cls_u32: fix cls_u32 on filter replace Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 064/122] sctp: do not pr_err for the duplicated node in transport rhlist Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 065/122] mlxsw: spectrum_router: Fix error path in mlxsw_sp_vr_create Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 066/122] net: ipv4: Set addr_type in hash_keys for forwarded case Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.15 067/122] sctp: fix dst refcnt leak in sctp_v6_get_dst() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 068/122] bridge: Fix VLAN reference count problem Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 069/122] net/mlx5e: Verify inline header size do not exceed SKB linear size Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 070/122] tls: Use correct sk->sk_prot for IPV6 Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 071/122] amd-xgbe: Restore PCI interrupt enablement setting on resume Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 072/122] cls_u32: fix use after free in u32_destroy_key() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 073/122] mlxsw: spectrum_router: Do not unconditionally clear route offload indication Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 074/122] netlink: put module reference if dump start fails Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 075/122] tcp: purge write queue upon RST Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 076/122] tuntap: correctly add the missing XDP flush Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 077/122] tuntap: disable preemption during XDP processing Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 078/122] virtio-net: disable NAPI only when enabled during XDP set Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 079/122] cxgb4: fix trailing zero in CIM LA dump Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 080/122] net/mlx5: Fix error handling when adding flow rules Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 081/122] net: phy: Restore phy_resume() locking assumption Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 082/122] tcp: tracepoint: only call trace_tcp_send_reset with full socket Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 083/122] l2tp: dont use inet_shutdown on tunnel destroy Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 084/122] l2tp: dont use inet_shutdown on ppp session destroy Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 085/122] l2tp: fix races with tunnel socket close Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 086/122] l2tp: fix race in pppol2tp_release with session object destroy Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 087/122] l2tp: fix tunnel lookup use-after-free race Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 088/122] s390/qeth: fix underestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 089/122] s390/qeth: fix SETIP command handling Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 090/122] s390/qeth: fix overestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 091/122] s390/qeth: fix IP removal on offline cards Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 092/122] s390/qeth: fix double-free on IP add/remove race Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 093/122] Revert "s390/qeth: fix using of ref counter for rxip addresses" Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 094/122] s390/qeth: fix IP address lookup for L3 devices Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 095/122] s390/qeth: fix IPA command submission race Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 096/122] tcp: revert F-RTO middle-box workaround Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 097/122] tcp: revert F-RTO extension to detect more spurious timeouts Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 098/122] blk-mq: dont call io scheds .requeue_request when requeueing rq to ->dispatch Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 099/122] media: m88ds3103: dont call a non-initalized function Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 100/122] EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 101/122] KVM: s390: take care of clock-comparator sign control Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 102/122] KVM: s390: provide only a single function for setting the tod (fix SCK) Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 103/122] KVM: s390: consider epoch index on hotplugged CPUs Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 104/122] KVM: s390: consider epoch index on TOD clock syncs Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 105/122] nospec: Allow index argument to have const-qualified type Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 106/122] x86/mm: Fix {pmd,pud}_{set,clear}_flags() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 107/122] ARM: orion: fix orion_ge00_switch_board_info initialization Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 108/122] ARM: dts: rockchip: Remove 1.8 GHz operation point from phycore som Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 109/122] ARM: mvebu: Fix broken PL310_ERRATA_753970 selects Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 110/122] ARM: kvm: fix building with gcc-8 Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 111/122] KVM: X86: Fix SMRAM accessing even if VM is shutdown Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 112/122] KVM: mmu: Fix overlap between public and private memslots Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 113/122] KVM/x86: Remove indirect MSR op calls from SPEC_CTRL Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 114/122] KVM: x86: move LAPIC initialization after VMCS creation Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 115/122] KVM/VMX: Optimize vmx_vcpu_run() and svm_vcpu_run() by marking the RDMSR path as unlikely() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 116/122] KVM: x86: fix vcpu initialization with userspace lapic Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 117/122] KVM/x86: remove WARN_ON() for when vm_munmap() fails Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 118/122] ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530 Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 119/122] ARM: dts: LogicPD SOM-LV: Fix I2C1 pinmux Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 120/122] ARM: dts: LogicPD Torpedo: " Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 121/122] powerpc/64s/radix: Boot-time NULL pointer protection using a guard-PID Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.15 122/122] md: only allow remove_and_add_spares when no sync_thread running Greg Kroah-Hartman
2018-03-07 23:56 ` [PATCH 4.15 000/122] 4.15.8-stable review Shuah Khan
2018-03-08 17:25   ` Greg Kroah-Hartman
2018-03-08  7:12 ` Naresh Kamboju
2018-03-08 17:27   ` Greg Kroah-Hartman
2018-03-08 10:35 ` Thadeu Lima de Souza Cascardo
2018-03-08 17:27   ` Greg Kroah-Hartman
2018-03-08 17:42     ` Thadeu Lima de Souza Cascardo
2018-03-08 17:51       ` Greg Kroah-Hartman
2018-03-08 14:48 ` Guenter Roeck
2018-03-08 17:26   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307191737.450697477@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=ilyal@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).