diff options
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index f54843023466..785d0d71781e 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -516,23 +516,17 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
516 | skb_pull(skb, sizeof(struct fcoe_hdr)); | 516 | skb_pull(skb, sizeof(struct fcoe_hdr)); |
517 | fr_len = skb->len - sizeof(struct fcoe_crc_eof); | 517 | fr_len = skb->len - sizeof(struct fcoe_crc_eof); |
518 | 518 | ||
519 | stats = per_cpu_ptr(lport->stats, get_cpu()); | ||
520 | stats->RxFrames++; | ||
521 | stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; | ||
522 | |||
523 | fp = (struct fc_frame *)skb; | 519 | fp = (struct fc_frame *)skb; |
524 | fc_frame_init(fp); | 520 | fc_frame_init(fp); |
525 | fr_dev(fp) = lport; | 521 | fr_dev(fp) = lport; |
526 | fr_sof(fp) = hp->fcoe_sof; | 522 | fr_sof(fp) = hp->fcoe_sof; |
527 | if (skb_copy_bits(skb, fr_len, &crc_eof, sizeof(crc_eof))) { | 523 | if (skb_copy_bits(skb, fr_len, &crc_eof, sizeof(crc_eof))) { |
528 | put_cpu(); | ||
529 | kfree_skb(skb); | 524 | kfree_skb(skb); |
530 | return; | 525 | return; |
531 | } | 526 | } |
532 | fr_eof(fp) = crc_eof.fcoe_eof; | 527 | fr_eof(fp) = crc_eof.fcoe_eof; |
533 | fr_crc(fp) = crc_eof.fcoe_crc32; | 528 | fr_crc(fp) = crc_eof.fcoe_crc32; |
534 | if (pskb_trim(skb, fr_len)) { | 529 | if (pskb_trim(skb, fr_len)) { |
535 | put_cpu(); | ||
536 | kfree_skb(skb); | 530 | kfree_skb(skb); |
537 | return; | 531 | return; |
538 | } | 532 | } |
@@ -544,7 +538,6 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
544 | port = lport_priv(vn_port); | 538 | port = lport_priv(vn_port); |
545 | if (!ether_addr_equal(port->data_src_addr, dest_mac)) { | 539 | if (!ether_addr_equal(port->data_src_addr, dest_mac)) { |
546 | BNX2FC_HBA_DBG(lport, "fpma mismatch\n"); | 540 | BNX2FC_HBA_DBG(lport, "fpma mismatch\n"); |
547 | put_cpu(); | ||
548 | kfree_skb(skb); | 541 | kfree_skb(skb); |
549 | return; | 542 | return; |
550 | } | 543 | } |
@@ -552,7 +545,6 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
552 | if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && | 545 | if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && |
553 | fh->fh_type == FC_TYPE_FCP) { | 546 | fh->fh_type == FC_TYPE_FCP) { |
554 | /* Drop FCP data. We dont this in L2 path */ | 547 | /* Drop FCP data. We dont this in L2 path */ |
555 | put_cpu(); | ||
556 | kfree_skb(skb); | 548 | kfree_skb(skb); |
557 | return; | 549 | return; |
558 | } | 550 | } |
@@ -562,7 +554,6 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
562 | case ELS_LOGO: | 554 | case ELS_LOGO: |
563 | if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI) { | 555 | if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI) { |
564 | /* drop non-FIP LOGO */ | 556 | /* drop non-FIP LOGO */ |
565 | put_cpu(); | ||
566 | kfree_skb(skb); | 557 | kfree_skb(skb); |
567 | return; | 558 | return; |
568 | } | 559 | } |
@@ -572,22 +563,23 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
572 | 563 | ||
573 | if (fh->fh_r_ctl == FC_RCTL_BA_ABTS) { | 564 | if (fh->fh_r_ctl == FC_RCTL_BA_ABTS) { |
574 | /* Drop incoming ABTS */ | 565 | /* Drop incoming ABTS */ |
575 | put_cpu(); | ||
576 | kfree_skb(skb); | 566 | kfree_skb(skb); |
577 | return; | 567 | return; |
578 | } | 568 | } |
579 | 569 | ||
570 | stats = per_cpu_ptr(lport->stats, smp_processor_id()); | ||
571 | stats->RxFrames++; | ||
572 | stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; | ||
573 | |||
580 | if (le32_to_cpu(fr_crc(fp)) != | 574 | if (le32_to_cpu(fr_crc(fp)) != |
581 | ~crc32(~0, skb->data, fr_len)) { | 575 | ~crc32(~0, skb->data, fr_len)) { |
582 | if (stats->InvalidCRCCount < 5) | 576 | if (stats->InvalidCRCCount < 5) |
583 | printk(KERN_WARNING PFX "dropping frame with " | 577 | printk(KERN_WARNING PFX "dropping frame with " |
584 | "CRC error\n"); | 578 | "CRC error\n"); |
585 | stats->InvalidCRCCount++; | 579 | stats->InvalidCRCCount++; |
586 | put_cpu(); | ||
587 | kfree_skb(skb); | 580 | kfree_skb(skb); |
588 | return; | 581 | return; |
589 | } | 582 | } |
590 | put_cpu(); | ||
591 | fc_exch_recv(lport, fp); | 583 | fc_exch_recv(lport, fp); |
592 | } | 584 | } |
593 | 585 | ||