49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Copyright (c) 2012-2015 Solarflare Communications Inc.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * All rights reserved.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Redistribution and use in source and binary forms, with or without
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * modification, are permitted provided that the following conditions are met:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 1. Redistributions of source code must retain the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer in the documentation
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * and/or other materials provided with the distribution.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The views and conclusions contained in the software and documentation are
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * those of the authors and should not be interpreted as representing official
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * policies, either expressed or implied, of the FreeBSD Project.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS))];
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* If this changes, then the payload size might need to change. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_INIT_RXQ_IN_LEN(npages);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_INIT_RXQ_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_SIZE, size);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_TARGET_EVQ, target_evq);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_LABEL, label);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_INSTANCE, instance);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_POPULATE_DWORD_6(req, INIT_RXQ_IN_FLAGS,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore INIT_RXQ_IN_FLAG_DISABLE_SCATTER, disable_scatter);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_OWNER_ID, 0);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore dma_addr = MCDI_IN2(req, efx_qword_t, INIT_RXQ_IN_DMA_ADDR);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (i = 0; i < npages; i++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_DWORD_0, (uint32_t)(addr & 0xffffffff));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_FINI_RXQ_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, FINI_RXQ_IN_INSTANCE, instance);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_SHARED;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_UPSTREAM_PORT_ID,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_TYPE, context_type);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* NUM_QUEUES is only used to validate indirection table offsets */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_ALLOC_IN_NUM_QUEUES, num_queues);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (req.emr_out_length_used < MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore rss_context = MCDI_OUT_DWORD(req, RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (rss_context == EF10_RSS_CONTEXT_INVALID) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_FREE_IN_LEN,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (rss_context == EF10_RSS_CONTEXT_INVALID) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_RSS_CONTEXT_FREE_IN_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_RSS_CONTEXT_FREE_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_FREE_IN_RSS_CONTEXT_ID, rss_context);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (rss_context == EF10_RSS_CONTEXT_INVALID) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_FLAGS_IN_RSS_CONTEXT_ID,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (type & (1U << EFX_RX_HASH_TCPIPV4)) ? 1 : 0,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (type & (1U << EFX_RX_HASH_TCPIPV6)) ? 1 : 0);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (rss_context == EF10_RSS_CONTEXT_INVALID) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_KEY_IN_RSS_CONTEXT_ID,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(n, ==, MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (n != MC_CMD_RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY_LEN) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore RSS_CONTEXT_SET_KEY_IN_TOEPLITZ_KEY), key, n);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (rss_context == EF10_RSS_CONTEXT_INVALID) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) memset(payload, 0, sizeof (payload));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req.emr_out_length = MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN_SET_DWORD(req, RSS_CONTEXT_SET_TABLE_IN_RSS_CONTEXT_ID,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore MCDI_IN2(req, uint8_t, RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore i < MC_CMD_RSS_CONTEXT_SET_TABLE_IN_INDIRECTION_TABLE_LEN;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore req_table[i] = (n > 0) ? (uint8_t)table[i % n] : 0;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (efx_mcdi_rss_context_alloc(enp, EFX_RX_SCALE_EXCLUSIVE, EFX_MAXRSS,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Allocated an exclusive RSS context, which allows both the
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * indirection table and key to be modified.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_hash_support = EFX_RX_HASH_AVAILABLE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Failed to allocate an exclusive RSS context. Continue
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * operation without support for RSS. The pseudo-header in
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * received packets will not contain a Toeplitz hash value.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_hash_support = EFX_RX_HASH_UNAVAILABLE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCATTER */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(alg, ==, EFX_RX_HASHALG_TOEPLITZ);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((alg != EFX_RX_HASHALG_TOEPLITZ) || (insert == B_FALSE)) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = efx_mcdi_rss_context_set_flags(enp,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = efx_mcdi_rss_context_set_table(enp,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EF10 RX pseudo-header
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * ---------------------
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Receive packets are prefixed by an (optional) 14 byte pseudo-header:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * +00: Toeplitz hash value.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (32bit little-endian)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * +04: Outer VLAN tag. Zero if the packet did not have an outer VLAN tag.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (16bit big-endian)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * +06: Inner VLAN tag. Zero if the packet did not have an inner VLAN tag.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (16bit big-endian)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * +08: Packet Length. Zero if the RX datapath was in cut-through mode.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (16bit little-endian)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * +10: MAC timestamp. Zero if timestamping is not enabled.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * (32bit little-endian)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * See "The RX Pseudo-header" in SF-109306-TC.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The RX pseudo-header contains the packet length, excluding the
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * pseudo-header. If the hardware receive datapath was operating in
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * cut-through mode then the length in the RX pseudo-header will be
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * zero, and the packet length must be obtained from the DMA length
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * reported in the RX event.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore __in unsigned int n,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore unsigned int i;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* The client driver must not overfill the queue */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (i = 0; i < n; i++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_PROBE4(rx_post, unsigned int, erp->er_index,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore unsigned int, id, efsys_dma_addr_t, addrp[i],
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_MEM_WRITEQ(erp->er_esmp, offset, &qword);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Hardware has alignment restriction for WPTR */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Push the populated descriptors out */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_POPULATE_DWORD_1(dword, ERF_DZ_RX_DESC_WPTR, wptr);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_DMA_SYNC_QUEUE_FOR_DEVICE(erp->er_esmp, erp->er_mask + 1,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_BAR_TBL_WRITED(enp, ER_DZ_RX_DESC_UPD_REG,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = efx_mcdi_fini_rxq(enp, erp->er_index)) != 0)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (!ISP2(n) || (n < EFX_RXQ_MINNDESCS) || (n > EFX_RXQ_MAXNDESCS)) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Scatter can only be disabled if the firmware supports doing so */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_nic_cfg.enc_rx_disable_scatter_supported) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (enp->en_rss_support != EFX_RX_SCALE_UNAVAILABLE) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) efx_mcdi_rss_context_free(enp, enp->en_rss_context);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_RX_SCALE */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */