Kernel Newbies Archive on lore.kernel.org
 help / color / Atom feed
* Mismatch between tcp_output.c and tcp_fastopen.c in net/ipv4
@ 2021-03-23 13:26 Navin P
  0 siblings, 0 replies; only message in thread
From: Navin P @ 2021-03-23 13:26 UTC (permalink / raw)
  To: kernelnewbies

Hi,

 I've a question regarding bytes_received and bytes_sent.

 https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_output.c#L1385

 In net/ipv4/tcp_output.c
 if (skb->len != tcp_header_size) {
tcp_event_data_sent(tp, sk);
tp->data_segs_out += tcp_skb_pcount(skb);
tp->bytes_sent += skb->len - tcp_header_size;
}


https://elixir.bootlin.com/linux/latest/source/net/ipv4/tcp_fastopen.c#L220

In net/ipv4/tcp_fastopen.c

/* u64_stats_update_begin(&tp->syncp) not needed here,
 * as we certainly are not changing upper 32bit value (0)
 */
tp->bytes_received = skb->len;

Above we miss tcp_header_size.

1. Shouldn't bytes_received be skb->len - tcp_header_size for
consistency ? I'm not sure if skb->len - tcp_header_size is correct .

2. Should it not be skb->len - tcp_header_size - ip_header_size -
skb->mac_len  ?

Can you please clarify on these ?

Regards,
Navin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 13:26 Mismatch between tcp_output.c and tcp_fastopen.c in net/ipv4 Navin P

Kernel Newbies Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git