stable.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, Yousuk Seung <ysseung@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	Yuchung Cheng <ycheng@google.com>,
	Eric Dumazet <edumazet@google.com>,
	Soheil Hassas Yeganeh <soheil@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.18 71/85] tcp: refactor tcp_ecn_check_ce to remove sk type cast
Date: Tue,  7 Aug 2018 20:52:13 +0200	[thread overview]
Message-ID: <20180807172359.994727227@linuxfoundation.org> (raw)
In-Reply-To: <20180807172357.357252052@linuxfoundation.org>

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

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

From: Yousuk Seung <ysseung@google.com>

[ Upstream commit f4c9f85f3b2cb7669830cd04d0be61192a4d2436 ]

Refactor tcp_ecn_check_ce and __tcp_ecn_check_ce to accept struct sock*
instead of tcp_sock* to clean up type casts. This is a pure refactor
patch.

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/tcp_input.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -221,8 +221,10 @@ static void tcp_ecn_withdraw_cwr(struct
 	tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR;
 }
 
-static void __tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
+static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb)
 {
+	struct tcp_sock *tp = tcp_sk(sk);
+
 	switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) {
 	case INET_ECN_NOT_ECT:
 		/* Funny extension: if ECT is not set on a segment,
@@ -230,31 +232,31 @@ static void __tcp_ecn_check_ce(struct tc
 		 * it is probably a retransmit.
 		 */
 		if (tp->ecn_flags & TCP_ECN_SEEN)
-			tcp_enter_quickack_mode((struct sock *)tp, 1);
+			tcp_enter_quickack_mode(sk, 1);
 		break;
 	case INET_ECN_CE:
-		if (tcp_ca_needs_ecn((struct sock *)tp))
-			tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_IS_CE);
+		if (tcp_ca_needs_ecn(sk))
+			tcp_ca_event(sk, CA_EVENT_ECN_IS_CE);
 
 		if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
 			/* Better not delay acks, sender can have a very low cwnd */
-			tcp_enter_quickack_mode((struct sock *)tp, 1);
+			tcp_enter_quickack_mode(sk, 1);
 			tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
 		}
 		tp->ecn_flags |= TCP_ECN_SEEN;
 		break;
 	default:
-		if (tcp_ca_needs_ecn((struct sock *)tp))
-			tcp_ca_event((struct sock *)tp, CA_EVENT_ECN_NO_CE);
+		if (tcp_ca_needs_ecn(sk))
+			tcp_ca_event(sk, CA_EVENT_ECN_NO_CE);
 		tp->ecn_flags |= TCP_ECN_SEEN;
 		break;
 	}
 }
 
-static void tcp_ecn_check_ce(struct tcp_sock *tp, const struct sk_buff *skb)
+static void tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb)
 {
-	if (tp->ecn_flags & TCP_ECN_OK)
-		__tcp_ecn_check_ce(tp, skb);
+	if (tcp_sk(sk)->ecn_flags & TCP_ECN_OK)
+		__tcp_ecn_check_ce(sk, skb);
 }
 
 static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th)
@@ -668,7 +670,7 @@ static void tcp_event_data_recv(struct s
 	}
 	icsk->icsk_ack.lrcvtime = now;
 
-	tcp_ecn_check_ce(tp, skb);
+	tcp_ecn_check_ce(sk, skb);
 
 	if (skb->len >= 128)
 		tcp_grow_window(sk, skb);
