diff options
Diffstat (limited to 'drivers/net/ethernet/ibm/ibmveth.c')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmveth.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index fbece63395a8..a831f947ca8c 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -1181,7 +1181,9 @@ map_failed: | |||
1181 | 1181 | ||
1182 | static void ibmveth_rx_mss_helper(struct sk_buff *skb, u16 mss, int lrg_pkt) | 1182 | static void ibmveth_rx_mss_helper(struct sk_buff *skb, u16 mss, int lrg_pkt) |
1183 | { | 1183 | { |
1184 | struct tcphdr *tcph; | ||
1184 | int offset = 0; | 1185 | int offset = 0; |
1186 | int hdr_len; | ||
1185 | 1187 | ||
1186 | /* only TCP packets will be aggregated */ | 1188 | /* only TCP packets will be aggregated */ |
1187 | if (skb->protocol == htons(ETH_P_IP)) { | 1189 | if (skb->protocol == htons(ETH_P_IP)) { |
@@ -1208,14 +1210,20 @@ static void ibmveth_rx_mss_helper(struct sk_buff *skb, u16 mss, int lrg_pkt) | |||
1208 | /* if mss is not set through Large Packet bit/mss in rx buffer, | 1210 | /* if mss is not set through Large Packet bit/mss in rx buffer, |
1209 | * expect that the mss will be written to the tcp header checksum. | 1211 | * expect that the mss will be written to the tcp header checksum. |
1210 | */ | 1212 | */ |
1213 | tcph = (struct tcphdr *)(skb->data + offset); | ||
1211 | if (lrg_pkt) { | 1214 | if (lrg_pkt) { |
1212 | skb_shinfo(skb)->gso_size = mss; | 1215 | skb_shinfo(skb)->gso_size = mss; |
1213 | } else if (offset) { | 1216 | } else if (offset) { |
1214 | struct tcphdr *tcph = (struct tcphdr *)(skb->data + offset); | ||
1215 | |||
1216 | skb_shinfo(skb)->gso_size = ntohs(tcph->check); | 1217 | skb_shinfo(skb)->gso_size = ntohs(tcph->check); |
1217 | tcph->check = 0; | 1218 | tcph->check = 0; |
1218 | } | 1219 | } |
1220 | |||
1221 | if (skb_shinfo(skb)->gso_size) { | ||
1222 | hdr_len = offset + tcph->doff * 4; | ||
1223 | skb_shinfo(skb)->gso_segs = | ||
1224 | DIV_ROUND_UP(skb->len - hdr_len, | ||
1225 | skb_shinfo(skb)->gso_size); | ||
1226 | } | ||
1219 | } | 1227 | } |
1220 | 1228 | ||
1221 | static int ibmveth_poll(struct napi_struct *napi, int budget) | 1229 | static int ibmveth_poll(struct napi_struct *napi, int budget) |