| .. | .. |
|---|
| 159 | 159 | return NULL; |
|---|
| 160 | 160 | |
|---|
| 161 | 161 | ether_addr_copy(new_node->macaddress_A, addr); |
|---|
| 162 | + spin_lock_init(&new_node->seq_out_lock); |
|---|
| 162 | 163 | |
|---|
| 163 | 164 | /* We are only interested in time diffs here, so use current jiffies |
|---|
| 164 | 165 | * as initialization. (0 could trigger an spurious ring error warning). |
|---|
| .. | .. |
|---|
| 311 | 312 | goto done; |
|---|
| 312 | 313 | |
|---|
| 313 | 314 | ether_addr_copy(node_real->macaddress_B, ethhdr->h_source); |
|---|
| 315 | + spin_lock_bh(&node_real->seq_out_lock); |
|---|
| 314 | 316 | for (i = 0; i < HSR_PT_PORTS; i++) { |
|---|
| 315 | 317 | if (!node_curr->time_in_stale[i] && |
|---|
| 316 | 318 | time_after(node_curr->time_in[i], node_real->time_in[i])) { |
|---|
| .. | .. |
|---|
| 321 | 323 | if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) |
|---|
| 322 | 324 | node_real->seq_out[i] = node_curr->seq_out[i]; |
|---|
| 323 | 325 | } |
|---|
| 326 | + spin_unlock_bh(&node_real->seq_out_lock); |
|---|
| 324 | 327 | node_real->addr_B_port = port_rcv->type; |
|---|
| 325 | 328 | |
|---|
| 326 | 329 | spin_lock_bh(&hsr->list_lock); |
|---|
| .. | .. |
|---|
| 377 | 380 | node_dst = find_node_by_addr_A(&port->hsr->node_db, |
|---|
| 378 | 381 | eth_hdr(skb)->h_dest); |
|---|
| 379 | 382 | if (!node_dst) { |
|---|
| 380 | | - if (net_ratelimit()) |
|---|
| 383 | + if (port->hsr->prot_version != PRP_V1 && net_ratelimit()) |
|---|
| 381 | 384 | netdev_err(skb->dev, "%s: Unknown node\n", __func__); |
|---|
| 382 | 385 | return; |
|---|
| 383 | 386 | } |
|---|
| .. | .. |
|---|
| 413 | 416 | int hsr_register_frame_out(struct hsr_port *port, struct hsr_node *node, |
|---|
| 414 | 417 | u16 sequence_nr) |
|---|
| 415 | 418 | { |
|---|
| 419 | + spin_lock_bh(&node->seq_out_lock); |
|---|
| 416 | 420 | if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port->type]) && |
|---|
| 417 | 421 | time_is_after_jiffies(node->time_out[port->type] + |
|---|
| 418 | | - msecs_to_jiffies(HSR_ENTRY_FORGET_TIME))) |
|---|
| 422 | + msecs_to_jiffies(HSR_ENTRY_FORGET_TIME))) { |
|---|
| 423 | + spin_unlock_bh(&node->seq_out_lock); |
|---|
| 419 | 424 | return 1; |
|---|
| 425 | + } |
|---|
| 420 | 426 | |
|---|
| 421 | 427 | node->time_out[port->type] = jiffies; |
|---|
| 422 | 428 | node->seq_out[port->type] = sequence_nr; |
|---|
| 429 | + spin_unlock_bh(&node->seq_out_lock); |
|---|
| 423 | 430 | return 0; |
|---|
| 424 | 431 | } |
|---|
| 425 | 432 | |
|---|