[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190210153328.44ur6o5z2xjae42c@wunner.de>
Date: Sun, 10 Feb 2019 16:33:28 +0100
From: Lukas Wunner <lukas@...ner.de>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
Andreas Noever <andreas.noever@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v2 14/28] thunderbolt: Extend tunnel creation to more
than 2 adjacent switches
On Wed, Feb 06, 2019 at 04:17:24PM +0300, Mika Westerberg wrote:
> Now that we can allocate hop IDs per port on a path, we can take
> advantage of this and create tunnels covering longer paths than just
> between two adjacent switches. PCIe actually does not need this as it is
> always a daisy chain between two adjacent switches but this way we do
> not need to hard-code creation of the tunnel.
That doesn't seem to be correct, at the bottom of this page there's
a figure showing a PCI tunnel between non-adjacent switches (blue line):
https://developer.apple.com/library/archive/documentation/HardwareDrivers/Conceptual/ThunderboltDevGuide/Basics/Basics.html
I'm not sure if there are advantages to such tunnels: Reduced latency
perhaps because packets need not pass through PCIe adapters on the
in-between device? Or maybe this allows for more fine-grained traffic
prioritization?
> + i = 0;
> + tb_for_each_port(in_port, src, dst)
> + i++;
This looks more complicated than necessary. Isn't the path length
always the length of the route string from in_port switch to out_port
switch, plus 2 for the adapter on each end? Or do paths without
adapters exist?
> + for (i = 0; i < num_hops; i++) {
> + in_port = tb_port_get_next(src, dst, out_port);
> +
> + if (in_port->dual_link_port && in_port->link_nr != link_nr)
> + in_port = in_port->dual_link_port;
> +
> + ret = tb_port_alloc_in_hopid(in_port, in_hopid, -1);
> + if (ret < 0)
> + goto err;
> + in_hopid = ret;
> +
> + out_port = tb_port_get_next(src, dst, in_port);
> + if (!out_port)
> + goto err;
There's a NULL pointer check here, but the invocation of tb_port_get_next()
further up to assign in_port lacks such a check. Is it guaranteed to never
be NULL?
Thanks,
Lukas
Powered by blists - more mailing lists