From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61BA4C43381 for ; Thu, 28 Feb 2019 13:17:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E8572084D for ; Thu, 28 Feb 2019 13:17:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RuP3PgqY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731198AbfB1NR2 (ORCPT ); Thu, 28 Feb 2019 08:17:28 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37469 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726913AbfB1NR2 (ORCPT ); Thu, 28 Feb 2019 08:17:28 -0500 Received: by mail-qt1-f194.google.com with SMTP id a48so23385022qtb.4 for ; Thu, 28 Feb 2019 05:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=71on5QCg//PWaXslY5S+RInC3CDij2kn2z8Ty+x0z/8=; b=RuP3PgqY7oQHs8VUGbY2sQNpe8C+QtfYbn18vAABaqM9H/9nVv+ZYX8k2tsa9dxGp0 8ikNcPuhA9zaUjw1Ycg2oTtYGCtBZkKo7WhSzDyshbbGx+NGju93vZriAMF7OOFufwiU zVykmVJnYXxfCvRBVBU6XLNCggiPtM7kAgqvFBRobUZOhlfwxikXNtoHTxAMZF+MYdpn NYvn05l1/pjkR7y5o57Cb70TJkrJavI6/QYpeUr9O1OVVit+fGGMGXIY5frR2j02RdgT t4nCbHPbD+e9nInFwsrFlGFVDeBZWgqBj9ntz7XKdKFSBsnIIwVx58tlA5OvWUmMBOtP EvNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=71on5QCg//PWaXslY5S+RInC3CDij2kn2z8Ty+x0z/8=; b=CiAdFUcArFKZgKTOfZCFeh/hZoJwc1ZrbzE/CK+PAtoq2zGRzze4lmh1qLRjLsEI/1 SDB32WuUmMhRV/CB5aHK0CbjvubG2NKwj86ulRJdwYTgNq6TDG66mjgIfSVuPbxIhOK2 tZANBSqvOJAof2VGowvqhWGpTo/yx2gtYhoGDWrKlRpNdYOes4BM9RLyVjWvPGT+4Mjo 34d/4AzSJXVYRFubqOxqdneUBWHKrSOgCcSnv0Ke3LzMPMv44LyB/ol9Bp6lMd+5V5im 8gsQIUv01Ezqr4UAgRQMLOrRKvhytkE+jR/ioJq360cDB1nCJW/BvB8I34fwJZVbrSDD 3wmQ== X-Gm-Message-State: AHQUAuZVbGppkXmuvfYOep2skK4WOiFEY0KDJFi5l+0QLwZnvwjeae2R UYXUvp/SijLlZL3CyMmmR54= X-Google-Smtp-Source: APXvYqzP4xt36lWAOj5s/Wat0R+7FbD9wr7Uw08A9sow+TNUBgV/lln1J2ovq4xohACgikKV/XeCTg== X-Received: by 2002:aed:23e1:: with SMTP id k30mr6185416qtc.17.1551359846923; Thu, 28 Feb 2019 05:17:26 -0800 (PST) Received: from localhost.localdomain ([2001:1284:f016:a307:76c1:1c91:d108:16d4]) by smtp.gmail.com with ESMTPSA id u13sm13483344qtb.2.2019.02.28.05.17.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 05:17:25 -0800 (PST) Received: by localhost.localdomain (Postfix, from userid 1000) id 304BD180CD5; Thu, 28 Feb 2019 10:17:23 -0300 (-03) Date: Thu, 28 Feb 2019 10:17:23 -0300 From: Marcelo Ricardo Leitner To: Neil Horman Cc: David Miller , netdev@vger.kernel.org, lucien.xin@gmail.com Subject: Re: [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list. Message-ID: <20190228131723.GB13343@localhost.localdomain> References: <20190227.170024.1735727318522180688.davem@davemloft.net> <20190228021958.GA13343@localhost.localdomain> <20190228122356.GA26023@hmswarspite.think-freely.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190228122356.GA26023@hmswarspite.think-freely.org> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 > > > --- > > > 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; > > ... > >