From: marcelo.leitner@gmail.com
To: linux-sctp@vger.kernel.org
Subject: Re: sctp: Add GSO support
Date: Mon, 06 Jun 2016 21:07:50 +0000 [thread overview]
Message-ID: <20160606210750.GF22680@localhost.localdomain> (raw)
In-Reply-To: <20160606201646.GA5425@mwanda>
On Mon, Jun 06, 2016 at 11:42:38PM +0300, Dan Carpenter wrote:
> It's fairly tricky to follow actually. Here is one caller:
>
> net/sctp/outqueue.c
> 706 static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
> 707 {
> 708 struct sctp_packet *packet;
> 709 struct sctp_packet singleton;
> 710 struct sctp_association *asoc = q->asoc;
> ^^^^^^^^^^^^^^
> asoc is set here.
>
> 711 __u16 sport = asoc->base.bind_addr.port;
> 712 __u16 dport = asoc->peer.port;
> 713 __u32 vtag = asoc->peer.i.init_tag;
> 714 struct sctp_transport *transport = NULL;
> 715 struct sctp_transport *new_transport;
> 716 struct sctp_chunk *chunk, *tmp;
> 717 sctp_xmit_t status;
>
> [ snip ]
>
> 800
> 801 /* Are we switching transports?
> 802 * Take care of transport locks.
> 803 */
> 804 if (new_transport != transport) {
> 805 transport = new_transport;
> 806 if (list_empty(&transport->send_ready)) {
> 807 list_add_tail(&transport->send_ready,
> 808 &transport_list);
> 809 }
> 810 packet = &transport->packet;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> packet is set here. How do we know that "packect->transport->asoc" and
> "asoc" are the same? It's complicated.
Yes agreed, very tricky. It's somewhat redundant information, but that
makes life easier during different stages of its life cycle.
It's like: packets are created at sctp_outq_flush (and some other
places), and then sits on an outq which belongs to a given asoc, just
like the transport. But transports doesn't have queues yet that packet
created is arranged to be sent through a given transport.
And transports always belong to a single asoc, so it's two different
ways of reaching to the same info.
v
packet->transport->asoc = packet->transport->asoc.outq->asoc
^----------´
And to make it even more complicated, with have sctp_do_peeloff(), which
will take all packets belonging to a given asoc from one socket and move
to another, potentially updating asoc pointer during that.
> 811 sctp_packet_config(packet, vtag,
> 812 asoc->peer.ecn_capable);
> 813 }
>
> Anyway, maybe eventually we'll figure out a way to make it work but even
> just reading it manually is quite complicated....
>
> For now, just ignore the false postive.
Okay. Let me know if I can help any further.
Thanks,
Marcelo
prev parent reply other threads:[~2016-06-06 21:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 20:16 sctp: Add GSO support Dan Carpenter
2016-06-06 20:26 ` marcelo.leitner
2016-06-06 20:42 ` Dan Carpenter
2016-06-06 21:07 ` marcelo.leitner [this message]
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=20160606210750.GF22680@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=linux-sctp@vger.kernel.org \
/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).