Netdev List
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, lucien.xin@gmail.com
Subject: Re: [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list.
Date: Thu, 28 Feb 2019 10:17:23 -0300	[thread overview]
Message-ID: <20190228131723.GB13343@localhost.localdomain> (raw)
In-Reply-To: <20190228122356.GA26023@hmswarspite.think-freely.org>

On Thu, Feb 28, 2019 at 07:23:56AM -0500, Neil Horman wrote:
> On Wed, Feb 27, 2019 at 11:19:58PM -0300, Marcelo Ricardo Leitner wrote:
> > On Wed, Feb 27, 2019 at 05:00:24PM -0800, David Miller wrote:
> > > 
> > > Pass this, instead of an event.  Then everything trickles down and we
> > > always have events a non-empty list.
> > > 
> > > Then we needs a list creating stub to place into .enqueue_event for sctp_stream_interleave_1.
> > > 
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > > ---
> > >  net/sctp/stream_interleave.c | 44 +++++++++++++++++++++++++++---------
> > >  1 file changed, 33 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
> > > index b6b251b8b3cf..0bc3d9329d9a 100644
> > > --- a/net/sctp/stream_interleave.c
> > > +++ b/net/sctp/stream_interleave.c
> > ...
> > > @@ -866,11 +867,15 @@ static int sctp_ulpevent_idata(struct sctp_ulpq *ulpq,
> > 
> > More context:
> >         if (!(event->msg_flags & SCTP_DATA_UNORDERED)) {
> >                 event = sctp_intl_reasm(ulpq, event);       [1]
> >                 if (event && event->msg_flags & MSG_EOR) {  [2]
> >                         skb_queue_head_init(&temp);
> >                         __skb_queue_tail(&temp, sctp_event2skb(event));
> > 
> >                         event = sctp_intl_order(ulpq, event);
> > >  		}
> > >  	} else {
> > >  		event = sctp_intl_reasm_uo(ulpq, event);
> > > +		if (event) {
> > > +			skb_queue_head_init(&temp);
> > > +			__skb_queue_tail(&temp, sctp_event2skb(event));
> > > +		}
> > >  	}
> > >  
> > >  	if (event) {
> > >  		event_eor = (event->msg_flags & MSG_EOR) ? 1 : 0;
> > > -		sctp_enqueue_event(ulpq, event);
> > > +		sctp_enqueue_event(ulpq, &temp);
> > 
> > [1] can return an event without MSG_EOR (a partial delivery), which
> > would skip the condition on [2] and cause temp to not be initialized
> > by here.  Same applies to sctp_ulpq_tail_data().
> > 
> I agree, it seems we canjust drop the msg_flags check and just key off of event
> being non-null, no?

Yes. Like:

        if (!(event->msg_flags & SCTP_DATA_UNORDERED)) {
                event = sctp_intl_reasm(ulpq, event);
                if (event) {
                        skb_queue_head_init(&temp);
                        __skb_queue_tail(&temp, sctp_event2skb(event));

                	if (event->msg_flags & MSG_EOR)
                        	event = sctp_intl_order(ulpq, event);
		}

Or some other clever way to handle it and reduce amount of the 'if
(event)' checks that we have in there. Maybe 'if (!event) goto out;'
helps.

  Marcelo

> 
> Neil
> 
> > It's the only thing I noticed on the series. Will test it tomorrow.
> > 
> > >  	}
> > >  
> > >  	return event_eor;
> > ...
> > 

      reply	other threads:[~2019-02-28 13:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  1:00 [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list David Miller
2019-02-28  2:19 ` Marcelo Ricardo Leitner
2019-02-28 12:23   ` Neil Horman
2019-02-28 13:17     ` Marcelo Ricardo Leitner [this message]

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=20190228131723.GB13343@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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