From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org, davem@davemloft.net,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH net] sctp: remove the useless check in sctp_renege_events
Date: Mon, 12 Feb 2018 10:35:10 -0200 [thread overview]
Message-ID: <20180212123510.GK7402@localhost.localdomain> (raw)
In-Reply-To: <8db12ad85c54e5b56bc871e977bd71a1f6ea2e99.1518431484.git.lucien.xin@gmail.com>
On Mon, Feb 12, 2018 at 06:31:24PM +0800, Xin Long wrote:
> Remove the 'if (chunk)' check in sctp_renege_events for idata process,
> as all renege commands are generated in sctp_eat_data and it can't be
> NULL.
>
> The same thing we already did for common data in sctp_ulpq_renege.
>
> Fixes: 94014e8d871a ("sctp: implement renege_events for sctp_stream_interleave")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
For future reference, I don't think the Fixes tag is needed here, as
it was working and without performance impact.
> ---
> net/sctp/stream_interleave.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
> index c19fd42..65ac03b 100644
> --- a/net/sctp/stream_interleave.c
> +++ b/net/sctp/stream_interleave.c
> @@ -955,12 +955,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
> __u32 freed = 0;
> __u16 needed;
>
> - if (chunk) {
> - needed = ntohs(chunk->chunk_hdr->length);
> - needed -= sizeof(struct sctp_idata_chunk);
> - } else {
> - needed = SCTP_DEFAULT_MAXWINDOW;
> - }
> + needed = ntohs(chunk->chunk_hdr->length) -
> + sizeof(struct sctp_idata_chunk);
>
> if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) {
> freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed);
> --
> 2.1.0
>
next prev parent reply other threads:[~2018-02-12 12:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 10:31 [PATCH net] sctp: remove the useless check in sctp_renege_events Xin Long
2018-02-12 12:35 ` Marcelo Ricardo Leitner [this message]
2018-02-12 14:16 ` Neil Horman
2018-02-12 16:47 ` David Miller
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=20180212123510.GK7402@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).