All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] Re: [RFC PATCH 07/12] mptcp: cleanup mptcp_subflow_discard_data()
@ 2020-08-03 10:54 Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2020-08-03 10:54 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

On Sun, 2020-08-02 at 01:18 +0200, Florian Westphal wrote:
> Paolo Abeni <pabeni(a)redhat.com> wrote:
> 
> Hmmm, a changelog would have been nice 8-)

whoops... I added the comments to most patch just before the submit,
but I forgot about this one...
> 
> > -	/* discard mapped data */
> > -	pr_debug("discarding %zu bytes, current map len=%d", delta,
> > -		 map_remaining);
> > -	if (delta) {
> > -		read_descriptor_t desc = {
> > -			.count = delta,
> > -		};
> > -		int ret;
> > -
> > -		ret = tcp_read_sock(ssk, &desc, subflow_read_actor);
> 
> tcp_read_sock tosses 'delta' bytes, and may zap multiple skbs, but after
> this change only at most one skb gets tossed.
> 
> >  	return 0;
> >  }
> 
> Nit: After this change, mptcp_subflow_discard_data() always returns 0.
> 
> > @@ -853,7 +824,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
> >  		/* only accept in-sequence mapping. Old values are spurious
> >  		 * retransmission
> >  		 */
> > -		if (mptcp_subflow_discard_data(ssk, old_ack - ack_seq))
> > +		if (mptcp_subflow_discard_data(ssk, skb, old_ack - ack_seq))
> >  			goto fatal;
> 
> ... so this conditional can be removed.
> 
> >  		return false;
> 
> Wouldn't it make sense to get rid of the return false too so that this
> checks if there is another skb to process?  This would also obsolete my
> 'may zap multiple skbs' comment above since the caller would invoke the
> discard helper again if next skb is also outdated.

Yep, will look at this option.

Thanks!

/P

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [MPTCP] Re: [RFC PATCH 07/12] mptcp: cleanup mptcp_subflow_discard_data()
@ 2020-08-01 23:18 Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2020-08-01 23:18 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Paolo Abeni <pabeni(a)redhat.com> wrote:

Hmmm, a changelog would have been nice 8-)

> -	/* discard mapped data */
> -	pr_debug("discarding %zu bytes, current map len=%d", delta,
> -		 map_remaining);
> -	if (delta) {
> -		read_descriptor_t desc = {
> -			.count = delta,
> -		};
> -		int ret;
> -
> -		ret = tcp_read_sock(ssk, &desc, subflow_read_actor);

tcp_read_sock tosses 'delta' bytes, and may zap multiple skbs, but after
this change only at most one skb gets tossed.

>  	return 0;
>  }

Nit: After this change, mptcp_subflow_discard_data() always returns 0.

> @@ -853,7 +824,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
>  		/* only accept in-sequence mapping. Old values are spurious
>  		 * retransmission
>  		 */
> -		if (mptcp_subflow_discard_data(ssk, old_ack - ack_seq))
> +		if (mptcp_subflow_discard_data(ssk, skb, old_ack - ack_seq))
>  			goto fatal;

... so this conditional can be removed.

>  		return false;

Wouldn't it make sense to get rid of the return false too so that this
checks if there is another skb to process?  This would also obsolete my
'may zap multiple skbs' comment above since the caller would invoke the
discard helper again if next skb is also outdated.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-03 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 10:54 [MPTCP] Re: [RFC PATCH 07/12] mptcp: cleanup mptcp_subflow_discard_data() Paolo Abeni
  -- strict thread matches above, loose matches on Subject: below --
2020-08-01 23:18 Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.