Deleted Added
full compact
ef10_rx.c (300607) ef10_rx.c (300840)
1/*-
2 * Copyright (c) 2012-2016 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) 2012-2016 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/ef10_rx.c 300607 2016-05-24 12:16:57Z arybchik $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/ef10_rx.c 300840 2016-05-27 11:44:40Z arybchik $");
33
34#include "efx.h"
35#include "efx_impl.h"
36
37
38#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
39
40

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

596 */
597
598 __checkReturn efx_rc_t
599ef10_rx_prefix_pktlen(
600 __in efx_nic_t *enp,
601 __in uint8_t *buffer,
602 __out uint16_t *lengthp)
603{
33
34#include "efx.h"
35#include "efx_impl.h"
36
37
38#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
39
40

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

596 */
597
598 __checkReturn efx_rc_t
599ef10_rx_prefix_pktlen(
600 __in efx_nic_t *enp,
601 __in uint8_t *buffer,
602 __out uint16_t *lengthp)
603{
604 _NOTE(ARGUNUSED(enp))
605
604 /*
605 * The RX pseudo-header contains the packet length, excluding the
606 * pseudo-header. If the hardware receive datapath was operating in
607 * cut-through mode then the length in the RX pseudo-header will be
608 * zero, and the packet length must be obtained from the DMA length
609 * reported in the RX event.
610 */
611 *lengthp = buffer[8] | (buffer[9] << 8);
612 return (0);
613}
614
615#if EFSYS_OPT_RX_SCALE
616 __checkReturn uint32_t
617ef10_rx_prefix_hash(
618 __in efx_nic_t *enp,
619 __in efx_rx_hash_alg_t func,
620 __in uint8_t *buffer)
621{
606 /*
607 * The RX pseudo-header contains the packet length, excluding the
608 * pseudo-header. If the hardware receive datapath was operating in
609 * cut-through mode then the length in the RX pseudo-header will be
610 * zero, and the packet length must be obtained from the DMA length
611 * reported in the RX event.
612 */
613 *lengthp = buffer[8] | (buffer[9] << 8);
614 return (0);
615}
616
617#if EFSYS_OPT_RX_SCALE
618 __checkReturn uint32_t
619ef10_rx_prefix_hash(
620 __in efx_nic_t *enp,
621 __in efx_rx_hash_alg_t func,
622 __in uint8_t *buffer)
623{
624 _NOTE(ARGUNUSED(enp))
625
622 switch (func) {
623 case EFX_RX_HASHALG_TOEPLITZ:
624 return (buffer[0] |
625 (buffer[1] << 8) |
626 (buffer[2] << 16) |
627 (buffer[3] << 24));
628
629 default:

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

740 __in uint32_t id,
741 __in efx_evq_t *eep,
742 __in efx_rxq_t *erp)
743{
744 efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
745 efx_rc_t rc;
746 boolean_t disable_scatter;
747
626 switch (func) {
627 case EFX_RX_HASHALG_TOEPLITZ:
628 return (buffer[0] |
629 (buffer[1] << 8) |
630 (buffer[2] << 16) |
631 (buffer[3] << 24));
632
633 default:

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

744 __in uint32_t id,
745 __in efx_evq_t *eep,
746 __in efx_rxq_t *erp)
747{
748 efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
749 efx_rc_t rc;
750 boolean_t disable_scatter;
751
748 _NOTE(ARGUNUSED(erp))
752 _NOTE(ARGUNUSED(id, erp))
749
750 EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH));
751 EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
752 EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
753
754 EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
755 EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
756

--- 70 unchanged lines hidden ---
753
754 EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH));
755 EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
756 EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
757
758 EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
759 EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
760

--- 70 unchanged lines hidden ---