FreeBSD/sys/dev/ixl/ixl_pf_main.c
/*
 * Configure enabled PCTYPES for RSS.
 */
Configure enabled PCTYPES for RSS.
Configure enabled PCTYPES for RSS .
void
ixl_set_rss_pctypes(struct ixl_pf *pf)
{
	struct i40e_hw *hw = &pf->hw;
	u64		set_hena = 0, hena;
#ifdef RSS
	u32		rss_hash_config;
	rss_hash_config = rss_gethashconfig();
	if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER);
	if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP);
	if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP);
	if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER);
	if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX)
		set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6);
	if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP);
        if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6)
                set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP);
#else
	set_hena = IXL_DEFAULT_RSS_HENA;
#endif
	hena = (u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0)) |
	    ((u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1)) << 32);
	hena |= set_hena;
	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (u32)hena);
	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32));
}
void ixl_set_rss_pctypes ( struct ixl_pf * pf ) { struct i40e_hw * hw = & pf -> hw ; u64 set_hena = 0 , hena ; #ifdef RSS u32 rss_hash_config ; rss_hash_config = rss_gethashconfig ( ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_IPV4 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_IPV6 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_FRAG_IPV6 ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP ) ; if ( rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6 ) set_hena |= ( ( u64 ) 1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP ) ; #else set_hena = IXL_DEFAULT_RSS_HENA ; #endif hena = ( u64 ) i40e_read_rx_ctl ( hw , I40E_PFQF_HENA ( 0 ) ) | ( ( u64 ) i40e_read_rx_ctl ( hw , I40E_PFQF_HENA ( 1 ) ) << 32 ) ; hena |= set_hena ; i40e_write_rx_ctl ( hw , I40E_PFQF_HENA ( 0 ) , ( u32 ) hena ) ; i40e_write_rx_ctl ( hw , I40E_PFQF_HENA ( 1 ) , ( u32 ) ( hena >> 32 ) ) ; }
Configure enabled PCTYPES for RSS.
Configure enabled PCTYPES for RSS .