aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ice/ice_iflib_txrx.c
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2023-02-14 01:29:44 +0000
committerEric Joyner <erj@FreeBSD.org>2023-02-17 22:54:35 +0000
commitebc914f942f6655ff4c27f8717630f81c74624cb (patch)
tree9866d259c0314c3dc339e1c3459fc573fd6d48b6 /sys/dev/ice/ice_iflib_txrx.c
parentcd280c60a5b85875b8aeff8d522793914e60d19d (diff)
downloadsrc-ebc914f942f6655ff4c27f8717630f81c74624cb.tar.gz
src-ebc914f942f6655ff4c27f8717630f81c74624cb.zip
ice(4): Update to 1.37.7-k
Notable changes include: - DSCP QoS Support (leveraging support added in rG9c950139051298831ce19d01ea5fb33ec6ea7f89) - Improved PFC handling and TC queue assignments (now all remaining queues are assigned to TC 0 when more than one TC is enabled and the number of available queues does not evenly divide between them) - Support for dumping the internal FW state for additional debugging by Intel support - Support for allowing "No FEC" to be a valid state for the LESM to negotiate when using non-standard compliant modules Also includes various bug fixes and smaller enhancements, too. Signed-off-by: Eric Joyner <erj@FreeBSD.org> Reviewed by: erj@ Tested by: Jeff Pieper <jeffrey.pieper@intel.com> MFC after: 3 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38109 (cherry picked from commit 8923de59054358980102ea5acda6c6dd58273957)
Diffstat (limited to 'sys/dev/ice/ice_iflib_txrx.c')
-rw-r--r--sys/dev/ice/ice_iflib_txrx.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/sys/dev/ice/ice_iflib_txrx.c b/sys/dev/ice/ice_iflib_txrx.c
index 52c4364a2430..f2ae62c77f7c 100644
--- a/sys/dev/ice/ice_iflib_txrx.c
+++ b/sys/dev/ice/ice_iflib_txrx.c
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
-/* Copyright (c) 2021, Intel Corporation
+/* Copyright (c) 2022, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,7 @@ static int ice_ift_txd_credits_update(void *arg, uint16_t txqid, bool clear);
static int ice_ift_rxd_available(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t budget);
static void ice_ift_rxd_flush(void *arg, uint16_t rxqid, uint8_t flidx, qidx_t pidx);
static void ice_ift_rxd_refill(void *arg, if_rxd_update_t iru);
-static qidx_t ice_ift_queue_select(void *arg, struct mbuf *m);
+static qidx_t ice_ift_queue_select(void *arg, struct mbuf *m, if_pkt_info_t pi);
/* Macro to help extract the NIC mode flexible Rx descriptor fields from the
* advanced 32byte Rx descriptors.
@@ -79,7 +79,7 @@ struct if_txrx ice_txrx = {
.ift_rxd_pkt_get = ice_ift_rxd_pkt_get,
.ift_rxd_refill = ice_ift_rxd_refill,
.ift_rxd_flush = ice_ift_rxd_flush,
- .ift_txq_select = ice_ift_queue_select,
+ .ift_txq_select_v2 = ice_ift_queue_select,
};
/**
@@ -284,7 +284,6 @@ static int
ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri)
{
struct ice_softc *sc = (struct ice_softc *)arg;
- if_softc_ctx_t scctx = sc->scctx;
struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[ri->iri_qsidx];
union ice_32b_rx_flex_desc *cur;
u16 status0, plen, ptype;
@@ -342,7 +341,7 @@ ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri)
/* Get packet type and set checksum flags */
ptype = le16toh(cur->wb.ptype_flex_flags0) &
ICE_RX_FLEX_DESC_PTYPE_M;
- if ((scctx->isc_capenable & IFCAP_RXCSUM) != 0)
+ if ((iflib_get_ifp(sc->ctx)->if_capenable & IFCAP_RXCSUM) != 0)
ice_rx_checksum(rxq, &ri->iri_csum_flags,
&ri->iri_csum_data, status0, ptype);
@@ -408,9 +407,10 @@ ice_ift_rxd_flush(void *arg, uint16_t rxqid, uint8_t flidx __unused,
}
static qidx_t
-ice_ift_queue_select(void *arg, struct mbuf *m)
+ice_ift_queue_select(void *arg, struct mbuf *m, if_pkt_info_t pi)
{
struct ice_softc *sc = (struct ice_softc *)arg;
+ struct ice_dcbx_cfg *local_dcbx_cfg;
struct ice_vsi *vsi = &sc->pf_vsi;
u16 tc_base_queue, tc_qcount;
u8 up, tc;
@@ -431,12 +431,21 @@ ice_ift_queue_select(void *arg, struct mbuf *m)
return (0);
}
- /* Use default TC unless overridden */
+ /* Use default TC unless overridden later */
tc = 0; /* XXX: Get default TC for traffic if >1 TC? */
- if (m->m_flags & M_VLANTAG) {
+ local_dcbx_cfg = &sc->hw.port_info->qos_cfg.local_dcbx_cfg;
+
+#if defined(INET) || defined(INET6)
+ if ((local_dcbx_cfg->pfc_mode == ICE_QOS_MODE_DSCP) &&
+ (pi->ipi_flags & (IPI_TX_IPV4 | IPI_TX_IPV6))) {
+ u8 dscp_val = pi->ipi_ip_tos >> 2;
+ tc = local_dcbx_cfg->dscp_map[dscp_val];
+ } else
+#endif /* defined(INET) || defined(INET6) */
+ if (m->m_flags & M_VLANTAG) { /* ICE_QOS_MODE_VLAN */
up = EVL_PRIOFTAG(m->m_pkthdr.ether_vtag);
- tc = sc->hw.port_info->qos_cfg.local_dcbx_cfg.etscfg.prio_table[up];
+ tc = local_dcbx_cfg->etscfg.prio_table[up];
}
tc_base_queue = vsi->tc_info[tc].qoffset;