Skip to content

Commit fb0efc1

Browse files
jacob-kelleranguy11
authored andcommitted
net: intel: rename 'hena' to 'hashcfg' for clarity
i40e, ice, and iAVF all use 'hena' as a shorthand for the "hash enable" configuration. This comes originally from the X710 datasheet 'xxQF_HENA' registers. In the context of the registers the meaning is fairly clear. However, on its own, hena is a weird name that can be more difficult to understand. This is especially true in ice. The E810 hardware doesn't even have registers with HENA in the name. Replace the shorthand 'hena' with 'hashcfg'. This makes it clear the variables deal with the Hash configuration, not just a single boolean on/off for all hashing. Do not update the register names. These come directly from the datasheet for X710 and X722, and it is more important that the names can be searched. Suggested-by: Przemek Kitszel <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Jacob Keller <[email protected]>
1 parent 317f9d0 commit fb0efc1

File tree

13 files changed

+101
-97
lines changed

13 files changed

+101
-97
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12468,7 +12468,7 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)
1246812468
/* By default we enable TCP/UDP with IPv4/IPv6 ptypes */
1246912469
hena = (u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(0)) |
1247012470
((u64)i40e_read_rx_ctl(hw, I40E_PFQF_HENA(1)) << 32);
12471-
hena |= i40e_pf_get_default_rss_hena(pf);
12471+
hena |= i40e_pf_get_default_rss_hashcfg(pf);
1247212472

1247312473
i40e_write_rx_ctl(hw, I40E_PFQF_HENA(0), (u32)hena);
1247412474
i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32));

drivers/net/ethernet/intel/i40e/i40e_txrx.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ enum i40e_dyn_idx {
7171
#define I40E_SW_ITR I40E_IDX_ITR2
7272

7373
/* Supported RSS offloads */
74-
#define I40E_DEFAULT_RSS_HENA ( \
74+
#define I40E_DEFAULT_RSS_HASHCFG ( \
7575
BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \
7676
BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \
7777
BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \
@@ -84,17 +84,17 @@ enum i40e_dyn_idx {
8484
BIT_ULL(I40E_FILTER_PCTYPE_FRAG_IPV6) | \
8585
BIT_ULL(I40E_FILTER_PCTYPE_L2_PAYLOAD))
8686

87-
#define I40E_DEFAULT_RSS_HENA_EXPANDED (I40E_DEFAULT_RSS_HENA | \
87+
#define I40E_DEFAULT_RSS_HASHCFG_EXPANDED (I40E_DEFAULT_RSS_HASHCFG | \
8888
BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK) | \
8989
BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | \
9090
BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) | \
9191
BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK) | \
9292
BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | \
9393
BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP))
9494

95-
#define i40e_pf_get_default_rss_hena(pf) \
95+
#define i40e_pf_get_default_rss_hashcfg(pf) \
9696
(test_bit(I40E_HW_CAP_MULTI_TCP_UDP_RSS_PCTYPE, (pf)->hw.caps) ? \
97-
I40E_DEFAULT_RSS_HENA_EXPANDED : I40E_DEFAULT_RSS_HENA)
97+
I40E_DEFAULT_RSS_HASHCFG_EXPANDED : I40E_DEFAULT_RSS_HASHCFG)
9898

9999
/* Supported Rx Buffer Sizes (a multiple of 128) */
100100
#define I40E_RXBUFFER_256 256

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, u8 idx)
812812
}
813813

