+static int
+sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
+ struct rte_eth_rss_conf *conf)
+{
+ efx_rx_hash_type_t efx_hash_types = sa->rss_hash_types;
+
+ if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
+ if ((conf->rss_hf != 0 && conf->rss_hf != SFC_RSS_OFFLOADS) ||
+ conf->rss_key != NULL)
+ return EINVAL;
+ }
+
+ if (conf->rss_hf != 0) {
+ if ((conf->rss_hf & ~SFC_RSS_OFFLOADS) != 0) {
+ sfc_err(sa, "unsupported hash functions requested");
+ return EINVAL;
+ }
+
+ efx_hash_types = sfc_rte_to_efx_hash_type(conf->rss_hf);
+ }
+
+ if (conf->rss_key != NULL) {
+ if (conf->rss_key_len != sizeof(sa->rss_key)) {
+ sfc_err(sa, "RSS key size is wrong (should be %lu)",
+ sizeof(sa->rss_key));
+ return EINVAL;
+ }
+ rte_memcpy(sa->rss_key, conf->rss_key, sizeof(sa->rss_key));
+ }
+
+ sa->rss_hash_types = efx_hash_types;
+
+ return 0;
+}
+