@@ -2616,7 +2616,7 @@ static void i40e_sync_filters_subtask(struct i40e_pf *pf)
2616
2616
return ;
2617
2617
if (!test_and_clear_bit (__I40E_MACVLAN_SYNC_PENDING , pf -> state ))
2618
2618
return ;
2619
- if (test_and_set_bit (__I40E_VF_DISABLE , pf -> state )) {
2619
+ if (test_bit (__I40E_VF_DISABLE , pf -> state )) {
2620
2620
set_bit (__I40E_MACVLAN_SYNC_PENDING , pf -> state );
2621
2621
return ;
2622
2622
}
@@ -2634,7 +2634,6 @@ static void i40e_sync_filters_subtask(struct i40e_pf *pf)
2634
2634
}
2635
2635
}
2636
2636
}
2637
- clear_bit (__I40E_VF_DISABLE , pf -> state );
2638
2637
}
2639
2638
2640
2639
/**
@@ -5937,7 +5936,7 @@ static int i40e_add_channel(struct i40e_pf *pf, u16 uplink_seid,
5937
5936
ch -> enabled_tc = !i40e_is_channel_macvlan (ch ) && enabled_tc ;
5938
5937
ch -> seid = ctxt .seid ;
5939
5938
ch -> vsi_number = ctxt .vsi_number ;
5940
- ch -> stat_counter_idx = cpu_to_le16 (ctxt .info .stat_counter_idx );
5939
+ ch -> stat_counter_idx = le16_to_cpu (ctxt .info .stat_counter_idx );
5941
5940
5942
5941
/* copy just the sections touched not the entire info
5943
5942
* since not all sections are valid as returned by
@@ -7977,8 +7976,8 @@ static inline void
7977
7976
i40e_set_cld_element (struct i40e_cloud_filter * filter ,
7978
7977
struct i40e_aqc_cloud_filters_element_data * cld )
7979
7978
{
7980
- int i , j ;
7981
7979
u32 ipa ;
7980
+ int i ;
7982
7981
7983
7982
memset (cld , 0 , sizeof (* cld ));
7984
7983
ether_addr_copy (cld -> outer_mac , filter -> dst_mac );
@@ -7989,14 +7988,14 @@ i40e_set_cld_element(struct i40e_cloud_filter *filter,
7989
7988
7990
7989
if (filter -> n_proto == ETH_P_IPV6 ) {
7991
7990
#define IPV6_MAX_INDEX (ARRAY_SIZE(filter->dst_ipv6) - 1)
7992
- for (i = 0 , j = 0 ; i < ARRAY_SIZE (filter -> dst_ipv6 );
7993
- i ++ , j += 2 ) {
7991
+ for (i = 0 ; i < ARRAY_SIZE (filter -> dst_ipv6 ); i ++ ) {
7994
7992
ipa = be32_to_cpu (filter -> dst_ipv6 [IPV6_MAX_INDEX - i ]);
7995
- ipa = cpu_to_le32 ( ipa );
7996
- memcpy ( & cld -> ipaddr .raw_v6 .data [j ], & ipa , sizeof (ipa ) );
7993
+
7994
+ * ( __le32 * ) & cld -> ipaddr .raw_v6 .data [i * 2 ] = cpu_to_le32 (ipa );
7997
7995
}
7998
7996
} else {
7999
7997
ipa = be32_to_cpu (filter -> dst_ipv4 );
7998
+
8000
7999
memcpy (& cld -> ipaddr .v4 .data , & ipa , sizeof (ipa ));
8001
8000
}
8002
8001
@@ -8044,6 +8043,8 @@ int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
8044
8043
if (filter -> flags >= ARRAY_SIZE (flag_table ))
8045
8044
return I40E_ERR_CONFIG ;
8046
8045
8046
+ memset (& cld_filter , 0 , sizeof (cld_filter ));
8047
+
8047
8048
/* copy element needed to add cloud filter from filter */
8048
8049
i40e_set_cld_element (filter , & cld_filter );
8049
8050
@@ -8107,10 +8108,13 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
8107
8108
return - EOPNOTSUPP ;
8108
8109
8109
8110
/* adding filter using src_port/src_ip is not supported at this stage */
8110
- if (filter -> src_port || filter -> src_ipv4 ||
8111
+ if (filter -> src_port ||
8112
+ (filter -> src_ipv4 && filter -> n_proto != ETH_P_IPV6 ) ||
8111
8113
!ipv6_addr_any (& filter -> ip .v6 .src_ip6 ))
8112
8114
return - EOPNOTSUPP ;
8113
8115
8116
+ memset (& cld_filter , 0 , sizeof (cld_filter ));
8117
+
8114
8118
/* copy element needed to add cloud filter from filter */
8115
8119
i40e_set_cld_element (filter , & cld_filter .element );
8116
8120
@@ -8134,7 +8138,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
8134
8138
cpu_to_le16 (I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT );
8135
8139
}
8136
8140
8137
- } else if (filter -> dst_ipv4 ||
8141
+ } else if (( filter -> dst_ipv4 && filter -> n_proto != ETH_P_IPV6 ) ||
8138
8142
!ipv6_addr_any (& filter -> ip .v6 .dst_ip6 )) {
8139
8143
cld_filter .element .flags =
8140
8144
cpu_to_le16 (I40E_AQC_ADD_CLOUD_FILTER_IP_PORT );
@@ -8928,18 +8932,17 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)
8928
8932
dev_dbg (& pf -> pdev -> dev , "PFR requested\n" );
8929
8933
i40e_handle_reset_warning (pf , lock_acquired );
8930
8934
8931
- dev_info (& pf -> pdev -> dev ,
8932
- pf -> flags & I40E_FLAG_DISABLE_FW_LLDP ?
8933
- "FW LLDP is disabled\n" :
8934
- "FW LLDP is enabled\n" );
8935
-
8936
8935
} else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG ) {
8937
8936
/* Request a PF Reset
8938
8937
*
8939
8938
* Resets PF and reinitializes PFs VSI.
8940
8939
*/
8941
8940
i40e_prep_for_reset (pf );
8942
8941
i40e_reset_and_rebuild (pf , true, lock_acquired );
8942
+ dev_info (& pf -> pdev -> dev ,
8943
+ pf -> flags & I40E_FLAG_DISABLE_FW_LLDP ?
8944
+ "FW LLDP is disabled\n" :
8945
+ "FW LLDP is enabled\n" );
8943
8946
8944
8947
} else if (reset_flags & BIT_ULL (__I40E_REINIT_REQUESTED )) {
8945
8948
int v ;
@@ -10462,7 +10465,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
10462
10465
int old_recovery_mode_bit = test_bit (__I40E_RECOVERY_MODE , pf -> state );
10463
10466
struct i40e_vsi * vsi = pf -> vsi [pf -> lan_vsi ];
10464
10467
struct i40e_hw * hw = & pf -> hw ;
10465
- u8 set_fc_aq_fail = 0 ;
10466
10468
i40e_status ret ;
10467
10469
u32 val ;
10468
10470
int v ;
@@ -10605,13 +10607,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
10605
10607
i40e_stat_str (& pf -> hw , ret ),
10606
10608
i40e_aq_str (& pf -> hw , pf -> hw .aq .asq_last_status ));
10607
10609
10608
- /* make sure our flow control settings are restored */
10609
- ret = i40e_set_fc (& pf -> hw , & set_fc_aq_fail , true);
10610
- if (ret )
10611
- dev_dbg (& pf -> pdev -> dev , "setting flow control: ret = %s last_status = %s\n" ,
10612
- i40e_stat_str (& pf -> hw , ret ),
10613
- i40e_aq_str (& pf -> hw , pf -> hw .aq .asq_last_status ));
10614
-
10615
10610
/* Rebuild the VSIs and VEBs that existed before reset.
10616
10611
* They are still in our local switch element arrays, so only
10617
10612
* need to rebuild the switch model in the HW.
@@ -12191,6 +12186,8 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf)
12191
12186
struct i40e_aqc_configure_partition_bw_data bw_data ;
12192
12187
i40e_status status ;
12193
12188
12189
+ memset (& bw_data , 0 , sizeof (bw_data ));
12190
+
12194
12191
/* Set the valid bit for this PF */
12195
12192
bw_data .pf_valid_bits = cpu_to_le16 (BIT (pf -> hw .pf_id ));
12196
12193
bw_data .max_bw [pf -> hw .pf_id ] = pf -> max_bw & I40E_ALT_BW_VALUE_MASK ;
@@ -15198,7 +15195,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15198
15195
int err ;
15199
15196
u32 val ;
15200
15197
u32 i ;
15201
- u8 set_fc_aq_fail ;
15202
15198
15203
15199
err = pci_enable_device_mem (pdev );
15204
15200
if (err )
@@ -15537,24 +15533,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15537
15533
}
15538
15534
INIT_LIST_HEAD (& pf -> vsi [pf -> lan_vsi ]-> ch_list );
15539
15535
15540
- /* Make sure flow control is set according to current settings */
15541
- err = i40e_set_fc (hw , & set_fc_aq_fail , true);
15542
- if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_GET )
15543
- dev_dbg (& pf -> pdev -> dev ,
15544
- "Set fc with err %s aq_err %s on get_phy_cap\n" ,
15545
- i40e_stat_str (hw , err ),
15546
- i40e_aq_str (hw , hw -> aq .asq_last_status ));
15547
- if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_SET )
15548
- dev_dbg (& pf -> pdev -> dev ,
15549
- "Set fc with err %s aq_err %s on set_phy_config\n" ,
15550
- i40e_stat_str (hw , err ),
15551
- i40e_aq_str (hw , hw -> aq .asq_last_status ));
15552
- if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_UPDATE )
15553
- dev_dbg (& pf -> pdev -> dev ,
15554
- "Set fc with err %s aq_err %s on get_link_info\n" ,
15555
- i40e_stat_str (hw , err ),
15556
- i40e_aq_str (hw , hw -> aq .asq_last_status ));
15557
-
15558
15536
/* if FDIR VSI was set up, start it now */
15559
15537
for (i = 0 ; i < pf -> num_alloc_vsi ; i ++ ) {
15560
15538
if (pf -> vsi [i ] && pf -> vsi [i ]-> type == I40E_VSI_FDIR ) {
@@ -15611,6 +15589,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15611
15589
if (err ) {
15612
15590
dev_info (& pdev -> dev ,
15613
15591
"setup of misc vector failed: %d\n" , err );
15592
+ i40e_cloud_filter_exit (pf );
15593
+ i40e_fdir_teardown (pf );
15614
15594
goto err_vsis ;
15615
15595
}
15616
15596
}
0 commit comments