hw->vlan_mode = HNS3_SW_SHIFT_AND_DISCARD_MODE;
hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
pf->tqp_config_mode = HNS3_FIXED_MAX_TQP_NUM_MODE;
+ hw->rss_info.ipv6_sctp_offload_supported = false;
return 0;
}
hw->vlan_mode = HNS3_HW_SHIFT_AND_DISCARD_MODE;
hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
pf->tqp_config_mode = HNS3_FLEX_MAX_TQP_NUM_MODE;
+ hw->rss_info.ipv6_sctp_offload_supported = true;
return 0;
}
hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
hw->tso_mode = HNS3_TSO_SW_CAL_PSEUDO_H_CSUM;
hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
+ hw->rss_info.ipv6_sctp_offload_supported = false;
return 0;
}
hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
hw->tso_mode = HNS3_TSO_HW_CAL_PSEUDO_H_CSUM;
hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
+ hw->rss_info.ipv6_sctp_offload_supported = true;
return 0;
}
RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
"too many queues for RSS context");
+ /*
+ * For Kunpeng920 and Kunpeng930 NIC hardware, it is not supported to
+ * use dst port/src port fields to RSS hash for the following packet
+ * types.
+ * - IPV4 FRAG | IPV4 NONFRAG | IPV6 FRAG | IPV6 NONFRAG
+ * Besides, for Kunpeng920, The NIC hardware is not supported to use
+ * src/dst port fields to RSS hash for IPV6 SCTP packet type.
+ */
if (rss->types & (ETH_RSS_L4_DST_ONLY | ETH_RSS_L4_SRC_ONLY) &&
- (rss->types & ETH_RSS_IP))
+ (rss->types & ETH_RSS_IP ||
+ (!hw->rss_info.ipv6_sctp_offload_supported &&
+ rss->types & ETH_RSS_NONFRAG_IPV6_SCTP)))
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_T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V6_SCTP_EN_SCTP_S) |
BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER) },
{ ETH_RSS_NONFRAG_IPV6_OTHER,
BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE]; /* Shadow table */
uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
bool valid; /* check if RSS rule is valid */
+ /*
+ * For IPv6 SCTP packets type, check whether the NIC hardware support
+ * RSS hash using the src/dst port as the input tuple. For Kunpeng920
+ * NIC hardware, it is not supported
+ */
+ bool ipv6_sctp_offload_supported;
};
#ifndef ilog2