@@ -4231,7 +4233,7 @@ static void tcp_data_queue_ofo(struct so
 	struct sk_buff *skb1;
 	u32 seq, end_seq;
 
-	tcp_ecn_check_ce(tp, skb);
+	tcp_ecn_check_ce(sk, skb);
 
 	if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
 		NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFODROP);

  parent reply	other threads:[~2018-08-07 18:52 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 18:51 [PATCH 3.18 00/85] 3.18.118-stable review Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 01/85] tracing: Fix double free of event_trigger_data Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 02/85] tracing: Fix possible double free in event_enable_trigger_func() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 03/85] tracing/kprobes: Fix trace_probe flags on enable_trace_kprobe() failure Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 04/85] tracing: Quiet gcc warning about maybe unused link variable Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 05/85] ALSA: emu10k1: add error handling for snd_ctl_add Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 06/85] ALSA: fm801: " Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 07/85] mm: vmalloc: avoid racy handling of debugobjects in vunmap Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 08/85] mm/slub.c: add __printf verification to slab_err() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 09/85] rtc: ensure rtc_set_alarm fails when alarms are not supported Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 10/85] infiniband: fix a possible use-after-free bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 11/85] hvc_opal: dont set tb_ticks_per_usec in udbg_init_opal_common() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 12/85] RDMA/mad: Convert BUG_ONs to error flows Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 13/85] usbip: usbip_detach: Fix memory, udev context and udev leak Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 14/85] perf/x86/intel/uncore: Correct fixed counter index check in generic code Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 15/85] perf/x86/intel/uncore: Correct fixed counter index check for NHM Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 16/85] ASoC: dpcm: fix BE dai not hw_free and shutdown Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 17/85] mwifiex: handle race during mwifiex_usb_disconnect Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 18/85] wlcore: sdio: check for valid platform device data before suspend Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 19/85] PCI: Prevent sysfs disable of device while driver is attached Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 20/85] ath: Add regulatory mapping for FCC3_ETSIC Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 21/85] ath: Add regulatory mapping for ETSI8_WORLD Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 22/85] ath: Add regulatory mapping for APL13_WORLD Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 23/85] ath: Add regulatory mapping for APL2_FCCA Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 24/85] ath: Add regulatory mapping for Uganda Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 25/85] ath: Add regulatory mapping for Tanzania Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 26/85] ath: Add regulatory mapping for Serbia Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 27/85] ath: Add regulatory mapping for Bermuda Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 28/85] ath: Add regulatory mapping for Bahamas Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 33/85] powerpc/8xx: fix invalid register expression in head_8xx.S Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 34/85] PCI: pciehp: Request control of native hotplug only if supported Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 35/85] scsi: ufs: fix exception event handling Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 36/85] ALSA: emu10k1: Rate-limit error messages about page errors Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 37/85] regulator: pfuze100: add .is_enable() for pfuze100_swb_regulator_ops Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 38/85] md: fix NULL dereference of mddev->pers in remove_and_add_spares() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 39/85] media: smiapp: fix timeout checking in smiapp_read_nvm Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 40/85] ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 41/85] drm/radeon: fix mode_valids return type Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 43/85] HID: i2c-hid: check if device is there before really probing Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 44/85] tty: Fix data race in tty_insert_flip_string_fixed_flag Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 45/85] libata: Fix command retry decision Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 46/85] media: saa7164: Fix driver name in debug output Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 47/85] s390/cpum_sf: Add data entry sizes to sampling trailer entry Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 48/85] perf: fix invalid bit in diagnostic entry Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 49/85] scsi: 3w-9xxx: fix a missing-check bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 50/85] scsi: 3w-xxxx: " Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 51/85] scsi: megaraid: silence a static checker bug Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 52/85] bpf: fix references to free_bpf_prog_info() in comments Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 53/85] media: siano: get rid of __le32/__le16 cast warnings Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 54/85] ALSA: hda/ca0132: fix build failure when a local macro is defined Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 55/85] drm/gma500: fix psb_intel_lvds_mode_valid()s return type Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 56/85] ipconfig: Correctly initialise ic_nameservers Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 3.18 57/85] rsi: Fix invalid vdd warning in mmc Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 58/85] microblaze: Fix simpleImage format generation Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 59/85] usb: hub: Dont wait for connect state at resume for powered-off ports Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 60/85] crypto: authencesn - dont leak pointers to authenc keys Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 61/85] crypto: authenc " Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 62/85] media: omap3isp: fix unbalanced dma_iommu_mapping Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 63/85] media: si470x: fix __be16 annotations Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 64/85] random: mix rdrand with entropy sent in from userspace Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 65/85] squashfs: be more careful about metadata corruption Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 66/85] NET: stmmac: align DMA stuff to largest cache line length Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 67/85] xen-netfront: wait xenbus state change when load module manually Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 68/85] tcp: do not force quickack when receiving out-of-order packets Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 69/85] tcp: add max_quickacks param to tcp_incr_quickack and tcp_enter_quickack_mode Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 70/85] tcp: do not aggressively quick ack after ECN events Greg Kroah-Hartman
2018-08-07 18:52 ` Greg Kroah-Hartman [this message]
2018-08-07 18:52 ` [PATCH 3.18 72/85] tcp: add one more quick ack after " Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 73/85] ipv4: remove BUG_ON() from fib_compute_spec_dst Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 74/85] inet: frag: enforce memory limits earlier Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 75/85] net: dsa: Do not suspend/resume closed slave_dev Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 76/85] squashfs: more metadata hardening Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 78/85] can: ems_usb: Fix memory leak on ems_usb_disconnect() Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 79/85] virtio_balloon: fix another race between migration and ballooning Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 80/85] crypto: padlock-aes - Fix Nano workaround data corruption Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 81/85] scsi: sg: fix minor memory leak in error path Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 82/85] scsi: qla2xxx: Fix ISP recovery on unload Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 83/85] scsi: qla2xxx: Return error when TMF returns Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 84/85] ring_buffer: tracing: Inherit the tracing setting to next ring buffer Greg Kroah-Hartman
2018-08-07 18:52 ` [PATCH 3.18 85/85] jfs: Fix inconsistency between memory allocation and ea_buf->max_size Greg Kroah-Hartman
2018-08-07 22:33 ` [PATCH 3.18 00/85] 3.18.118-stable review Nathan Chancellor
2018-08-08  6:35   ` Greg Kroah-Hartman
2018-08-08  2:52 ` Shuah Khan
2018-08-08  5:29   ` Greg Kroah-Hartman
2018-08-08 16:05 ` Guenter Roeck

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=20180807172359.994727227@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=soheil@google.com \
    --cc=stable@vger.kernel.org \
    --cc=ycheng@google.com \
    --cc=ysseung@google.com \
    /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).