RE: [PATCH v2 net-next] bnx2x: ethtool -x full support
From: Mintz, Yuval <hidden>
Date: 2016-12-05 09:45:58
if (config_hash) {
/* RSS keys */
- netdev_rss_key_fill(params.rss_key, T_ETH_RSS_KEY * 4);
+ netdev_rss_key_fill(&rss_obj->rss_key, T_ETH_RSS_KEY * 4);
__set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags);
}Those are still parameters. It's preferable to copy them from params to The rss_obj inside bnx2x_setup_rss() where they're already used to configure the ramrod.
+ if (key) {
+ if (bp->port.pmf || !CHIP_IS_E1x(bp))
+ memcpy(key, &bp->rss_conf_obj.rss_key,If possible, implement in bnx2x_sp.c a function similar to bnx2x_get_get_rss_ind_table that would extract this from the rss_conf_obj instead of directly accessing it here.
- memcpy(req->rss_key, params->rss_key, sizeof(params->rss_key)); + memcpy(req->rss_key, params->rss_obj->rss_key, + sizeof(params->rss_obj->rss_key));
Drop this; Should still be in the parameters. But we'll need to set them in the rss_obj for the rxfh for VFs.
- memcpy(rss.rss_key, rss_tlv->rss_key, sizeof(rss_tlv->rss_key)); + memcpy(&vf->rss_conf_obj.rss_key, rss_tlv->rss_key, +sizeof(rss_tlv->rss_key));
Unneeded, still a parameter. Just to explain my petty flavor preferences - As bnx2x_sp.[ch] originates as generated code, we try limiting the places the internal fields of structs defined in the .h are accessed outside the .c file; Otherwise it's a headache to maintain. Functionally - this looks fine. If preferable, I have no objections taking this patch as-is, and I'll later re-factor to something that better suits my needs. Thanks, Yuval