net/hsr: Better frame dispatch

This patch removes the separate paths for frames coming from the outside, and
frames sent from the HSR device, and instead makes all frames go through
hsr_forward_skb() in hsr_forward.c. This greatly improves code readability and
also opens up the possibility for future support of the HSR Interlink device
that is the basis for HSR RedBoxes and HSR QuadBoxes, as well as VLAN
compatibility.

Other improvements:
* A reduction in the number of times an skb is copied on machines without
  HAVE_EFFICIENT_UNALIGNED_ACCESS, which improves throughput somewhat.
* Headers are now created using the standard eth_header(), and using the
  standard hard_header_len.
* Each HSR slave now gets its own private skb, so slave-specific fields can be
  correctly set.

Signed-off-by: Arvid Brodin <arvid.brodin@alten.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arvid Brodin
2014-07-04 23:41:03 +02:00
committed by David S. Miller
parent 4c3477dca2
commit f266a683a4
11 changed files with 665 additions and 595 deletions

View File

@@ -20,26 +20,6 @@
#include "hsr_slave.h"
/* List of all registered virtual HSR devices */
static LIST_HEAD(hsr_list);
void register_hsr_master(struct hsr_priv *hsr)
{
list_add_tail_rcu(&hsr->hsr_list, &hsr_list);
}
void unregister_hsr_master(struct hsr_priv *hsr)
{
struct hsr_priv *hsr_it;
list_for_each_entry(hsr_it, &hsr_list, hsr_list)
if (hsr_it == hsr) {
list_del_rcu(&hsr_it->hsr_list);
return;
}
}
static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
void *ptr)
{