814814
if (!idx) {
815-
u64 hena = i40e_pf_get_default_rss_hena(pf);
815+
u64 hashcfg = i40e_pf_get_default_rss_hashcfg(pf);
816816
u8 broadcast[ETH_ALEN];
817817

818818
vf->lan_vsi_idx = vsi->idx;
@@ -841,8 +841,9 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, u8 idx)
841841
dev_info(&pf->pdev->dev,
842842
"Could not allocate VF broadcast filter\n");
843843
spin_unlock_bh(&vsi->mac_filter_hash_lock);
844-
wr32(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)hena);
845-
wr32(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id), (u32)(hena >> 32));
844+
wr32(&pf->hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)hashcfg);
845+
wr32(&pf->hw, I40E_VFQF_HENA1(1, vf->vf_id),
846+
(u32)(hashcfg >> 32));
846847
/* program mac filter only for VF VSI */
847848
ret = i40e_sync_vsi_filters(vsi);
848849
if (ret)
@@ -3443,15 +3444,15 @@ static int i40e_vc_config_rss_lut(struct i40e_vf *vf, u8 *msg)
34433444
}
34443445

34453446
/**
3446-
* i40e_vc_get_rss_hena
3447+
* i40e_vc_get_rss_hashcfg
34473448
* @vf: pointer to the VF info
34483449
* @msg: pointer to the msg buffer
34493450
*
3450-
* Return the RSS HENA bits allowed by the hardware
3451+
* Return the RSS Hash configuration bits allowed by the hardware
34513452
**/
3452-
static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg)
3453+
static int i40e_vc_get_rss_hashcfg(struct i40e_vf *vf, u8 *msg)
34533454
{
3454-
struct virtchnl_rss_hena *vrh = NULL;
3455+
struct virtchnl_rss_hashcfg *vrh = NULL;
34553456
struct i40e_pf *pf = vf->pf;
34563457
int aq_ret = 0;
34573458
int len = 0;
@@ -3460,34 +3461,34 @@ static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg)
34603461
aq_ret = -EINVAL;
34613462
goto err;
34623463
}
3463-
len = sizeof(struct virtchnl_rss_hena);
3464+
len = sizeof(struct virtchnl_rss_hashcfg);
34643465

34653466
vrh = kzalloc(len, GFP_KERNEL);
34663467
if (!vrh) {
34673468
aq_ret = -ENOMEM;
34683469
len = 0;
34693470
goto err;
34703471
}
3471-
vrh->hena = i40e_pf_get_default_rss_hena(pf);
3472+
vrh->hashcfg = i40e_pf_get_default_rss_hashcfg(pf);
34723473
err:
34733474
/* send the response back to the VF */
3474-
aq_ret = i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_RSS_HENA_CAPS,
3475+
aq_ret = i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS,
34753476
aq_ret, (u8 *)vrh, len);
34763477
kfree(vrh);
34773478
return aq_ret;
34783479
}
34793480

34803481
/**
3481-
* i40e_vc_set_rss_hena
3482+
* i40e_vc_set_rss_hashcfg
34823483
* @vf: pointer to the VF info
34833484
* @msg: pointer to the msg buffer
34843485
*
3485-
* Set the RSS HENA bits for the VF
3486+
* Set the RSS Hash configuration bits for the VF
34863487
**/
3487-
static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg)
3488+
static int i40e_vc_set_rss_hashcfg(struct i40e_vf *vf, u8 *msg)
34883489
{
3489-
struct virtchnl_rss_hena *vrh =
3490-
(struct virtchnl_rss_hena *)msg;
3490+
struct virtchnl_rss_hashcfg *vrh =
3491+
(struct virtchnl_rss_hashcfg *)msg;
34913492
struct i40e_pf *pf = vf->pf;
34923493
struct i40e_hw *hw = &pf->hw;
34933494
int aq_ret = 0;
@@ -3496,13 +3497,14 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg)
34963497
aq_ret = -EINVAL;
34973498
goto err;
34983499
}
3499-
i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(0, vf->vf_id), (u32)vrh->hena);
3500+
i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(0, vf->vf_id),
3501+
(u32)vrh->hashcfg);
35003502
i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(1, vf->vf_id),
3501-
(u32)(vrh->hena >> 32));
3503+
(u32)(vrh->hashcfg >> 32));
35023504

35033505
/* send the response to the VF */
35043506
err:
3505-
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_SET_RSS_HENA, aq_ret);
3507+
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_SET_RSS_HASHCFG, aq_ret);
35063508
}
35073509

