Deleted Added
full compact
efx_ev.c (293752) efx_ev.c (293806)
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_ev.c 293752 2016-01-12 13:32:04Z arybchik $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_ev.c 293806 2016-01-13 06:37:45Z arybchik $");
33
34#include "efsys.h"
35#include "efx.h"
36#include "efx_types.h"
37#include "efx_regs.h"
38#include "efx_impl.h"
39#include "mcdi_mon.h"
40

--- 452 unchanged lines hidden (view full) ---

493 (*flagsp) |= EFX_ADDR_MISMATCH;
494 }
495
496 if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_FRM_TRUNC) != 0) {
497 EFSYS_PROBE2(frm_trunc, uint32_t, label, uint32_t, id);
498 EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC);
499 (*flagsp) |= EFX_DISCARD;
500
33
34#include "efsys.h"
35#include "efx.h"
36#include "efx_types.h"
37#include "efx_regs.h"
38#include "efx_impl.h"
39#include "mcdi_mon.h"
40

--- 452 unchanged lines hidden (view full) ---

493 (*flagsp) |= EFX_ADDR_MISMATCH;
494 }
495
496 if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_FRM_TRUNC) != 0) {
497 EFSYS_PROBE2(frm_trunc, uint32_t, label, uint32_t, id);
498 EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC);
499 (*flagsp) |= EFX_DISCARD;
500
501#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
501#if EFSYS_OPT_RX_SCATTER
502 /*
503 * Lookout for payload queue ran dry errors and ignore them.
504 *
505 * Sadly for the header/data split cases, the descriptor
506 * pointer in this event refers to the header queue and
507 * therefore cannot be easily detected as duplicate.
508 * So we drop these and rely on the receive processing seeing
509 * a subsequent packet with FSF_AZ_RX_EV_SOP set to discard
510 * the partially received packet.
511 */
512 if ((EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) == 0) &&
513 (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) == 0) &&
514 (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT) == 0))
515 ignore = B_TRUE;
502 /*
503 * Lookout for payload queue ran dry errors and ignore them.
504 *
505 * Sadly for the header/data split cases, the descriptor
506 * pointer in this event refers to the header queue and
507 * therefore cannot be easily detected as duplicate.
508 * So we drop these and rely on the receive processing seeing
509 * a subsequent packet with FSF_AZ_RX_EV_SOP set to discard
510 * the partially received packet.
511 */
512 if ((EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) == 0) &&
513 (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) == 0) &&
514 (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT) == 0))
515 ignore = B_TRUE;
516#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
516#endif /* EFSYS_OPT_RX_SCATTER */
517 }
518
519 if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_ETH_CRC_ERR) != 0) {
520 EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR);
521 EFSYS_PROBE(crc_err);
522 (*flagsp) &= ~EFX_ADDR_MISMATCH;
523 (*flagsp) |= EFX_DISCARD;
524 }

--- 44 unchanged lines hidden (view full) ---

569 __in const efx_ev_callbacks_t *eecp,
570 __in_opt void *arg)
571{
572 efx_nic_t *enp = eep->ee_enp;
573 uint32_t id;
574 uint32_t size;
575 uint32_t label;
576 boolean_t ok;
517 }
518
519 if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_ETH_CRC_ERR) != 0) {
520 EFX_EV_QSTAT_INCR(eep, EV_RX_ETH_CRC_ERR);
521 EFSYS_PROBE(crc_err);
522 (*flagsp) &= ~EFX_ADDR_MISMATCH;
523 (*flagsp) |= EFX_DISCARD;
524 }

--- 44 unchanged lines hidden (view full) ---

569 __in const efx_ev_callbacks_t *eecp,
570 __in_opt void *arg)
571{
572 efx_nic_t *enp = eep->ee_enp;
573 uint32_t id;
574 uint32_t size;
575 uint32_t label;
576 boolean_t ok;
577#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
577#if EFSYS_OPT_RX_SCATTER
578 boolean_t sop;
579 boolean_t jumbo_cont;
578 boolean_t sop;
579 boolean_t jumbo_cont;
580#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
580#endif /* EFSYS_OPT_RX_SCATTER */
581 uint32_t hdr_type;
582 boolean_t is_v6;
583 uint16_t flags;
584 boolean_t ignore;
585 boolean_t should_abort;
586
587 EFX_EV_QSTAT_INCR(eep, EV_RX);
588
589 /* Basic packet information */
590 id = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_DESC_PTR);
591 size = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT);
592 label = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_Q_LABEL);
593 ok = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_PKT_OK) != 0);
594
581 uint32_t hdr_type;
582 boolean_t is_v6;
583 uint16_t flags;
584 boolean_t ignore;
585 boolean_t should_abort;
586
587 EFX_EV_QSTAT_INCR(eep, EV_RX);
588
589 /* Basic packet information */
590 id = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_DESC_PTR);
591 size = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT);
592 label = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_Q_LABEL);
593 ok = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_PKT_OK) != 0);
594
595#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
595#if EFSYS_OPT_RX_SCATTER
596 sop = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) != 0);
597 jumbo_cont = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) != 0);
596 sop = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) != 0);
597 jumbo_cont = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) != 0);
598#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
598#endif /* EFSYS_OPT_RX_SCATTER */
599
600 hdr_type = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_HDR_TYPE);
601
602 is_v6 = (enp->en_family != EFX_FAMILY_FALCON &&
603 EFX_QWORD_FIELD(*eqp, FSF_CZ_RX_EV_IPV6_PKT) != 0);
604
605 /*
606 * If packet is marked as OK and packet type is TCP/IP or

--- 38 unchanged lines hidden (view full) ---

645 break;
646
647 default:
648 EFSYS_ASSERT(B_FALSE);
649 flags = 0;
650 break;
651 }
652
599
600 hdr_type = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_HDR_TYPE);
601
602 is_v6 = (enp->en_family != EFX_FAMILY_FALCON &&
603 EFX_QWORD_FIELD(*eqp, FSF_CZ_RX_EV_IPV6_PKT) != 0);
604
605 /*
606 * If packet is marked as OK and packet type is TCP/IP or

--- 38 unchanged lines hidden (view full) ---

645 break;
646
647 default:
648 EFSYS_ASSERT(B_FALSE);
649 flags = 0;
650 break;
651 }
652
653#if EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT
653#if EFSYS_OPT_RX_SCATTER
654 /* Report scatter and header/lookahead split buffer flags */
655 if (sop)
656 flags |= EFX_PKT_START;
657 if (jumbo_cont)
658 flags |= EFX_PKT_CONT;
654 /* Report scatter and header/lookahead split buffer flags */
655 if (sop)
656 flags |= EFX_PKT_START;
657 if (jumbo_cont)
658 flags |= EFX_PKT_CONT;
659#endif /* EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT */
659#endif /* EFSYS_OPT_RX_SCATTER */
660
661 /* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */
662 if (!ok) {
663 ignore = falconsiena_ev_rx_not_ok(eep, eqp, label, id, &flags);
664 if (ignore) {
665 EFSYS_PROBE4(rx_complete, uint32_t, label, uint32_t, id,
666 uint32_t, size, uint16_t, flags);
667

--- 804 unchanged lines hidden ---
660
661 /* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */
662 if (!ok) {
663 ignore = falconsiena_ev_rx_not_ok(eep, eqp, label, id, &flags);
664 if (ignore) {
665 EFSYS_PROBE4(rx_complete, uint32_t, label, uint32_t, id,
666 uint32_t, size, uint16_t, flags);
667

--- 804 unchanged lines hidden ---