* [PATCH] aic94xx: fix routing algorithms
@ 2006-07-09 20:41 James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2006-07-09 20:41 UTC (permalink / raw)
To: linux-scsi
I've been trying to work out for a while why certain cascaded expander
configurations work with the mptsas, but don't with the aic94xx.
Eventually I discovered that the non-functional configurations are the
ones where the cascaded expander is connected to the parent on table
routed ports. The problem is that the aic94xx routing algorithms never
seem to consider the necessity of a route back to the HBA. This patch
adds such a routing configuration, and now (at least for all my
configurations) the hitherto unseen disks become visible.
James
diff --git a/drivers/scsi/sas/sas_expander.c b/drivers/scsi/sas/sas_expander.c
index 10e0879..0dbeca5 100644
--- a/drivers/scsi/sas/sas_expander.c
+++ b/drivers/scsi/sas/sas_expander.c
@@ -33,6 +33,8 @@ #include "../scsi_sas_internal.h"
static int sas_discover_expander(struct domain_device *dev);
static int sas_configure_routing(struct domain_device *dev, u8 *sas_addr);
+static int sas_configure_phy(struct domain_device *dev, int phy_id,
+ u8 *sas_addr, int include);
static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr);
#if 0
@@ -723,6 +725,8 @@ static int sas_ex_discover_dev(struct do
if (dev->parent && (SAS_ADDR(ex_phy->attached_sas_addr) ==
SAS_ADDR(dev->parent->sas_addr))) {
sas_add_parent_port(dev, phy_id);
+ if (ex_phy->routing_attr == TABLE_ROUTING)
+ sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1);
return 0;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [PATCH] aic94xx: fix routing algorithms
@ 2006-07-11 8:30 Robert Tarte
2006-07-11 12:54 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Robert Tarte @ 2006-07-11 8:30 UTC (permalink / raw)
To: James Bottomley, linux-scsi
> I've been trying to work out for a while why certain cascaded expander
> configurations work with the mptsas, but don't with the aic94xx.
> Eventually I discovered that the non-functional configurations are the
> ones where the cascaded expander is connected to the parent on table
> routed ports. The problem is that the aic94xx routing algorithms
never
> seem to consider the necessity of a route back to the HBA. This patch
> adds such a routing configuration, and now (at least for all my
> configurations) the hitherto unseen disks become visible.
[Tarte, Robert] There is a very specific algorithm for programming the
routing tables to avoid routing table thrashing in a mixed OS / adapter
multi-initiator environments (the last one I looked at was from the
SAS-1.1 draft, sas1r07.pdf, project T10/1601-D,
SASDiscoverSimulation.cpp or see section 4.8.7). I had always assumed
that the original route table configuration code adhered to that
algorithm. Has this patch been verified against that algorithm? Or
does it now come up with the exact same route tables as mptsas? When you
say table routed ports, you mean that both the upstream and down stream
expanders are configured as table routed?
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] aic94xx: fix routing algorithms
2006-07-11 8:30 Robert Tarte
@ 2006-07-11 12:54 ` James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2006-07-11 12:54 UTC (permalink / raw)
To: Robert Tarte; +Cc: linux-scsi
On Tue, 2006-07-11 at 01:30 -0700, Robert Tarte wrote:
> [Tarte, Robert] There is a very specific algorithm for programming the
> routing tables to avoid routing table thrashing in a mixed OS /
> adapter
> multi-initiator environments (the last one I looked at was from the
> SAS-1.1 draft, sas1r07.pdf, project T10/1601-D,
> SASDiscoverSimulation.cpp or see section 4.8.7). I had always assumed
> that the original route table configuration code adhered to that
> algorithm. Has this patch been verified against that algorithm? Or
> does it now come up with the exact same route tables as mptsas? When
> you
> say table routed ports, you mean that both the upstream and down
> stream
> expanders are configured as table routed?
No ... this is the programme in annex L of sas-2, isn't it? Even if it
were available somewhere, the aic94xx doesn't yet have the necessary SMP
tap to try it.
The problem it's solving, which is legal under the sas2 standard is S->T
routing (not T->T which is technically illegal under the standard, but
which this change will also make possible).
If an expander configuration is set up in the recommended cascade (i.e.
T->S) then this addition will never even be activated, so the change
doesn't modify the existing algorithm for the pure and recommended T->S
cases.
And yes, you're right, I'm gearing up to test this out multi-initiator
(when I actually get the right cables) ... and since I don't have a
fanout expander, my configuration is going to have to be
HBA --------- Edge Expander ----------- Edge Expander ---------- HBA
| |
Device Device
James
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] aic94xx: fix routing algorithms
@ 2006-07-11 15:49 Robert Tarte
2006-07-11 16:18 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Robert Tarte @ 2006-07-11 15:49 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
> No ... this is the programme in annex L of sas-2, isn't it? Even if
it
> were available somewhere, the aic94xx doesn't yet have the necessary
SMP
> tap to try it.
[Tarte, Robert] I wrote an expander simulator that I ran in user space
for the adp94xx. I extracted the routing code from the adp94xx driver
and ran through numerous configurations hand checking the table to make
sure that it came up with the right answer.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] aic94xx: fix routing algorithms
2006-07-11 15:49 Robert Tarte
@ 2006-07-11 16:18 ` James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2006-07-11 16:18 UTC (permalink / raw)
To: Robert Tarte; +Cc: linux-scsi
On Tue, 2006-07-11 at 08:49 -0700, Robert Tarte wrote:
> [Tarte, Robert] I wrote an expander simulator that I ran in user space
> for the adp94xx. I extracted the routing code from the adp94xx driver
> and ran through numerous configurations hand checking the table to
> make
> sure that it came up with the right answer.
If you want to do that again, that would be great. However,
mathematically, I think you'll find the results are identical for every
configuration other than expander S->T connections, for which the old
algorithm was provably wrong. If the original scan didn't pick this up,
it's probably because that configuration isn't included ... so I think
the results this time around will be completely identical.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-11 16:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-09 20:41 [PATCH] aic94xx: fix routing algorithms James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2006-07-11 8:30 Robert Tarte
2006-07-11 12:54 ` James Bottomley
2006-07-11 15:49 Robert Tarte
2006-07-11 16:18 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox