diff options
author | Karicheri, Muralidharan <m-karicheri2@ti.com> | 2017-06-12 15:06:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-12 15:21:20 -0400 |
commit | 675c8da049fd6556eb2d6cdd745fe812752f07a8 (patch) | |
tree | a07ba0a3f81eb28fbdc8b94c37e4b3a1b778a970 | |
parent | 3500cd73dff48f28f4ba80c171c4c80034d40f76 (diff) |
hsr: fix incorrect warning
When HSR interface is setup using ip link command, an annoying warning
appears with the trace as below:-
[ 203.019828] hsr_get_node: Non-HSR frame
[ 203.019833] Modules linked in:
[ 203.019848] CPU: 0 PID: 158 Comm: sd-resolve Tainted: G W 4.12.0-rc3-00052-g9fa6bf70 #2
[ 203.019853] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 203.019869] [<c0110280>] (unwind_backtrace) from [<c010c2f4>] (show_stack+0x10/0x14)
[ 203.019880] [<c010c2f4>] (show_stack) from [<c04b9f64>] (dump_stack+0xac/0xe0)
[ 203.019894] [<c04b9f64>] (dump_stack) from [<c01374e8>] (__warn+0xd8/0x104)
[ 203.019907] [<c01374e8>] (__warn) from [<c0137548>] (warn_slowpath_fmt+0x34/0x44)
root@am57xx-evm:~# [ 203.019921] [<c0137548>] (warn_slowpath_fmt) from [<c081126c>] (hsr_get_node+0x148/0x170)
[ 203.019932] [<c081126c>] (hsr_get_node) from [<c0814240>] (hsr_forward_skb+0x110/0x7c0)
[ 203.019942] [<c0814240>] (hsr_forward_skb) from [<c0811d64>] (hsr_dev_xmit+0x2c/0x34)
[ 203.019954] [<c0811d64>] (hsr_dev_xmit) from [<c06c0828>] (dev_hard_start_xmit+0xc4/0x3bc)
[ 203.019963] [<c06c0828>] (dev_hard_start_xmit) from [<c06c13d8>] (__dev_queue_xmit+0x7c4/0x98c)
[ 203.019974] [<c06c13d8>] (__dev_queue_xmit) from [<c0782f54>] (ip6_finish_output2+0x330/0xc1c)
[ 203.019983] [<c0782f54>] (ip6_finish_output2) from [<c0788f0c>] (ip6_output+0x58/0x454)
[ 203.019994] [<c0788f0c>] (ip6_output) from [<c07b16cc>] (mld_sendpack+0x420/0x744)
As this is an expected path to hsr_get_node() with frame coming from
the master interface, add a check to ensure packet is not from the
master port and then warn.
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/hsr/hsr_forward.c | 3 | ||||
-rw-r--r-- | net/hsr/hsr_framereg.c | 9 | ||||
-rw-r--r-- | net/hsr/hsr_framereg.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 4ebe2aa3e7d3..04b5450c5a55 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c | |||
@@ -324,8 +324,7 @@ static int hsr_fill_frame_info(struct hsr_frame_info *frame, | |||
324 | unsigned long irqflags; | 324 | unsigned long irqflags; |
325 | 325 | ||
326 | frame->is_supervision = is_supervision_frame(port->hsr, skb); | 326 | frame->is_supervision = is_supervision_frame(port->hsr, skb); |
327 | frame->node_src = hsr_get_node(&port->hsr->node_db, skb, | 327 | frame->node_src = hsr_get_node(port, skb, frame->is_supervision); |
328 | frame->is_supervision); | ||
329 | if (frame->node_src == NULL) | 328 | if (frame->node_src == NULL) |
330 | return -1; /* Unknown node and !is_supervision, or no mem */ | 329 | return -1; /* Unknown node and !is_supervision, or no mem */ |
331 | 330 | ||
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 7ea925816f79..284a9b820df8 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c | |||
@@ -158,9 +158,10 @@ struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], | |||
158 | 158 | ||
159 | /* Get the hsr_node from which 'skb' was sent. | 159 | /* Get the hsr_node from which 'skb' was sent. |
160 | */ | 160 | */ |
161 | struct hsr_node *hsr_get_node(struct list_head *node_db, struct sk_buff *skb, | 161 | struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, |
162 | bool is_sup) | 162 | bool is_sup) |
163 | { | 163 | { |
164 | struct list_head *node_db = &port->hsr->node_db; | ||
164 | struct hsr_node *node; | 165 | struct hsr_node *node; |
165 | struct ethhdr *ethhdr; | 166 | struct ethhdr *ethhdr; |
166 | u16 seq_out; | 167 | u16 seq_out; |
@@ -186,7 +187,11 @@ struct hsr_node *hsr_get_node(struct list_head *node_db, struct sk_buff *skb, | |||
186 | */ | 187 | */ |
187 | seq_out = hsr_get_skb_sequence_nr(skb) - 1; | 188 | seq_out = hsr_get_skb_sequence_nr(skb) - 1; |
188 | } else { | 189 | } else { |
189 | WARN_ONCE(1, "%s: Non-HSR frame\n", __func__); | 190 | /* this is called also for frames from master port and |
191 | * so warn only for non master ports | ||
192 | */ | ||
193 | if (port->type != HSR_PT_MASTER) | ||
194 | WARN_ONCE(1, "%s: Non-HSR frame\n", __func__); | ||
190 | seq_out = HSR_SEQNR_START; | 195 | seq_out = HSR_SEQNR_START; |
191 | } | 196 | } |
192 | 197 | ||
diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h index 438b40f98f5a..4e04f0e868e9 100644 --- a/net/hsr/hsr_framereg.h +++ b/net/hsr/hsr_framereg.h | |||
@@ -18,7 +18,7 @@ struct hsr_node; | |||
18 | 18 | ||
19 | struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], | 19 | struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], |
20 | u16 seq_out); | 20 | u16 seq_out); |
21 | struct hsr_node *hsr_get_node(struct list_head *node_db, struct sk_buff *skb, | 21 | struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, |
22 | bool is_sup); | 22 | bool is_sup); |
23 | void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, | 23 | void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, |
24 | struct hsr_port *port); | 24 | struct hsr_port *port); |