Skip to content

Commit 7767080

Browse files
qzhan16NipaLocal
authored and
NipaLocal
committed
ice: refactor RSS configuration
Refactor the driver to use a communication data structure for RSS config. To do so we introduce the new ice_rss_hash_cfg struct, and then pass it as an argument to several functions. Also introduce enum ice_rss_cfg_hdr_type to specify a more granular and flexible RSS configuration: ICE_RSS_OUTER_HEADERS - take outer layer as RSS input set ICE_RSS_INNER_HEADERS - take inner layer as RSS input set ICE_RSS_INNER_HEADERS_W_OUTER_IPV4 - take inner layer as RSS input set for packet with outer IPV4 ICE_RSS_INNER_HEADERS_W_OUTER_IPV6 - take inner layer as RSS input set for packet with outer IPV6 ICE_RSS_ANY_HEADERS - try with outer first then inner (same as the behaviour without this change) Finally, move the virtchnl_rss_algorithm enum to be with the other RSS related structures in the virtchnl.h file. There should be no functional change due to this patch. Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Qi Zhang <[email protected]> Co-developed-by: Jesse Brandeburg <[email protected]> Signed-off-by: Jesse Brandeburg <[email protected]> Co-developed-by: Ahmed Zaki <[email protected]> Signed-off-by: Ahmed Zaki <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 40093b7 commit 7767080

File tree

6 files changed

+246
-177
lines changed

6 files changed

+246
-177
lines changed

drivers/net/ethernet/intel/ice/ice_ethtool.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,7 @@ static int
25912591
ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
25922592
{
25932593
struct ice_pf *pf = vsi->back;
2594+
struct ice_rss_hash_cfg cfg;
25942595
struct device *dev;
25952596
u64 hashed_flds;
25962597
int status;
@@ -2617,7 +2618,10 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
26172618
return -EINVAL;
26182619
}
26192620

2620-
status = ice_add_rss_cfg(&pf->hw, vsi->idx, hashed_flds, hdrs);
2621+
cfg.hash_flds = hashed_flds;
2622+
cfg.addl_hdrs = hdrs;
2623+
cfg.hdr_type = ICE_RSS_ANY_HEADERS;
2624+
status = ice_add_rss_cfg(&pf->hw, vsi->idx, &cfg);
26212625
if (status) {
26222626
dev_dbg(dev, "ice_add_rss_cfg failed, vsi num = %d, error = %d\n",
26232627
vsi->vsi_num, status);

0 commit comments

Comments
 (0)