35083510
/**
@@ -4248,11 +4250,11 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,
42484250
case VIRTCHNL_OP_CONFIG_RSS_LUT:
42494251
ret = i40e_vc_config_rss_lut(vf, msg);
42504252
break;
4251-
case VIRTCHNL_OP_GET_RSS_HENA_CAPS:
4252-
ret = i40e_vc_get_rss_hena(vf, msg);
4253+
case VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS:
4254+
ret = i40e_vc_get_rss_hashcfg(vf, msg);
42534255
break;
4254-
case VIRTCHNL_OP_SET_RSS_HENA:
4255-
ret = i40e_vc_set_rss_hena(vf, msg);
4256+
case VIRTCHNL_OP_SET_RSS_HASHCFG:
4257+
ret = i40e_vc_set_rss_hashcfg(vf, msg);
42564258
break;
42574259
case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
42584260
ret = i40e_vc_enable_vlan_stripping(vf, msg);

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ struct iavf_adapter {
315315
#define IAVF_FLAG_AQ_CONFIGURE_RSS BIT_ULL(9) /* direct AQ config */
316316
#define IAVF_FLAG_AQ_GET_CONFIG BIT_ULL(10)
317317
/* Newer style, RSS done by the PF so we can ignore hardware vagaries. */
318-
#define IAVF_FLAG_AQ_GET_HENA BIT_ULL(11)
319-
#define IAVF_FLAG_AQ_SET_HENA BIT_ULL(12)
318+
#define IAVF_FLAG_AQ_GET_RSS_HASHCFG BIT_ULL(11)
319+
#define IAVF_FLAG_AQ_SET_RSS_HASHCFG BIT_ULL(12)
320320
#define IAVF_FLAG_AQ_SET_RSS_KEY BIT_ULL(13)
321321
#define IAVF_FLAG_AQ_SET_RSS_LUT BIT_ULL(14)
322322
#define IAVF_FLAG_AQ_SET_RSS_HFUNC BIT_ULL(15)
@@ -456,7 +456,7 @@ struct iavf_adapter {
456456
u32 aq_wait_count;
457457
/* RSS stuff */
458458
enum virtchnl_rss_algorithm hfunc;
459-
u64 hena;
459+
u64 rss_hashcfg;
460460
u16 rss_key_size;
461461
u16 rss_lut_size;
462462
u8 *rss_key;
@@ -600,8 +600,8 @@ void iavf_set_promiscuous(struct iavf_adapter *adapter);
600600
bool iavf_promiscuous_mode_changed(struct iavf_adapter *adapter);
601601
void iavf_request_stats(struct iavf_adapter *adapter);
602602
int iavf_request_reset(struct iavf_adapter *adapter);
603-
void iavf_get_hena(struct iavf_adapter *adapter);
604-
void iavf_set_hena(struct iavf_adapter *adapter);
603+
void iavf_get_rss_hashcfg(struct iavf_adapter *adapter);
604+
void iavf_set_rss_hashcfg(struct iavf_adapter *adapter);
605605
void iavf_set_rss_key(struct iavf_adapter *adapter);
606606
void iavf_set_rss_lut(struct iavf_adapter *adapter);
607607
void iavf_set_rss_hfunc(struct iavf_adapter *adapter);

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,12 +1824,13 @@ static int iavf_init_rss(struct iavf_adapter *adapter)
18241824
/* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */
18251825
if (adapter->vf_res->vf_cap_flags &
18261826
VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2)
1827-
adapter->hena = IAVF_DEFAULT_RSS_HENA_EXPANDED;
1827+
adapter->rss_hashcfg =
1828+
IAVF_DEFAULT_RSS_HASHCFG_EXPANDED;
18281829
else
1829-
adapter->hena = IAVF_DEFAULT_RSS_HENA;
1830+
adapter->rss_hashcfg = IAVF_DEFAULT_RSS_HASHCFG;
18301831

1831-
wr32(hw, IAVF_VFQF_HENA(0), (u32)adapter->hena);
1832-
wr32(hw, IAVF_VFQF_HENA(1), (u32)(adapter->hena >> 32));
1832+
wr32(hw, IAVF_VFQF_HENA(0), (u32)adapter->rss_hashcfg);
1833+
wr32(hw, IAVF_VFQF_HENA(1), (u32)(adapter->rss_hashcfg >> 32));
18331834
}
18341835

