diff options
author | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> | 2013-03-25 04:26:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-26 12:32:13 -0400 |
commit | 61a7839a19c157d11930fe69697a4c90884bf7c4 (patch) | |
tree | ef2dd78384873146897c376a85f283a57bd90637 /drivers/firewire | |
parent | 382c4b4090b7394d079c199ba053a378c6cd45b8 (diff) |
firewire net: Ignore spd and max_payload advertised by ARP.
Stefan Richter <stefanr@s5r6.in-berlin.de> says:
| As far as I can tell, it would be best to ignore max_rec and sspd from ARP
| and NDP but keep using the respective information from firewire-core
| instead (handed over by fwnet_probe()).
|
| Why? As I noted earlier, RFC 2734:1999 and RFC 3146:2001 were apparently
| written with a too simplistic notion of IEEE 1394 bus topology, resulting
| in max_rec and sspd in ARP-1394 and NDP-1394 to be useless, IMO.
|
| Consider a bus like this:
|
| A ---- B ==== C
|
| A, B, C are all IP-over-1394 capable nodes. ---- is an S400 cable hop,
| and ==== is an S800 cable hop.
|
| In case of unicasts or multicasts in which node A is involved as
| transmitter or receiver, as well as in case of broadcasts, the speeds
| S100, S200, S400 work and speed S400 is optimal.
|
| In case of anything else, IOW in case of unicasts or multicasts in which
| only nodes B and C are involved, the speeds S100, S200, S400, S800 work
| and speed S800 is optimal.
|
| Clearly, node A should indicate sspd = S400 in its ARP or NDP packets.
| But which sspd should nodes B and C set there? Maybe they set S400, which
| would work but would waste half of the available bandwidth in the second
| case. Or maybe they set S800, which is OK in the second case but would
| prohibit any communication with node A if blindly taken for correct.
|
| On the other hand, firewire-core *always* gives us the correct and optimum
| peer-to-peer speed and asynchronous packet payload, no matter how simple
| or complex the bus topology is and no matter in which temporal order nodes
| join the bus and are discovered.
CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/net.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 72536e7fe95c..cb8aa865ff88 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
@@ -552,8 +552,6 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
552 | unsigned char *arp_ptr; | 552 | unsigned char *arp_ptr; |
553 | u64 fifo_addr; | 553 | u64 fifo_addr; |
554 | u64 peer_guid; | 554 | u64 peer_guid; |
555 | unsigned sspd; | ||
556 | u16 max_payload; | ||
557 | struct fwnet_peer *peer; | 555 | struct fwnet_peer *peer; |
558 | unsigned long flags; | 556 | unsigned long flags; |
559 | 557 | ||
@@ -564,24 +562,10 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
564 | fifo_addr = (u64)get_unaligned_be16(&arp1394->fifo_hi) << 32 | 562 | fifo_addr = (u64)get_unaligned_be16(&arp1394->fifo_hi) << 32 |
565 | | get_unaligned_be32(&arp1394->fifo_lo); | 563 | | get_unaligned_be32(&arp1394->fifo_lo); |
566 | 564 | ||
567 | sspd = arp1394->sspd; | ||
568 | /* Sanity check. OS X 10.3 PPC reportedly sends 131. */ | ||
569 | if (sspd > SCODE_3200) { | ||
570 | dev_notice(&net->dev, "sspd %x out of range\n", sspd); | ||
571 | sspd = SCODE_3200; | ||
572 | } | ||
573 | max_payload = fwnet_max_payload(arp1394->max_rec, sspd); | ||
574 | |||
575 | spin_lock_irqsave(&dev->lock, flags); | 565 | spin_lock_irqsave(&dev->lock, flags); |
576 | peer = fwnet_peer_find_by_guid(dev, peer_guid); | 566 | peer = fwnet_peer_find_by_guid(dev, peer_guid); |
577 | if (peer) { | 567 | if (peer) { |
578 | peer->fifo = fifo_addr; | 568 | peer->fifo = fifo_addr; |
579 | |||
580 | if (peer->speed > sspd) | ||
581 | peer->speed = sspd; | ||
582 | if (peer->max_payload > max_payload) | ||
583 | peer->max_payload = max_payload; | ||
584 | |||
585 | peer->ip = arp1394->sip; | 569 | peer->ip = arp1394->sip; |
586 | } | 570 | } |
587 | spin_unlock_irqrestore(&dev->lock, flags); | 571 | spin_unlock_irqrestore(&dev->lock, flags); |