src/dpdk/drivers/net/cxgbe/cxgbe_main.c
int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf)
{
	struct adapter *adapter = pi->adapter;
	const struct sge_eth_rxq *rxq;
	u64 flags = 0;
	u16 rss;
	int err;

	/*  Should never be called before setting up sge eth rx queues */
	if (!(adapter->flags & FULL_INIT_DONE)) {
		dev_err(adap, "%s No RXQs available on port %d\n",
			__func__, pi->port_id);
		return -EINVAL;
	}

	/* Don't allow unsupported hash functions */
	if (rss_hf & ~CXGBE_RSS_HF_ALL)
		return -EINVAL;

	if (rss_hf & CXGBE_RSS_HF_IPV4_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN;

	if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN;

	if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_UDPEN;

	if (rss_hf & CXGBE_RSS_HF_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN;

	if (rss_hf & CXGBE_RSS_HF_TCP_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;

	if (rss_hf & CXGBE_RSS_HF_UDP_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_UDPEN;

	rxq = &adapter->sge.ethrxq[pi->first_rxqset];
	rss = rxq[0].rspq.abs_id;

	/* If Tunnel All Lookup isn't specified in the global RSS
	 * Configuration, then we need to specify a default Ingress
	 * Queue for any ingress packets which aren't hashed.  We'll
	 * use our first ingress queue ...
	 */
	err = t4_config_vi_rss(adapter, adapter->mbox, pi->viid,
			       flags, rss);
	return err;
}
/**
 * cxgbe_write_rss_conf - flash the RSS configuration for a given port
 * @pi: the port
 * @rss_hf: Hash configuration to apply
 */
flash the RSS configuration for a given port
@pi: the port
@rss_hf: Hash configuration to apply
flash the RSS configuration for a given port @pi : the port @rss_hf : Hash configuration to apply
int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf)
{
	struct adapter *adapter = pi->adapter;
	const struct sge_eth_rxq *rxq;
	u64 flags = 0;
	u16 rss;
	int err;
	if (!(adapter->flags & FULL_INIT_DONE)) {
		dev_err(adap, "%s No RXQs available on port %d\n",
			__func__, pi->port_id);
		return -EINVAL;
	}
	if (rss_hf & ~CXGBE_RSS_HF_ALL)
		return -EINVAL;
	if (rss_hf & CXGBE_RSS_HF_IPV4_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN;
	if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN;
	if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_UDPEN;
	if (rss_hf & CXGBE_RSS_HF_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN;
	if (rss_hf & CXGBE_RSS_HF_TCP_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN;
	if (rss_hf & CXGBE_RSS_HF_UDP_IPV6_MASK)
		flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN |
			 F_FW_RSS_VI_CONFIG_CMD_UDPEN;
	rxq = &adapter->sge.ethrxq[pi->first_rxqset];
	rss = rxq[0].rspq.abs_id;
	err = t4_config_vi_rss(adapter, adapter->mbox, pi->viid,
			       flags, rss);
	return err;
}
int cxgbe_write_rss_conf ( const struct port_info * pi , uint64_t rss_hf ) { struct adapter * adapter = pi -> adapter ; const struct sge_eth_rxq * rxq ; u64 flags = 0 ; u16 rss ; int err ; if ( ! ( adapter -> flags & FULL_INIT_DONE ) ) { dev_err ( adap , " \n " , __func__ , pi -> port_id ) ; return - EINVAL ; } if ( rss_hf & ~ CXGBE_RSS_HF_ALL ) return - EINVAL ; if ( rss_hf & CXGBE_RSS_HF_IPV4_MASK ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN ; if ( rss_hf & ETH_RSS_NONFRAG_IPV4_TCP ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN ; if ( rss_hf & ETH_RSS_NONFRAG_IPV4_UDP ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN ; if ( rss_hf & CXGBE_RSS_HF_IPV6_MASK ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN ; if ( rss_hf & CXGBE_RSS_HF_TCP_IPV6_MASK ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN ; if ( rss_hf & CXGBE_RSS_HF_UDP_IPV6_MASK ) flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN ; rxq = & adapter -> sge . ethrxq [ pi -> first_rxqset ] ; rss = rxq [ 0 ] . rspq . abs_id ; err = t4_config_vi_rss ( adapter , adapter -> mbox , pi -> viid , flags , rss ) ; return err ; }
cxgbe_write_rss_conf - flash the RSS configuration for a given port
 @pi: the port
 @rss_hf: Hash configuration to apply
cxgbe_write_rss_conf - flash the RSS configuration for a given port @pi : the port @rss_hf : Hash configuration to apply
/*  Should never be called before setting up sge eth rx queues */ /* Don't allow unsupported hash functions */ /* If Tunnel All Lookup isn't specified in the global RSS
	 * Configuration, then we need to specify a default Ingress
	 * Queue for any ingress packets which aren't hashed.  We'll
	 * use our first ingress queue ...
	 */