18351836
iavf_fill_rss_lut(adapter);
@@ -2196,12 +2197,12 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
21962197
adapter->aq_required &= ~IAVF_FLAG_AQ_CONFIGURE_RSS;
21972198
return 0;
21982199
}
2199-
if (adapter->aq_required & IAVF_FLAG_AQ_GET_HENA) {
2200-
iavf_get_hena(adapter);
2200+
if (adapter->aq_required & IAVF_FLAG_AQ_GET_RSS_HASHCFG) {
2201+
iavf_get_rss_hashcfg(adapter);
22012202
return 0;
22022203
}
2203-
if (adapter->aq_required & IAVF_FLAG_AQ_SET_HENA) {
2204-
iavf_set_hena(adapter);
2204+
if (adapter->aq_required & IAVF_FLAG_AQ_SET_RSS_HASHCFG) {
2205+
iavf_set_rss_hashcfg(adapter);
22052206
return 0;
22062207
}
22072208
if (adapter->aq_required & IAVF_FLAG_AQ_SET_RSS_KEY) {

drivers/net/ethernet/intel/iavf/iavf_txrx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ enum iavf_dyn_idx_t {
5959
#define IAVF_PE_ITR IAVF_IDX_ITR2
6060

6161
/* Supported RSS offloads */
62-
#define IAVF_DEFAULT_RSS_HENA ( \
62+
#define IAVF_DEFAULT_RSS_HASHCFG ( \
6363
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_IPV4_UDP) | \
6464
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_IPV4_SCTP) | \
6565
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_IPV4_TCP) | \
@@ -72,7 +72,7 @@ enum iavf_dyn_idx_t {
7272
BIT_ULL(IAVF_FILTER_PCTYPE_FRAG_IPV6) | \
7373
BIT_ULL(IAVF_FILTER_PCTYPE_L2_PAYLOAD))
7474

75-
#define IAVF_DEFAULT_RSS_HENA_EXPANDED (IAVF_DEFAULT_RSS_HENA | \
75+
#define IAVF_DEFAULT_RSS_HASHCFG_EXPANDED (IAVF_DEFAULT_RSS_HASHCFG | \
7676
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK) | \
7777
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | \
7878
BIT_ULL(IAVF_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) | \

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,44 +1145,44 @@ void iavf_request_stats(struct iavf_adapter *adapter)
11451145
}
11461146

11471147
/**
1148-
* iavf_get_hena
1148+
* iavf_get_rss_hashcfg
11491149
* @adapter: adapter structure
11501150
*
1151-
* Request hash enable capabilities from PF
1151+
* Request RSS Hash enable bits from PF
11521152
**/
1153-
void iavf_get_hena(struct iavf_adapter *adapter)
1153+
void iavf_get_rss_hashcfg(struct iavf_adapter *adapter)
11541154
{
11551155
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {
11561156
/* bail because we already have a command pending */
11571157
dev_err(&adapter->pdev->dev, "Cannot get RSS hash capabilities, command %d pending\n",
11581158
adapter->current_op);
11591159
return;
11601160
}
1161-
adapter->current_op = VIRTCHNL_OP_GET_RSS_HENA_CAPS;
1162-
adapter->aq_required &= ~IAVF_FLAG_AQ_GET_HENA;
1163-
iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_RSS_HENA_CAPS, NULL, 0);
1161+
adapter->current_op = VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS;
1162+
adapter->aq_required &= ~IAVF_FLAG_AQ_GET_RSS_HASHCFG;
1163+
iavf_send_pf_msg(adapter, VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS, NULL, 0);
11641164
}
11651165

