File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed
drivers/net/ethernet/aquantia/atlantic Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,9 @@ struct aq_hw_ops {
204
204
205
205
int (* hw_get_fw_version )(struct aq_hw_s * self , u32 * fw_version );
206
206
207
+ int (* hw_set_offload )(struct aq_hw_s * self ,
208
+ struct aq_nic_cfg_s * aq_nic_cfg );
209
+
207
210
int (* hw_set_fc )(struct aq_hw_s * self , u32 fc , u32 tc );
208
211
};
209
212
Original file line number Diff line number Diff line change @@ -99,8 +99,11 @@ static int aq_ndev_set_features(struct net_device *ndev,
99
99
struct aq_nic_s * aq_nic = netdev_priv (ndev );
100
100
struct aq_nic_cfg_s * aq_cfg = aq_nic_get_cfg (aq_nic );
101
101
bool is_lro = false;
102
+ int err = 0 ;
103
+
104
+ aq_cfg -> features = features ;
102
105
103
- if (aq_cfg -> hw_features & NETIF_F_LRO ) {
106
+ if (aq_cfg -> aq_hw_caps -> hw_features & NETIF_F_LRO ) {
104
107
is_lro = features & NETIF_F_LRO ;
105
108
106
109
if (aq_cfg -> is_lro != is_lro ) {
@@ -112,8 +115,11 @@ static int aq_ndev_set_features(struct net_device *ndev,
112
115
}
113
116
}
114
117
}
118
+ if ((aq_nic -> ndev -> features ^ features ) & NETIF_F_RXCSUM )
119
+ err = aq_nic -> aq_hw_ops -> hw_set_offload (aq_nic -> aq_hw ,
120
+ aq_cfg );
115
121
116
- return 0 ;
122
+ return err ;
117
123
}
118
124
119
125
static int aq_ndev_set_mac_address (struct net_device * ndev , void * addr )
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ void aq_nic_cfg_start(struct aq_nic_s *self)
118
118
}
119
119
120
120
cfg -> link_speed_msk &= cfg -> aq_hw_caps -> link_speed_msk ;
121
- cfg -> hw_features = cfg -> aq_hw_caps -> hw_features ;
121
+ cfg -> features = cfg -> aq_hw_caps -> hw_features ;
122
122
}
123
123
124
124
static int aq_nic_update_link_status (struct aq_nic_s * self )
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ struct aq_vec_s;
23
23
24
24
struct aq_nic_cfg_s {
25
25
const struct aq_hw_caps_s * aq_hw_caps ;
26
- u64 hw_features ;
26
+ u64 features ;
27
27
u32 rxds ; /* rx ring size, descriptors # */
28
28
u32 txds ; /* tx ring size, descriptors # */
29
29
u32 vecs ; /* vecs==allocated irqs */
Original file line number Diff line number Diff line change @@ -234,8 +234,10 @@ static int hw_atl_b0_hw_offload_set(struct aq_hw_s *self,
234
234
hw_atl_tpo_tcp_udp_crc_offload_en_set (self , 1 );
235
235
236
236
/* RX checksums offloads*/
237
- hw_atl_rpo_ipv4header_crc_offload_en_set (self , 1 );
238
- hw_atl_rpo_tcp_udp_crc_offload_en_set (self , 1 );
237
+ hw_atl_rpo_ipv4header_crc_offload_en_set (self , !!(aq_nic_cfg -> features &
238
+ NETIF_F_RXCSUM ));
239
+ hw_atl_rpo_tcp_udp_crc_offload_en_set (self , !!(aq_nic_cfg -> features &
240
+ NETIF_F_RXCSUM ));
239
241
240
242
/* LSO offloads*/
241
243
hw_atl_tdm_large_send_offload_en_set (self , 0xFFFFFFFFU );
@@ -974,5 +976,6 @@ const struct aq_hw_ops hw_atl_ops_b0 = {
974
976
.hw_get_regs = hw_atl_utils_hw_get_regs ,
975
977
.hw_get_hw_stats = hw_atl_utils_get_hw_stats ,
976
978
.hw_get_fw_version = hw_atl_utils_get_fw_version ,
979
+ .hw_set_offload = hw_atl_b0_hw_offload_set ,
977
980
.hw_set_fc = hw_atl_b0_set_fc ,
978
981
};
You can’t perform that action at this time.
0 commit comments