hsr_prp_forward.c
17.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
/* Copyright 2011-2014 Autronica Fire and Security AS
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Author(s):
* 2011-2014 Arvid Brodin, arvid.brodin@alten.se
*/
#include "hsr_prp_forward.h"
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include "hsr_prp_main.h"
#include "hsr_prp_framereg.h"
struct hsr_prp_node;
struct hsr_prp_frame_info {
struct sk_buff *skb_std;
struct sk_buff *skb_hsr;
struct sk_buff *skb_prp;
struct hsr_prp_port *port_rcv;
struct hsr_prp_node *node_src;
u16 sequence_nr;
bool is_supervision;
bool is_vlan;
bool is_local_dest;
bool is_local_exclusive;
bool is_from_san;
};
/* The uses I can see for these HSR supervision frames are:
* 1) Use the frames that are sent after node initialization ("HSR_TLV.Type =
* 22") to reset any sequence_nr counters belonging to that node. Useful if
* the other node's counter has been reset for some reason.
* --
* Or not - resetting the counter and bridging the frame would create a
* loop, unfortunately.
*
* 2) Use the LifeCheck frames to detect ring breaks. I.e. if no LifeCheck
* frame is received from a particular node, we know something is wrong.
* We just register these (as with normal frames) and throw them away.
*
* 3) Allow different MAC addresses for the two slave interfaces, using the
* MacAddressA field.
*/
static bool is_supervision_frame(struct hsr_prp_priv *priv, struct sk_buff *skb)
{
struct ethhdr *eth_hdr;
struct hsr_prp_sup_tag *hsr_sup_tag;
struct hsrv1_ethhdr_sp *hsr_v1_hdr;
WARN_ON_ONCE(!skb_mac_header_was_set(skb));
eth_hdr = (struct ethhdr *)skb_mac_header(skb);
/* Correct addr? */
if (!ether_addr_equal(eth_hdr->h_dest,
priv->sup_multicast_addr))
return false;
/* Correct ether type?. */
if (!(eth_hdr->h_proto == htons(ETH_P_PRP) ||
eth_hdr->h_proto == htons(ETH_P_HSR)))
return false;
/* Get the supervision header from correct location. */
if (eth_hdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */
hsr_v1_hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb);
if (hsr_v1_hdr->hsr.encap_proto != htons(ETH_P_PRP))
return false;
hsr_sup_tag = &hsr_v1_hdr->hsr_sup;
} else {
hsr_sup_tag = &((struct hsrv0_ethhdr_sp *)
skb_mac_header(skb))->hsr_sup;
}
if ((hsr_sup_tag->HSR_TLV_type != HSR_TLV_ANNOUNCE) &&
(hsr_sup_tag->HSR_TLV_type != HSR_TLV_LIFE_CHECK) &&
(hsr_sup_tag->HSR_TLV_type != PRP_TLV_LIFE_CHECK_DD) &&
(hsr_sup_tag->HSR_TLV_type != PRP_TLV_LIFE_CHECK_DA))
return false;
if ((hsr_sup_tag->HSR_TLV_length != 12) &&
(hsr_sup_tag->HSR_TLV_length != sizeof(struct hsr_prp_sup_payload)))
return false;
return true;
}
static struct sk_buff *create_stripped_skb_hsr(struct sk_buff *skb_in,
struct hsr_prp_frame_info *frame)
{
struct sk_buff *skb;
int copylen;
unsigned char *dst, *src;
skb_pull(skb_in, HSR_PRP_HLEN);
skb = __pskb_copy(skb_in,
skb_headroom(skb_in) - HSR_PRP_HLEN, GFP_ATOMIC);
skb_push(skb_in, HSR_PRP_HLEN);
if (!skb)
return NULL;
skb_reset_mac_header(skb);
if (skb->ip_summed == CHECKSUM_PARTIAL)
skb->csum_start -= HSR_PRP_HLEN;
copylen = 2 * ETH_ALEN;
if (frame->is_vlan)
copylen += VLAN_HLEN;
src = skb_mac_header(skb_in);
dst = skb_mac_header(skb);
memcpy(dst, src, copylen);
skb->protocol = eth_hdr(skb)->h_proto;
return skb;
}
static struct sk_buff *frame_get_stripped_skb(struct hsr_prp_frame_info *frame,
struct hsr_prp_port *port)
{
if (!frame->skb_std) {
if (frame->skb_hsr) {
frame->skb_std =
create_stripped_skb_hsr(frame->skb_hsr, frame);
} else if (frame->skb_prp) {
/* trim the skb by len - HSR_PRP_HLEN to exclude
* RCT
*/
skb_trim(frame->skb_prp,
frame->skb_prp->len - HSR_PRP_HLEN);
frame->skb_std =
__pskb_copy(frame->skb_prp,
skb_headroom(frame->skb_prp),
GFP_ATOMIC);
} else {
/* Unexpected */
WARN_ONCE(1, "%s:%d: Unexpected frame received (port_src %s)\n",
__FILE__, __LINE__, port->dev->name);
return NULL;
}
}
return skb_clone(frame->skb_std, GFP_ATOMIC);
}
/* only prp skb should be passed in */
static void prp_check_lan_id(struct sk_buff *skb, struct hsr_prp_port *port)
{
int lan_id;
struct prp_rct *trailor = skb_get_PRP_rct(skb);
if (!trailor) {
INC_CNT_RX_ERROR(port->type, port->priv);
return;
}
lan_id = get_prp_lan_id(trailor);
if (port->type == HSR_PRP_PT_SLAVE_A) {
if (lan_id & 1)
INC_CNT_RX_WRONG_LAN(port->type, port->priv);
} else {
if (!(lan_id & 1))
INC_CNT_RX_WRONG_LAN(port->type, port->priv);
}
}
static void prp_set_lan_id(struct prp_rct *trailor,
struct hsr_prp_port *port)
{
int lane_id;
if (port->type == HSR_PRP_PT_SLAVE_A)
lane_id = 0;
else
lane_id = 1;
/* Add net_id in the upper 3 bits of lane_id */
lane_id |= port->priv->net_id;
set_prp_lan_id(trailor, lane_id);
}
/* Tailroom for PRP rct should have been created before calling this */
static void prp_fill_rct(struct sk_buff *skb,
struct hsr_prp_frame_info *frame,
struct hsr_prp_port *port)
{
struct prp_rct *trailor;
int lsdu_size;
if (!skb)
return;
if (frame->is_vlan)
skb_put_padto(skb, ETH_ZLEN + 4);
else
skb_put_padto(skb, ETH_ZLEN);
trailor = (struct prp_rct *)skb_put(skb, HSR_PRP_HLEN);
lsdu_size = skb->len - 14;
if (frame->is_vlan)
lsdu_size -= 4;
prp_set_lan_id(trailor, port);
set_prp_LSDU_size(trailor, lsdu_size);
trailor->sequence_nr = htons(frame->sequence_nr);
trailor->PRP_suffix = htons(ETH_P_PRP);
}
static void hsr_set_lan_id(struct hsr_ethhdr *hsr_ethhdr,
struct hsr_prp_port *port)
{
int lane_id;
if (port->type == HSR_PRP_PT_SLAVE_A)
lane_id = 0;
else
lane_id = 1;
set_hsr_tag_path(&hsr_ethhdr->hsr_tag, lane_id);
}
/* only hsr skb should be passed in */
static void hsr_check_path_id(struct sk_buff *skb, struct hsr_prp_port *port)
{
struct hsr_ethhdr *hsr_ethhdr;
int path_id;
hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb);
path_id = get_hsr_tag_path(&hsr_ethhdr->hsr_tag);
if (port->type == HSR_PRP_PT_SLAVE_A) {
if (path_id & 1)
INC_CNT_RX_WRONG_LAN(port->type, port->priv);
} else {
if (!(path_id & 1))
INC_CNT_RX_WRONG_LAN(port->type, port->priv);
}
}
static void hsr_fill_tag(struct sk_buff *skb, struct hsr_prp_frame_info *frame,
struct hsr_prp_port *port, u8 proto_version)
{
struct hsr_ethhdr *hsr_ethhdr;
int lsdu_size;
lsdu_size = skb->len - 14;
if (frame->is_vlan)
lsdu_size -= 4;
hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb);
hsr_set_lan_id(hsr_ethhdr, port);
set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size);
hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr);
hsr_ethhdr->hsr_tag.encap_proto = hsr_ethhdr->ethhdr.h_proto;
hsr_ethhdr->ethhdr.h_proto = htons(proto_version ?
ETH_P_HSR : ETH_P_PRP);
}
static struct sk_buff *create_tagged_skb(struct sk_buff *skb_o,
struct hsr_prp_frame_info *frame,
struct hsr_prp_port *port)
{
int movelen;
unsigned char *dst, *src;
struct sk_buff *skb;
if (port->priv->prot_version > HSR_V1) {
skb = skb_copy_expand(skb_o, skb_headroom(skb_o),
skb_tailroom(skb_o) + HSR_PRP_HLEN,
GFP_ATOMIC);
prp_fill_rct(skb, frame, port);
return skb;
}
/* Create the new skb with enough headroom to fit the HSR tag */
skb = __pskb_copy(skb_o, skb_headroom(skb_o) + HSR_PRP_HLEN,
GFP_ATOMIC);
if (!skb)
return NULL;
skb_reset_mac_header(skb);
if (skb->ip_summed == CHECKSUM_PARTIAL)
skb->csum_start += HSR_PRP_HLEN;
movelen = ETH_HLEN;
if (frame->is_vlan)
movelen += VLAN_HLEN;
src = skb_mac_header(skb);
dst = skb_push(skb, HSR_PRP_HLEN);
memmove(dst, src, movelen);
skb_reset_mac_header(skb);
hsr_fill_tag(skb, frame, port, port->priv->prot_version);
return skb;
}
/* If the original frame was an HSR tagged frame, just clone it to be sent
* unchanged. Otherwise, create a private frame especially tagged for 'port'.
*/
static struct sk_buff *frame_get_tagged_skb(struct hsr_prp_frame_info *frame,
struct hsr_prp_port *port)
{
if (frame->skb_hsr) {
struct hsr_ethhdr *hsr_ethhdr =
(struct hsr_ethhdr *)skb_mac_header(frame->skb_hsr);
/* set the lane id properly */
hsr_set_lan_id(hsr_ethhdr, port);
return skb_clone(frame->skb_hsr, GFP_ATOMIC);
}
if (frame->skb_prp) {
struct prp_rct *trailor = skb_get_PRP_rct(frame->skb_prp);
if (trailor) {
prp_set_lan_id(trailor, port);
} else {
WARN_ONCE(!trailor, "errored PRP skb");
return NULL;
}
return skb_clone(frame->skb_prp, GFP_ATOMIC);
}
if ((port->type != HSR_PRP_PT_SLAVE_A) &&
(port->type != HSR_PRP_PT_SLAVE_B)) {
WARN_ONCE(1,
"Bug: creating a tagged frame for a non slave port");
return NULL;
}
return create_tagged_skb(frame->skb_std, frame, port);
}
static void hsr_prp_deliver_master(struct sk_buff *skb,
struct hsr_prp_node *node_src,
struct hsr_prp_port *port)
{
struct net_device *dev = port->dev;
bool was_multicast_frame;
int res;
was_multicast_frame = (skb->pkt_type == PACKET_MULTICAST);
/* For LRE offloaded case, assume same MAC address is on both
* interfaces of the remote node and hence no need to substitute
* the source MAC address.
*/
if (!port->priv->rx_offloaded)
hsr_addr_subst_source(node_src, skb);
skb_pull(skb, ETH_HLEN);
res = netif_rx(skb);
if (res == NET_RX_DROP) {
dev->stats.rx_dropped++;
} else {
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
if (was_multicast_frame)
dev->stats.multicast++;
}
}
static int hsr_prp_xmit(struct sk_buff *skb, struct hsr_prp_port *port,
struct hsr_prp_frame_info *frame)
{
if (!port->priv->rx_offloaded &&
frame->port_rcv->type == HSR_PRP_PT_MASTER) {
hsr_addr_subst_dest(frame->node_src, skb, port);
/* Address substitution (IEC62439-3 pp 26, 50): replace mac
* address of outgoing frame with that of the outgoing slave's.
*/
ether_addr_copy(eth_hdr(skb)->h_source, port->dev->dev_addr);
}
INC_CNT_TX(port->type, port->priv);
return dev_queue_xmit(skb);
}
/* Forward the frame through all devices except:
* - Back through the receiving device
* - If it's a HSR frame: through a device where it has passed before
* - if it's a PRP frame: through another PRP slave device (no bridge)
* - To the local HSR master only if the frame is directly addressed to it, or
* a non-supervision multicast or broadcast frame.
*
* HSR slave devices should insert a HSR tag into the frame, or forward the
* frame unchanged if it's already tagged. Interlink devices should strip HSR
* tags if they're of the non-HSR type (but only after duplicate discard). The
* master device always strips HSR tags.
*/
static void hsr_prp_forward_do(struct hsr_prp_frame_info *frame)
{
struct hsr_prp_port *port;
struct sk_buff *skb = NULL;
hsr_prp_for_each_port(frame->port_rcv->priv, port) {
/* Don't send frame back the way it came */
if (port == frame->port_rcv)
continue;
/* Don't deliver locally unless we should */
if ((port->type == HSR_PRP_PT_MASTER) && !frame->is_local_dest)
continue;
/* Deliver frames directly addressed to us to master only */
if ((port->type != HSR_PRP_PT_MASTER) &&
frame->is_local_exclusive)
continue;
/* Don't send frame over port where it has been sent before
* if not rx offloaded as underlying driver will forward only
* one frame. Also fro SAN, this shouldn't be done.
*/
if (!port->priv->rx_offloaded &&
!frame->is_from_san &&
hsr_register_frame_out(port, frame->node_src,
frame->sequence_nr))
continue;
/* In LRE offloaded case, don't expect supervision frames from
* slave ports for host as they get processed at the h/w or
* firmware
*/
if (frame->is_supervision &&
(port->type == HSR_PRP_PT_MASTER) &&
(!port->priv->rx_offloaded)) {
if (frame->skb_hsr)
skb = frame->skb_hsr;
else if (frame->skb_prp)
skb = frame->skb_prp;
if (skb)
hsr_prp_handle_sup_frame(skb,
frame->node_src,
frame->port_rcv);
continue;
}
/* if L2 forward is offloaded, don't forward frame
* across slaves
*/
if ((port->priv->l2_fwd_offloaded ||
(port->priv->prot_version == PRP_V1)) &&
(((frame->port_rcv->type == HSR_PRP_PT_SLAVE_A) &&
(port->type == HSR_PRP_PT_SLAVE_B)) ||
((frame->port_rcv->type == HSR_PRP_PT_SLAVE_B) &&
(port->type == HSR_PRP_PT_SLAVE_A))))
continue;
if (port->type != HSR_PRP_PT_MASTER)
skb = frame_get_tagged_skb(frame, port);
else
skb = frame_get_stripped_skb(frame, port);
if (!skb) {
if (frame->port_rcv->type == HSR_PRP_PT_SLAVE_A ||
frame->port_rcv->type == HSR_PRP_PT_SLAVE_B)
INC_CNT_RX_ERROR(frame->port_rcv->type,
port->priv);
else {
struct net_device *master_dev =
hsr_prp_get_port(port->priv,
HSR_PRP_PT_MASTER)->dev;
master_dev->stats.rx_dropped++;
}
continue;
}
skb->dev = port->dev;
if (port->type == HSR_PRP_PT_MASTER)
hsr_prp_deliver_master(skb, frame->node_src, port);
else
hsr_prp_xmit(skb, port, frame);
}
}
static void check_local_dest(struct hsr_prp_priv *priv, struct sk_buff *skb,
struct hsr_prp_frame_info *frame)
{
struct net_device *master_dev;
master_dev = hsr_prp_get_port(priv, HSR_PRP_PT_MASTER)->dev;
if (hsr_prp_addr_is_self(priv, eth_hdr(skb)->h_dest)) {
frame->is_local_exclusive = true;
skb->pkt_type = PACKET_HOST;
} else {
frame->is_local_exclusive = false;
}
if ((skb->pkt_type == PACKET_HOST) ||
(skb->pkt_type == PACKET_MULTICAST) ||
(skb->pkt_type == PACKET_BROADCAST)) {
frame->is_local_dest = true;
} else {
frame->is_local_dest = false;
}
}
static int hsr_prp_fill_frame_info(struct hsr_prp_frame_info *frame,
struct sk_buff *skb,
struct hsr_prp_port *port)
{
struct hsr_prp_priv *priv = port->priv;
struct ethhdr *ethhdr;
struct hsr_vlan_ethhdr *vlan_hdr;
unsigned long irqflags;
u16 proto;
frame->is_supervision = is_supervision_frame(priv, skb);
if (frame->is_supervision && priv->rx_offloaded &&
(port->type != HSR_PRP_PT_MASTER)) {
WARN_ONCE(1,
"HSR: unexpected rx supervisor frame when offloaded");
return -1;
}
/* For Offloaded case, there is no need for node list since
* firmware/hardware implements LRE function.
*/
if (!priv->rx_offloaded) {
frame->node_src = hsr_prp_get_node(&priv->node_db, skb,
frame->is_supervision,
port->type);
/* Unknown node and !is_supervision, or no mem */
if (!frame->node_src) {
WARN_ONCE(1, "Unknown frame received\n");
return -1;
}
}
ethhdr = (struct ethhdr *)skb_mac_header(skb);
frame->is_vlan = false;
proto = ethhdr->h_proto;
if (proto == htons(ETH_P_8021Q))
frame->is_vlan = true;
if (frame->is_vlan) {
vlan_hdr = (struct hsr_vlan_ethhdr *)ethhdr;
proto = vlan_hdr->vlanhdr.h_vlan_encapsulated_proto;
}
frame->is_from_san = false;
if (proto == htons(ETH_P_PRP) || proto == htons(ETH_P_HSR)) {
struct prp_rct *rct = skb_get_PRP_rct(skb);
if (rct &&
prp_check_lsdu_size(skb, rct, frame->is_supervision)) {
frame->skb_hsr = NULL;
frame->skb_std = NULL;
frame->skb_prp = skb;
frame->sequence_nr = prp_get_skb_sequence_nr(rct);
} else {
frame->skb_std = NULL;
frame->skb_prp = NULL;
frame->skb_hsr = skb;
frame->sequence_nr = hsr_get_skb_sequence_nr(skb);
}
} else {
struct prp_rct *rct = skb_get_PRP_rct(skb);
if (rct &&
prp_check_lsdu_size(skb, rct, frame->is_supervision)) {
frame->skb_hsr = NULL;
frame->skb_std = NULL;
frame->skb_prp = skb;
frame->sequence_nr = prp_get_skb_sequence_nr(rct);
frame->is_from_san = false;
} else {
frame->skb_hsr = NULL;
frame->skb_prp = NULL;
frame->skb_std = skb;
if (port->type != HSR_PRP_PT_MASTER) {
frame->is_from_san = true;
} else {
/* Sequence nr for the master node */
spin_lock_irqsave(&port->priv->seqnr_lock,
irqflags);
frame->sequence_nr = port->priv->sequence_nr;
port->priv->sequence_nr++;
spin_unlock_irqrestore(&port->priv->seqnr_lock,
irqflags);
}
}
}
frame->port_rcv = port;
check_local_dest(priv, skb, frame);
return 0;
}
/* Must be called holding rcu read lock (because of the port parameter) */
void hsr_prp_forward_skb(struct sk_buff *skb, struct hsr_prp_port *port)
{
struct hsr_prp_frame_info frame;
if (skb_mac_header(skb) != skb->data) {
WARN_ONCE(1, "%s:%d: Malformed frame (port_src %s)\n",
__FILE__, __LINE__, port->dev->name);
goto out_drop;
}
if (hsr_prp_fill_frame_info(&frame, skb, port) < 0)
goto out_drop;
/* Only accept packets for the protocol we have been configured */
if ((frame.skb_hsr && port->priv->prot_version == PRP_V1) ||
(frame.skb_prp && port->priv->prot_version <= HSR_V1))
goto out_drop;
if (frame.skb_hsr) {
if (port->type == HSR_PRP_PT_SLAVE_A ||
port->type == HSR_PRP_PT_SLAVE_B)
hsr_check_path_id(frame.skb_hsr, port);
}
if (frame.skb_prp) {
if (port->type == HSR_PRP_PT_SLAVE_A ||
port->type == HSR_PRP_PT_SLAVE_B)
prp_check_lan_id(frame.skb_prp, port);
}
/* No need to register frame when rx offload is supported */
if (!port->priv->rx_offloaded)
hsr_register_frame_in(frame.node_src, port, frame.sequence_nr);
hsr_prp_forward_do(&frame);
if (frame.skb_hsr)
kfree_skb(frame.skb_hsr);
if (frame.skb_prp)
kfree_skb(frame.skb_prp);
if (frame.skb_std)
kfree_skb(frame.skb_std);
return;
out_drop:
INC_CNT_RX_ERROR(port->type, port->priv);
port->dev->stats.tx_dropped++;
kfree_skb(skb);
}