11661166
/**
1167-
* iavf_set_hena
1167+
* iavf_set_rss_hashcfg
11681168
* @adapter: adapter structure
11691169
*
11701170
* Request the PF to set our RSS hash capabilities
11711171
**/
1172-
void iavf_set_hena(struct iavf_adapter *adapter)
1172+
void iavf_set_rss_hashcfg(struct iavf_adapter *adapter)
11731173
{
1174-
struct virtchnl_rss_hena vrh;
1174+
struct virtchnl_rss_hashcfg vrh;
11751175

11761176
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {
11771177
/* bail because we already have a command pending */
11781178
dev_err(&adapter->pdev->dev, "Cannot set RSS hash enable, command %d pending\n",
11791179
adapter->current_op);
11801180
return;
11811181
}
1182-
vrh.hena = adapter->hena;
1183-
adapter->current_op = VIRTCHNL_OP_SET_RSS_HENA;
1184-
adapter->aq_required &= ~IAVF_FLAG_AQ_SET_HENA;
1185-
iavf_send_pf_msg(adapter, VIRTCHNL_OP_SET_RSS_HENA, (u8 *)&vrh,
1182+
vrh.hashcfg = adapter->rss_hashcfg;
1183+
adapter->current_op = VIRTCHNL_OP_SET_RSS_HASHCFG;
1184+
adapter->aq_required &= ~IAVF_FLAG_AQ_SET_RSS_HASHCFG;
1185+
iavf_send_pf_msg(adapter, VIRTCHNL_OP_SET_RSS_HASHCFG, (u8 *)&vrh,
11861186
sizeof(vrh));
11871187
}
11881188

@@ -2752,11 +2752,12 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
27522752
if (v_opcode != adapter->current_op)
27532753
return;
27542754
break;
2755-
case VIRTCHNL_OP_GET_RSS_HENA_CAPS: {
2756-
struct virtchnl_rss_hena *vrh = (struct virtchnl_rss_hena *)msg;
2755+
case VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS: {
2756+
struct virtchnl_rss_hashcfg *vrh =
2757+
(struct virtchnl_rss_hashcfg *)msg;
27572758

27582759
if (msglen == sizeof(*vrh))
2759-
adapter->hena = vrh->hena;
2760+
adapter->rss_hashcfg = vrh->hashcfg;
27602761
else
27612762
dev_warn(&adapter->pdev->dev,
27622763
"Invalid message %d from PF\n", v_opcode);

drivers/net/ethernet/intel/ice/ice_flow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ enum ice_flow_avf_hdr_field {
295295
};
296296

297297
/* Supported RSS offloads This macro is defined to support
298-
* VIRTCHNL_OP_GET_RSS_HENA_CAPS ops. PF driver sends the RSS hardware
298+
* VIRTCHNL_OP_GET_RSS_HASHCFG_CAPS ops. PF driver sends the RSS hardware
299299
* capabilities to the caller of this ops.
300300
*/
301-
#define ICE_DEFAULT_RSS_HENA ( \
301+
#define ICE_DEFAULT_RSS_HASHCFG ( \
302302
BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_UDP) | \
303303
BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_SCTP) | \
304304
BIT_ULL(ICE_AVF_FLOW_FIELD_IPV4_TCP) | \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ static void ice_vsi_set_vf_rss_flow_fld(struct ice_vsi *vsi)
16171617
return;
16181618
}
16191619

1620-
status = ice_add_avf_rss_cfg(&pf->hw, vsi, ICE_DEFAULT_RSS_HENA);
1620+
status = ice_add_avf_rss_cfg(&pf->hw, vsi, ICE_DEFAULT_RSS_HASHCFG);
16211621
if (status)
16221622
dev_dbg(dev, "ice_add_avf_rss_cfg failed for vsi = %d, error = %d\n",
16231623
vsi->vsi_num, status);

0 commit comments

Comments
 (0)