MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ixgbe_set_rsc

Function ixgbe_set_rsc

dpdk/drivers/net/ixgbe/ixgbe_rxtx.c:4976–5101  ·  view source on GitHub ↗

* ixgbe_set_rsc - configure RSC related port HW registers * * Configures the port's RSC related registers according to the 4.6.7.2 chapter * of 82599 Spec (x540 configuration is virtually the same). * * @dev port handle * * Returns 0 in case of success or a non-zero error code */

Source from the content-addressed store, hash-verified

4974 * Returns 0 in case of success or a non-zero error code
4975 */
4976static int
4977ixgbe_set_rsc(struct rte_eth_dev *dev)
4978{
4979 struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
4980 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
4981 struct rte_eth_dev_info dev_info = { 0 };
4982 bool rsc_capable = false;
4983 uint16_t i;
4984 uint32_t rdrxctl;
4985 uint32_t rfctl;
4986
4987 /* Sanity check */
4988 dev->dev_ops->dev_infos_get(dev, &dev_info);
4989 if (dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_TCP_LRO)
4990 rsc_capable = true;
4991
4992 if (!rsc_capable && (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO)) {
4993 PMD_INIT_LOG(CRIT, "LRO is requested on HW that doesn't "
4994 "support it");
4995 return -EINVAL;
4996 }
4997
4998 /* RSC global configuration (chapter 4.6.7.2.1 of 82599 Spec) */
4999
5000 if ((rx_conf->offloads & RTE_ETH_RX_OFFLOAD_KEEP_CRC) &&
5001 (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO)) {
5002 /*
5003 * According to chapter of 4.6.7.2.1 of the Spec Rev.
5004 * 3.0 RSC configuration requires HW CRC stripping being
5005 * enabled. If user requested both HW CRC stripping off
5006 * and RSC on - return an error.
5007 */
5008 PMD_INIT_LOG(CRIT, "LRO can't be enabled when HW CRC "
5009 "is disabled");
5010 return -EINVAL;
5011 }
5012
5013 /* RFCTL configuration */
5014 rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL);
5015 if ((rsc_capable) && (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO))
5016 rfctl &= ~IXGBE_RFCTL_RSC_DIS;
5017 else
5018 rfctl |= IXGBE_RFCTL_RSC_DIS;
5019 /* disable NFS filtering */
5020 rfctl |= IXGBE_RFCTL_NFSW_DIS | IXGBE_RFCTL_NFSR_DIS;
5021 IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl);
5022
5023 /* If LRO hasn't been requested - we are done here. */
5024 if (!(rx_conf->offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO))
5025 return 0;
5026
5027 /* Set RDRXCTL.RSCACKC bit */
5028 rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
5029 rdrxctl |= IXGBE_RDRXCTL_RSCACKC;
5030 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl);
5031
5032 /* Per-queue RSC configuration (chapter 4.6.7.2.2 of 82599 Spec) */
5033 for (i = 0; i < dev->data->nb_rx_queues; i++) {

Callers 1

ixgbe_dev_rx_initFunction · 0.85

Calls 2

ixgbe_get_rscctl_maxdescFunction · 0.85
ixgbe_set_ivarFunction · 0.85

Tested by

no test coverage detected