diff options
Diffstat (limited to 'drivers/net/igbvf')
-rw-r--r-- | drivers/net/igbvf/ethtool.c | 36 | ||||
-rw-r--r-- | drivers/net/igbvf/igbvf.h | 6 | ||||
-rw-r--r-- | drivers/net/igbvf/netdev.c | 23 |
3 files changed, 28 insertions, 37 deletions
diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c index 1dcaa6905312..ee17a097d1ca 100644 --- a/drivers/net/igbvf/ethtool.c +++ b/drivers/net/igbvf/ethtool.c | |||
@@ -133,6 +133,24 @@ static int igbvf_set_pauseparam(struct net_device *netdev, | |||
133 | return -EOPNOTSUPP; | 133 | return -EOPNOTSUPP; |
134 | } | 134 | } |
135 | 135 | ||
136 | static u32 igbvf_get_rx_csum(struct net_device *netdev) | ||
137 | { | ||
138 | struct igbvf_adapter *adapter = netdev_priv(netdev); | ||
139 | return !(adapter->flags & IGBVF_FLAG_RX_CSUM_DISABLED); | ||
140 | } | ||
141 | |||
142 | static int igbvf_set_rx_csum(struct net_device *netdev, u32 data) | ||
143 | { | ||
144 | struct igbvf_adapter *adapter = netdev_priv(netdev); | ||
145 | |||
146 | if (data) | ||
147 | adapter->flags &= ~IGBVF_FLAG_RX_CSUM_DISABLED; | ||
148 | else | ||
149 | adapter->flags |= IGBVF_FLAG_RX_CSUM_DISABLED; | ||
150 | |||
151 | return 0; | ||
152 | } | ||
153 | |||
136 | static u32 igbvf_get_tx_csum(struct net_device *netdev) | 154 | static u32 igbvf_get_tx_csum(struct net_device *netdev) |
137 | { | 155 | { |
138 | return ((netdev->features & NETIF_F_IP_CSUM) != 0); | 156 | return ((netdev->features & NETIF_F_IP_CSUM) != 0); |
@@ -150,8 +168,6 @@ static int igbvf_set_tx_csum(struct net_device *netdev, u32 data) | |||
150 | static int igbvf_set_tso(struct net_device *netdev, u32 data) | 168 | static int igbvf_set_tso(struct net_device *netdev, u32 data) |
151 | { | 169 | { |
152 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 170 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
153 | int i; | ||
154 | struct net_device *v_netdev; | ||
155 | 171 | ||
156 | if (data) { | 172 | if (data) { |
157 | netdev->features |= NETIF_F_TSO; | 173 | netdev->features |= NETIF_F_TSO; |
@@ -159,24 +175,10 @@ static int igbvf_set_tso(struct net_device *netdev, u32 data) | |||
159 | } else { | 175 | } else { |
160 | netdev->features &= ~NETIF_F_TSO; | 176 | netdev->features &= ~NETIF_F_TSO; |
161 | netdev->features &= ~NETIF_F_TSO6; | 177 | netdev->features &= ~NETIF_F_TSO6; |
162 | /* disable TSO on all VLANs if they're present */ | ||
163 | if (!adapter->vlgrp) | ||
164 | goto tso_out; | ||
165 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | ||
166 | v_netdev = vlan_group_get_device(adapter->vlgrp, i); | ||
167 | if (!v_netdev) | ||
168 | continue; | ||
169 | |||
170 | v_netdev->features &= ~NETIF_F_TSO; | ||
171 | v_netdev->features &= ~NETIF_F_TSO6; | ||
172 | vlan_group_set_device(adapter->vlgrp, i, v_netdev); | ||
173 | } | ||
174 | } | 178 | } |
175 | 179 | ||
176 | tso_out: | ||
177 | dev_info(&adapter->pdev->dev, "TSO is %s\n", | 180 | dev_info(&adapter->pdev->dev, "TSO is %s\n", |
178 | data ? "Enabled" : "Disabled"); | 181 | data ? "Enabled" : "Disabled"); |
179 | adapter->flags |= FLAG_TSO_FORCE; | ||
180 | return 0; | 182 | return 0; |
181 | } | 183 | } |
182 | 184 | ||
@@ -517,6 +519,8 @@ static const struct ethtool_ops igbvf_ethtool_ops = { | |||
517 | .set_ringparam = igbvf_set_ringparam, | 519 | .set_ringparam = igbvf_set_ringparam, |
518 | .get_pauseparam = igbvf_get_pauseparam, | 520 | .get_pauseparam = igbvf_get_pauseparam, |
519 | .set_pauseparam = igbvf_set_pauseparam, | 521 | .set_pauseparam = igbvf_set_pauseparam, |
522 | .get_rx_csum = igbvf_get_rx_csum, | ||
523 | .set_rx_csum = igbvf_set_rx_csum, | ||
520 | .get_tx_csum = igbvf_get_tx_csum, | 524 | .get_tx_csum = igbvf_get_tx_csum, |
521 | .set_tx_csum = igbvf_set_tx_csum, | 525 | .set_tx_csum = igbvf_set_tx_csum, |
522 | .get_sg = ethtool_op_get_sg, | 526 | .get_sg = ethtool_op_get_sg, |
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h index d488733893a6..8e9b67ebbf8b 100644 --- a/drivers/net/igbvf/igbvf.h +++ b/drivers/net/igbvf/igbvf.h | |||
@@ -286,11 +286,7 @@ struct igbvf_info { | |||
286 | }; | 286 | }; |
287 | 287 | ||
288 | /* hardware capability, feature, and workaround flags */ | 288 | /* hardware capability, feature, and workaround flags */ |
289 | #define FLAG_HAS_HW_VLAN_FILTER (1 << 0) | 289 | #define IGBVF_FLAG_RX_CSUM_DISABLED (1 << 0) |
290 | #define FLAG_HAS_JUMBO_FRAMES (1 << 1) | ||
291 | #define FLAG_MSI_ENABLED (1 << 2) | ||
292 | #define FLAG_RX_CSUM_ENABLED (1 << 3) | ||
293 | #define FLAG_TSO_FORCE (1 << 4) | ||
294 | 290 | ||
295 | #define IGBVF_RX_DESC_ADV(R, i) \ | 291 | #define IGBVF_RX_DESC_ADV(R, i) \ |
296 | (&((((R).desc))[i].rx_desc)) | 292 | (&((((R).desc))[i].rx_desc)) |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index b774666ad3cf..22aadb7884fa 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -58,8 +58,7 @@ static void igbvf_reset_interrupt_capability(struct igbvf_adapter *); | |||
58 | 58 | ||
59 | static struct igbvf_info igbvf_vf_info = { | 59 | static struct igbvf_info igbvf_vf_info = { |
60 | .mac = e1000_vfadapt, | 60 | .mac = e1000_vfadapt, |
61 | .flags = FLAG_HAS_JUMBO_FRAMES | 61 | .flags = 0, |
62 | | FLAG_RX_CSUM_ENABLED, | ||
63 | .pba = 10, | 62 | .pba = 10, |
64 | .init_ops = e1000_init_function_pointers_vf, | 63 | .init_ops = e1000_init_function_pointers_vf, |
65 | }; | 64 | }; |
@@ -107,8 +106,10 @@ static inline void igbvf_rx_checksum_adv(struct igbvf_adapter *adapter, | |||
107 | skb->ip_summed = CHECKSUM_NONE; | 106 | skb->ip_summed = CHECKSUM_NONE; |
108 | 107 | ||
109 | /* Ignore Checksum bit is set or checksum is disabled through ethtool */ | 108 | /* Ignore Checksum bit is set or checksum is disabled through ethtool */ |
110 | if ((status_err & E1000_RXD_STAT_IXSM)) | 109 | if ((status_err & E1000_RXD_STAT_IXSM) || |
110 | (adapter->flags & IGBVF_FLAG_RX_CSUM_DISABLED)) | ||
111 | return; | 111 | return; |
112 | |||
112 | /* TCP/UDP checksum error bit is set */ | 113 | /* TCP/UDP checksum error bit is set */ |
113 | if (status_err & | 114 | if (status_err & |
114 | (E1000_RXDEXT_STATERR_TCPE | E1000_RXDEXT_STATERR_IPE)) { | 115 | (E1000_RXDEXT_STATERR_TCPE | E1000_RXDEXT_STATERR_IPE)) { |
@@ -116,6 +117,7 @@ static inline void igbvf_rx_checksum_adv(struct igbvf_adapter *adapter, | |||
116 | adapter->hw_csum_err++; | 117 | adapter->hw_csum_err++; |
117 | return; | 118 | return; |
118 | } | 119 | } |
120 | |||
119 | /* It must be a TCP or UDP packet with a valid checksum */ | 121 | /* It must be a TCP or UDP packet with a valid checksum */ |
120 | if (status_err & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) | 122 | if (status_err & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) |
121 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 123 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -2117,8 +2119,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter, | |||
2117 | /* set time_stamp *before* dma to help avoid a possible race */ | 2119 | /* set time_stamp *before* dma to help avoid a possible race */ |
2118 | buffer_info->time_stamp = jiffies; | 2120 | buffer_info->time_stamp = jiffies; |
2119 | buffer_info->next_to_watch = i; | 2121 | buffer_info->next_to_watch = i; |
2120 | buffer_info->dma = map[count]; | 2122 | buffer_info->dma = skb_shinfo(skb)->dma_head; |
2121 | count++; | ||
2122 | 2123 | ||
2123 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { | 2124 | for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) { |
2124 | struct skb_frag_struct *frag; | 2125 | struct skb_frag_struct *frag; |
@@ -2142,7 +2143,7 @@ static inline int igbvf_tx_map_adv(struct igbvf_adapter *adapter, | |||
2142 | tx_ring->buffer_info[i].skb = skb; | 2143 | tx_ring->buffer_info[i].skb = skb; |
2143 | tx_ring->buffer_info[first].next_to_watch = i; | 2144 | tx_ring->buffer_info[first].next_to_watch = i; |
2144 | 2145 | ||
2145 | return count; | 2146 | return count + 1; |
2146 | } | 2147 | } |
2147 | 2148 | ||
2148 | static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, | 2149 | static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, |
@@ -2268,7 +2269,6 @@ static int igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | |||
2268 | if (count) { | 2269 | if (count) { |
2269 | igbvf_tx_queue_adv(adapter, tx_ring, tx_flags, count, | 2270 | igbvf_tx_queue_adv(adapter, tx_ring, tx_flags, count, |
2270 | skb->len, hdr_len); | 2271 | skb->len, hdr_len); |
2271 | netdev->trans_start = jiffies; | ||
2272 | /* Make sure there is space in the ring for the next send. */ | 2272 | /* Make sure there is space in the ring for the next send. */ |
2273 | igbvf_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 4); | 2273 | igbvf_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 4); |
2274 | } else { | 2274 | } else { |
@@ -2351,15 +2351,6 @@ static int igbvf_change_mtu(struct net_device *netdev, int new_mtu) | |||
2351 | return -EINVAL; | 2351 | return -EINVAL; |
2352 | } | 2352 | } |
2353 | 2353 | ||
2354 | /* Jumbo frame size limits */ | ||
2355 | if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) { | ||
2356 | if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) { | ||
2357 | dev_err(&adapter->pdev->dev, | ||
2358 | "Jumbo Frames not supported.\n"); | ||
2359 | return -EINVAL; | ||
2360 | } | ||
2361 | } | ||
2362 | |||
2363 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 | 2354 | #define MAX_STD_JUMBO_FRAME_SIZE 9234 |
2364 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { | 2355 | if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { |
2365 | dev_err(&adapter->pdev->dev, "MTU > 9216 not supported.\n"); | 2356 | dev_err(&adapter->pdev->dev, "MTU > 9216 not supported.\n"); |