netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ilya Lesokhin <ilyal@mellanox.com>,
	netdev@vger.kernel.org, davem@davemloft.net
Cc: davejwatson@fb.com, tom@herbertland.com,
	hannes@stressinduktion.org, borisp@mellanox.com,
	aviadye@mellanox.com, liranl@mellanox.com
Subject: Re: [PATCH v3 net-next 1/6] tcp: Add clean acked data hook
Date: Tue, 19 Dec 2017 11:13:24 -0800	[thread overview]
Message-ID: <1513710804.64874.3.camel@gmail.com> (raw)
In-Reply-To: <20171218111033.13256-2-ilyal@mellanox.com>

On Mon, 2017-12-18 at 13:10 +0200, Ilya Lesokhin wrote:
> Called when a TCP segment is acknowledged.
> Could be used by application protocols who hold additional
> metadata associated with the stream data
> This is required by TLS device offload to release
> metadata associated with acknowledged TLS records.
> 
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
> Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
> ---
>  include/net/inet_connection_sock.h | 2 ++
>  net/ipv4/tcp_input.c               | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
> index 8e1bf9ae4a5e..ec405a667a85 100644
> --- a/include/net/inet_connection_sock.h
> +++ b/include/net/inet_connection_sock.h
> @@ -77,6 +77,7 @@ struct inet_connection_sock_af_ops {
>   * @icsk_af_ops		   Operations which are AF_INET{4,6} specific
>   * @icsk_ulp_ops	   Pluggable ULP control hook
>   * @icsk_ulp_data	   ULP private data
> + * @icsk_clean_acked	   Clean acked data hook
>   * @icsk_listen_portaddr_node	hash to the portaddr listener hashtable
>   * @icsk_ca_state:	   Congestion control state
>   * @icsk_retransmits:	   Number of unrecovered [RTO] timeouts
> @@ -102,6 +103,7 @@ struct inet_connection_sock {
>  	const struct inet_connection_sock_af_ops *icsk_af_ops;
>  	const struct tcp_ulp_ops  *icsk_ulp_ops;
>  	void			  *icsk_ulp_data;
> +	void			  (*icsk_clean_acked)(struct sock *sk);
>  	struct hlist_node         icsk_listen_portaddr_node;
>  	unsigned int		  (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
>  	__u8			  icsk_ca_state:6,
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 4d55c4b338ee..961abc5be84c 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3592,6 +3592,9 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
>  	if (!prior_packets)
>  		goto no_queue;
>  
> +	if (icsk->icsk_clean_acked)
> +		icsk->icsk_clean_acked(sk);
> +
>  	/* See if we can take anything off of the retransmit queue. */
>  	flag |= tcp_clean_rtx_queue(sk, prior_fack, prior_snd_una, &sack_state);
>  

1) tcp_ack() is already very expensive.

2) Since you do not pass any state here, this looks very suspicious to
me.

  reply	other threads:[~2017-12-19 19:13 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 11:10 [PATCH v3 net-next 0/6] tls: Add generic NIC offload infrastructure Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 1/6] tcp: Add clean acked data hook Ilya Lesokhin
2017-12-19 19:13   ` Eric Dumazet [this message]
2017-12-19 19:21     ` Ilya Lesokhin
2017-12-19 19:28       ` Eric Dumazet
2017-12-19 19:43         ` Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 2/6] net: Rename and export copy_skb_header Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 3/6] net: Add SW fallback infrastructure for offloaded sockets Ilya Lesokhin
2017-12-18 19:18   ` Marcelo Ricardo Leitner
2017-12-19  7:51     ` Ilya Lesokhin
2017-12-19 15:05       ` Marcelo Ricardo Leitner
2017-12-19 19:12   ` Eric Dumazet
2017-12-19 19:15     ` Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 4/6] net: Add TLS offload netdev ops Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 5/6] net: Add TLS TX offload features Ilya Lesokhin
2017-12-18 11:10 ` [PATCH v3 net-next 6/6] tls: Add generic NIC offload infrastructure Ilya Lesokhin
2017-12-18 19:53   ` Marcelo Ricardo Leitner
2017-12-19  7:31     ` Ilya Lesokhin
2017-12-19 15:11       ` Marcelo Ricardo Leitner
2017-12-19 15:38         ` Ilya Lesokhin
2017-12-19 16:18           ` Marcelo Ricardo Leitner
2017-12-19  7:00   ` kbuild test robot
2017-12-19  7:01   ` kbuild test robot
2017-12-19  8:17   ` kbuild test robot
2017-12-19  8:17   ` [RFC PATCH] tls: tls_sw_fallback() can be static kbuild test robot
2017-12-18 17:10 ` [PATCH v3 net-next 0/6] tls: Add generic NIC offload infrastructure Jiri Pirko
2017-12-19 10:30   ` Jiri Pirko
2017-12-20  8:28     ` Boris Pismenny
2017-12-20 10:08       ` Jiri Pirko
2017-12-20 10:15       ` Or Gerlitz
2017-12-20 10:31         ` Or Gerlitz
2017-12-20 16:12       ` David Miller
2017-12-20 16:23         ` Ilya Lesokhin
2017-12-20 16:36           ` David Miller
2017-12-20 19:12             ` Jiri Pirko

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=1513710804.64874.3.camel@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=aviadye@mellanox.com \
    --cc=borisp@mellanox.com \
    --cc=davejwatson@fb.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=ilyal@mellanox.com \
    --cc=liranl@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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).