[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADvbK_dxTYrPPFJT5UPZErZLbW9y9oRm+VWbQXxhruwV6UgOZA@mail.gmail.com>
Date: Fri, 9 Sep 2016 01:34:05 +0800
From: Xin Long <lucien.xin@...il.com>
To: Neil Horman <nhorman@...driver.com>
Cc: network dev <netdev@...r.kernel.org>, linux-sctp@...r.kernel.org,
davem <davem@...emloft.net>,
Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
Vlad Yasevich <vyasevich@...il.com>, daniel@...earbox.net
Subject: Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail
>> Data Chunks are only sent by sctp_primitive_SEND, in which sctp checks
>> the asoc's state through statetable before calling sctp_outq_tail. So
>> there's no need to do it again in sctp_outq_tail.
>>
>> This patch is to remove it from sctp_outq_tail.
>>
>> Signed-off-by: Xin Long <lucien.xin@...il.com>
> This doesn't seem safe to me. The send operation is handled in side effect
> processing off a queue that might have operations queued ahead of it, which
> affect the associations state. I think you need to keep this check in place
>
But not really for Data Chunk.
There are 3 places calling sctp_outq_tail.
1. in sctp_assoc_rwnd_increase():
it's for sending sack chunk, so this patch is safe for here
2. sctp_cmd_interpreter(), SCTP_CMD_REPLY:
still not Data Chunk, so safe.
3.SCTP_CMD_SEND_MSG: -> sctp_cmd_send_msg()
it's for Data Chunk, but it's only called by sctp_sf_do_prm_send().
#define TYPE_SCTP_PRIMITIVE_SEND { \
...
/* SCTP_STATE_COOKIE_WAIT */ \
TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \
/* SCTP_STATE_COOKIE_ECHOED */ \
TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \
/* SCTP_STATE_ESTABLISHED */ \
TYPE_SCTP_FUNC(sctp_sf_do_prm_send), \
/* SCTP_STATE_SHUTDOWN_PENDING */ \
in sctp_sf_do_prm_send():
sctp_add_cmd_sf(commands, SCTP_CMD_SEND_MSG, SCTP_DATAMSG(msg));
return SCTP_DISPOSITION_CONSUME;
This function is called by PRIMITIVE_SEND, and every time after
calling sctp_do_sm(), there must be no operations inside.
so it's impossible that other operations queued ahead of it.
I'm not sure if I miss some special case, pls correct me if I'm wrong.
Thanks.
Powered by blists - more mailing lists