From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: David Laight <David.Laight@aculab.com>,
network dev <netdev@vger.kernel.org>,
"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
Neil Horman <nhorman@tuxdriver.com>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCHv3 net-next 1/5] sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification
Date: Fri, 25 Oct 2019 00:22:06 -0300 [thread overview]
Message-ID: <20191025032206.GB4326@localhost.localdomain> (raw)
In-Reply-To: <CADvbK_eQrXs4VC+OgsLibA-q2VkkdKXTK+meaRGbxJDK41aLKg@mail.gmail.com>
On Sat, Oct 19, 2019 at 04:55:01PM +0800, Xin Long wrote:
> > > @@ -801,14 +801,6 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
> > > spc_state = SCTP_ADDR_CONFIRMED;
> > > else
> > > spc_state = SCTP_ADDR_AVAILABLE;
> > > - /* Don't inform ULP about transition from PF to
> > > - * active state and set cwnd to 1 MTU, see SCTP
> > > - * Quick failover draft section 5.1, point 5
> > > - */
> > > - if (transport->state == SCTP_PF) {
> > > - ulp_notify = false;
> > > - transport->cwnd = asoc->pathmtu;
> > > - }
> >
> > This is wrong.
> > If the old state is PF and the application hasn't exposed PF the event should be
> > ignored.
> yeps, in Patch 2/5:
> + if (transport->state == SCTP_PF &&
> + asoc->pf_expose != SCTP_PF_EXPOSE_ENABLE)
> + ulp_notify = false;
> + else if (transport->state == SCTP_UNCONFIRMED &&
> + error == SCTP_HEARTBEAT_SUCCESS)
> spc_state = SCTP_ADDR_CONFIRMED;
> else
> spc_state = SCTP_ADDR_AVAILABLE;
Right, yet for one bisecting the kernel, a checkout on this patch will
see this change regardless of patch 2. Patches 1 and 2 could be
swapped to avoid this situation.
>
> >
> > > transport->state = SCTP_ACTIVE;
> > > break;
> > >
> > > @@ -817,19 +809,18 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
> > > * to inactive state. Also, release the cached route since
> > > * there may be a better route next time.
> > > */
> > > - if (transport->state != SCTP_UNCONFIRMED)
> > > + if (transport->state != SCTP_UNCONFIRMED) {
> > > transport->state = SCTP_INACTIVE;
> > > - else {
> > > + spc_state = SCTP_ADDR_UNREACHABLE;
> > > + } else {
> > > sctp_transport_dst_release(transport);
> > > ulp_notify = false;
> > > }
> > > -
> > > - spc_state = SCTP_ADDR_UNREACHABLE;
> > > break;
> > >
> > > case SCTP_TRANSPORT_PF:
> > > transport->state = SCTP_PF;
> > > - ulp_notify = false;
> >
> > Again the event should be supressed if PF isn't exposed.
> it will be suppressed after Patch 2/5:
> + if (asoc->pf_expose != SCTP_PF_EXPOSE_ENABLE)
> + ulp_notify = false;
> + else
> + spc_state = SCTP_ADDR_POTENTIALLY_FAILED;
> break;
Same here.
>
> >
> > > + spc_state = SCTP_ADDR_POTENTIALLY_FAILED;
> > > break;
> > >
> > > default:
> > > --
> > > 2.1.0
> >
> > I also haven't spotted where the test that the application has actually enabled
> > state transition events is in the code.
> all events will be created, but dropped in sctp_ulpq_tail_event() when trying
> to deliver up:
>
> /* Check if the user wishes to receive this event. */
> if (!sctp_ulpevent_is_enabled(event, ulpq->asoc->subscribe))
> goto out_free;
>
> > I'd have thought it would be anything is built and allocated.
> >
> > David
> >
> > -
> > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> > Registration No: 1397386 (Wales)
> >
>
next prev parent reply other threads:[~2019-10-25 3:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 6:14 [PATCHv3 net-next 0/5] sctp: update from rfc7829 Xin Long
2019-10-14 6:14 ` [PATCHv3 net-next 1/5] sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification Xin Long
2019-10-14 6:14 ` [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc Xin Long
2019-10-14 6:14 ` [PATCHv3 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt Xin Long
2019-10-14 6:14 ` [PATCHv3 net-next 4/5] sctp: add support for Primary Path Switchover Xin Long
2019-10-14 6:14 ` [PATCHv3 net-next 5/5] sctp: add SCTP_PEER_ADDR_THLDS_V2 sockopt Xin Long
2019-10-25 3:25 ` [PATCHv3 net-next 4/5] sctp: add support for Primary Path Switchover Marcelo Ricardo Leitner
2019-10-25 8:13 ` Xin Long
2019-10-25 3:24 ` [PATCHv3 net-next 3/5] sctp: add SCTP_EXPOSE_POTENTIALLY_FAILED_STATE sockopt Marcelo Ricardo Leitner
2019-10-25 8:05 ` Xin Long
2019-10-25 3:23 ` [PATCHv3 net-next 2/5] sctp: add pf_expose per netns and sock and asoc Marcelo Ricardo Leitner
2019-10-25 8:02 ` Xin Long
2019-10-25 9:00 ` David Laight
2019-10-25 13:21 ` 'Marcelo Ricardo Leitner'
2019-10-25 14:26 ` David Laight
2019-10-25 14:45 ` 'Marcelo Ricardo Leitner'
2019-10-18 15:56 ` [PATCHv3 net-next 1/5] sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification David Laight
2019-10-19 8:55 ` Xin Long
2019-10-22 11:13 ` Xin Long
2019-10-25 3:22 ` Marcelo Ricardo Leitner [this message]
2019-10-25 7:58 ` Xin Long
2019-10-25 3:21 ` Marcelo Ricardo Leitner
2019-10-25 7:59 ` Xin Long
2019-10-14 12:42 ` [PATCHv3 net-next 0/5] sctp: update from rfc7829 Neil Horman
2019-10-16 0:56 ` David Miller
2019-10-16 10:42 ` David Laight
2019-10-17 4:56 ` Xin Long
2019-10-17 9:04 ` David Laight
2019-10-16 18:25 ` David Miller
2019-10-16 18:32 ` Marcelo Ricardo Leitner
2019-10-16 19:04 ` 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=20191025032206.GB4326@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=David.Laight@aculab.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).