From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Wei Zhao <wallyzhao@gmail.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net,
linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, wally.zhao@nokia-sbell.com
Subject: Re: [PATCH] sctp: set ooo_okay properly for Transmit Packet Steering
Date: Wed, 30 Oct 2019 18:35:00 +0000 [thread overview]
Message-ID: <20191030183500.GH4250@localhost.localdomain> (raw)
In-Reply-To: <CAFRmqq42HqX5KctcNjwyZJ4jdknLSZ1EyBqHnJQQJx211mWopw@mail.gmail.com>
On Wed, Oct 30, 2019 at 11:54:45PM +0800, Wei Zhao wrote:
> On 10/30/19, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
> > On Wed, Oct 30, 2019 at 12:07:17PM -0400, Wally Zhao wrote:
> >> Unlike tcp_transmit_skb,
> >> sctp_packet_transmit does not set ooo_okay explicitly,
> >> causing unwanted Tx queue switching when multiqueue is in use;
> >
> > It is initialized to 0 by __alloc_skb() via:
> > memset(skb, 0, offsetof(struct sk_buff, tail));
> > and never set to 1 by anyone for SCTP.
> >
> > The patch description seems off. I don't see how the unwanted Tx queue
> > switching can happen. IOW, it's not fixing it OOO packets, but
> > improving it by allowing switching on the first packet. Am I missing
> > something?
>
> Thanks for pointing this out. You are right. This ooo_okay is default to false.
>
> I was observing some Tx queue switching before when testing with
> iperf3 (modified to be able to set window size, for higher throughput
> with long RTT), so I thought ooo_okay was set to true somewhere else
> after allocation. Just now I did the test again, it turns out that
> iperf3 made a re-connect silently which caused the Tx queue change.
Ah, okay.
>
> As for the improving purpose of this patch, that is not that critical
> from my side, and the patch description is not correct for this
> purpose. So I will give up this patch attempt. Thank you again for
> your time on this.
As you wish. If you don't have the time for it, ok, but the
improvement is welcomed. With a more accurate description and using
tp->flight_size instead, it should be good.
Thanks,
Marcelo
>
> >
> >> Tx queue switching may cause out-of-order packets.
> >> Change sctp_packet_transmit to allow Tx queue switching only for
> >> the first in flight packet, to avoid unwanted Tx queue switching.
> >>
> >> Signed-off-by: Wally Zhao <wallyzhao@gmail.com>
> >> ---
> >> net/sctp/output.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/net/sctp/output.c b/net/sctp/output.c
> >> index dbda7e7..5ff75cc 100644
> >> --- a/net/sctp/output.c
> >> +++ b/net/sctp/output.c
> >> @@ -626,6 +626,10 @@ int sctp_packet_transmit(struct sctp_packet *packet,
> >> gfp_t gfp)
> >> /* neighbour should be confirmed on successful transmission or
> >> * positive error
> >> */
> >> +
> >> + /* allow switch tx queue only for the first in flight pkt */
> >> + head->ooo_okay = asoc->outqueue.outstanding_bytes = 0;
> >
> > Considering we are talking about NIC queues here, we would have a
> > better result with tp->flight_size instead. As in, we can switch
> > queues if, for this transport, the queue is empty.
> >
> >> +
> >> if (tp->af_specific->sctp_xmit(head, tp) >= 0 &&
> >> tp->dst_pending_confirm)
> >> tp->dst_pending_confirm = 0;
> >> --
> >> 1.8.3.1
> >>
> >
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Wei Zhao <wallyzhao@gmail.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net,
linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, wally.zhao@nokia-sbell.com
Subject: Re: [PATCH] sctp: set ooo_okay properly for Transmit Packet Steering
Date: Wed, 30 Oct 2019 15:35:00 -0300 [thread overview]
Message-ID: <20191030183500.GH4250@localhost.localdomain> (raw)
In-Reply-To: <CAFRmqq42HqX5KctcNjwyZJ4jdknLSZ1EyBqHnJQQJx211mWopw@mail.gmail.com>
On Wed, Oct 30, 2019 at 11:54:45PM +0800, Wei Zhao wrote:
> On 10/30/19, Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
> > On Wed, Oct 30, 2019 at 12:07:17PM -0400, Wally Zhao wrote:
> >> Unlike tcp_transmit_skb,
> >> sctp_packet_transmit does not set ooo_okay explicitly,
> >> causing unwanted Tx queue switching when multiqueue is in use;
> >
> > It is initialized to 0 by __alloc_skb() via:
> > memset(skb, 0, offsetof(struct sk_buff, tail));
> > and never set to 1 by anyone for SCTP.
> >
> > The patch description seems off. I don't see how the unwanted Tx queue
> > switching can happen. IOW, it's not fixing it OOO packets, but
> > improving it by allowing switching on the first packet. Am I missing
> > something?
>
> Thanks for pointing this out. You are right. This ooo_okay is default to false.
>
> I was observing some Tx queue switching before when testing with
> iperf3 (modified to be able to set window size, for higher throughput
> with long RTT), so I thought ooo_okay was set to true somewhere else
> after allocation. Just now I did the test again, it turns out that
> iperf3 made a re-connect silently which caused the Tx queue change.
Ah, okay.
>
> As for the improving purpose of this patch, that is not that critical
> from my side, and the patch description is not correct for this
> purpose. So I will give up this patch attempt. Thank you again for
> your time on this.
As you wish. If you don't have the time for it, ok, but the
improvement is welcomed. With a more accurate description and using
tp->flight_size instead, it should be good.
Thanks,
Marcelo
>
> >
> >> Tx queue switching may cause out-of-order packets.
> >> Change sctp_packet_transmit to allow Tx queue switching only for
> >> the first in flight packet, to avoid unwanted Tx queue switching.
> >>
> >> Signed-off-by: Wally Zhao <wallyzhao@gmail.com>
> >> ---
> >> net/sctp/output.c | 4 ++++
> >> 1 file changed, 4 insertions(+)
> >>
> >> diff --git a/net/sctp/output.c b/net/sctp/output.c
> >> index dbda7e7..5ff75cc 100644
> >> --- a/net/sctp/output.c
> >> +++ b/net/sctp/output.c
> >> @@ -626,6 +626,10 @@ int sctp_packet_transmit(struct sctp_packet *packet,
> >> gfp_t gfp)
> >> /* neighbour should be confirmed on successful transmission or
> >> * positive error
> >> */
> >> +
> >> + /* allow switch tx queue only for the first in flight pkt */
> >> + head->ooo_okay = asoc->outqueue.outstanding_bytes == 0;
> >
> > Considering we are talking about NIC queues here, we would have a
> > better result with tp->flight_size instead. As in, we can switch
> > queues if, for this transport, the queue is empty.
> >
> >> +
> >> if (tp->af_specific->sctp_xmit(head, tp) >= 0 &&
> >> tp->dst_pending_confirm)
> >> tp->dst_pending_confirm = 0;
> >> --
> >> 1.8.3.1
> >>
> >
next prev parent reply other threads:[~2019-10-30 18:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 8:08 [PATCH] sctp: set ooo_okay properly for Transmit Packet Steering Wally Zhao
2019-10-30 16:07 ` Wally Zhao
2019-10-30 13:24 ` Marcelo Ricardo Leitner
2019-10-30 13:24 ` Marcelo Ricardo Leitner
2019-10-30 15:54 ` Wei Zhao
2019-10-30 15:54 ` Wei Zhao
2019-10-30 18:35 ` Marcelo Ricardo Leitner [this message]
2019-10-30 18:35 ` Marcelo Ricardo Leitner
2019-10-30 19:03 ` Eric Dumazet
2019-10-30 19:03 ` Eric Dumazet
2019-10-31 1:11 ` Wei Zhao
2019-10-31 1:11 ` Wei Zhao
2019-11-04 8:46 ` [sctp] 327fecdaf3: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2019-11-04 8:46 ` kernel test robot
2019-11-04 13:25 ` Marcelo Ricardo Leitner
2019-11-04 13:25 ` Marcelo Ricardo Leitner
2019-11-04 13:25 ` [sctp] 327fecdaf3: BUG:kernel_NULL_pointer_dereference, address Marcelo Ricardo Leitner
2019-11-04 14:14 ` [sctp] 327fecdaf3: BUG:kernel_NULL_pointer_dereference,address Wei Zhao
2019-11-04 14:14 ` Wei Zhao
2019-11-04 14:49 ` Marcelo Ricardo Leitner
2019-11-04 14:49 ` Marcelo Ricardo Leitner
2019-11-04 14:49 ` [sctp] 327fecdaf3: BUG:kernel_NULL_pointer_dereference, address Marcelo Ricardo Leitner
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=20191030183500.GH4250@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.com \
--cc=wally.zhao@nokia-sbell.com \
--cc=wallyzhao@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.