lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Oct 2019 12:03:42 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Wally Zhao <wallyzhao@...il.com>, vyasevich@...il.com,
        nhorman@...driver.com, marcelo.leitner@...il.com,
        davem@...emloft.net, linux-sctp@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     wally.zhao@...ia-sbell.com
Subject: Re: [PATCH] sctp: set ooo_okay properly for Transmit Packet Steering



On 10/30/19 9:07 AM, 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;
> 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.
> 

While the patch seems fine, the changelog is quite confusing.

When skb->ooo_olay is 0 (which is the default for freshly allocated skbs),
the core networking stack will stick to whatever TX queue was chosen
at the time the dst_entry was attached to the (connected) socket.

This means no reorder can happen at all by default.

By setting ooo_okay carefully (as you did in your patch), you allow
core networking stack to _switch_ to another TX queue based on
current CPU  (XPS selection)

So even without your fix, SCTP should not experience out-of-order packets.

> Signed-off-by: Wally Zhao <wallyzhao@...il.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;
> +
>  	if (tp->af_specific->sctp_xmit(head, tp) >= 0 &&
>  	    tp->dst_pending_confirm)
>  		tp->dst_pending_confirm = 0;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