src/dpdk/drivers/net/cxgbe/base/t4_hw.c
void t4_write_rss_key(struct adapter *adap, u32 *key, int idx)
{
	u32 vrt = t4_read_reg(adap, A_TP_RSS_CONFIG_VRT);
	u8 rss_key_addr_cnt = 16;

	/* T6 and later: for KeyMode 3 (per-vf and per-vf scramble),
	 * allows access to key addresses 16-63 by using KeyWrAddrX
	 * as index[5:4](upper 2) into key table
	 */
	if ((CHELSIO_CHIP_VERSION(adap->params.chip) > CHELSIO_T5) &&
	    (vrt & F_KEYEXTEND) && (G_KEYMODE(vrt) == 3))
		rss_key_addr_cnt = 32;

	t4_fw_tp_pio_rw(adap, key, 10, A_TP_RSS_SECRET_KEY0, 0);

	if (idx >= 0 && idx < rss_key_addr_cnt) {
		if (rss_key_addr_cnt > 16)
			t4_write_reg(adap, A_TP_RSS_CONFIG_VRT,
				     V_KEYWRADDRX(idx >> 4) |
				     V_T6_VFWRADDR(idx) | F_KEYWREN);
		else
			t4_write_reg(adap, A_TP_RSS_CONFIG_VRT,
				     V_KEYWRADDR(idx) | F_KEYWREN);
	}
}
/**
 * t4_write_rss_key - program one of the RSS keys
 * @adap: the adapter
 * @key: 10-entry array holding the 320-bit RSS key
 * @idx: which RSS key to write
 *
 * Writes one of the RSS keys with the given 320-bit value.  If @idx is
 * 0..15 the corresponding entry in the RSS key table is written,
 * otherwise the global RSS key is written.
 */
program one of the RSS keys
@adap: the adapter
@key: 10-entry array holding the 320-bit RSS key
@idx: which RSS key to write

Writes one of the RSS keys with the given 320-bit value.  If @idx is
0..15 the corresponding entry in the RSS key table is written,
otherwise the global RSS key is written.
program one of the RSS keys @adap : the adapter @key : 10 - entry array holding the 320 - bit RSS key @idx : which RSS key to write Writes one of the RSS keys with the given 320 - bit value . If @idx is 0 .. 15 the corresponding entry in the RSS key table is written otherwise the global RSS key is written .
void t4_write_rss_key(struct adapter *adap, u32 *key, int idx)
{
	u32 vrt = t4_read_reg(adap, A_TP_RSS_CONFIG_VRT);
	u8 rss_key_addr_cnt = 16;
	if ((CHELSIO_CHIP_VERSION(adap->params.chip) > CHELSIO_T5) &&
	    (vrt & F_KEYEXTEND) && (G_KEYMODE(vrt) == 3))
		rss_key_addr_cnt = 32;
	t4_fw_tp_pio_rw(adap, key, 10, A_TP_RSS_SECRET_KEY0, 0);
	if (idx >= 0 && idx < rss_key_addr_cnt) {
		if (rss_key_addr_cnt > 16)
			t4_write_reg(adap, A_TP_RSS_CONFIG_VRT,
				     V_KEYWRADDRX(idx >> 4) |
				     V_T6_VFWRADDR(idx) | F_KEYWREN);
		else
			t4_write_reg(adap, A_TP_RSS_CONFIG_VRT,
				     V_KEYWRADDR(idx) | F_KEYWREN);
	}
}
void t4_write_rss_key ( struct adapter * adap , u32 * key , int idx ) { u32 vrt = t4_read_reg ( adap , A_TP_RSS_CONFIG_VRT ) ; u8 rss_key_addr_cnt = 16 ; if ( ( CHELSIO_CHIP_VERSION ( adap -> params . chip ) > CHELSIO_T5 ) && ( vrt & F_KEYEXTEND ) && ( G_KEYMODE ( vrt ) == 3 ) ) rss_key_addr_cnt = 32 ; t4_fw_tp_pio_rw ( adap , key , 10 , A_TP_RSS_SECRET_KEY0 , 0 ) ; if ( idx >= 0 && idx < rss_key_addr_cnt ) { if ( rss_key_addr_cnt > 16 ) t4_write_reg ( adap , A_TP_RSS_CONFIG_VRT , V_KEYWRADDRX ( idx >> 4 ) | V_T6_VFWRADDR ( idx ) | F_KEYWREN ) ; else t4_write_reg ( adap , A_TP_RSS_CONFIG_VRT , V_KEYWRADDR ( idx ) | F_KEYWREN ) ; } }
t4_write_rss_key - program one of the RSS keys
 @adap: the adapter
 @key: 10-entry array holding the 320-bit RSS key
 @idx: which RSS key to write
t4_write_rss_key - program one of the RSS keys @adap : the adapter @key : 10 - entry array holding the 320 - bit RSS key @idx : which RSS key to write
/* T6 and later: for KeyMode 3 (per-vf and per-vf scramble),
	 * allows access to key addresses 16-63 by using KeyWrAddrX
	 * as index[5:4](upper 2) into key table
	 */