Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341666
b: refs/heads/master
c: 1b4c44e
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Gallatin authored and David S. Miller committed Nov 30, 2012
1 parent 91b959d commit c33672d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ca3221fe4b6c4c6c77352672942e8afa57d55e5
refs/heads/master: 1b4c44e6369dbbafd113f1e00b406f1eda5ab5b2
41 changes: 41 additions & 0 deletions trunk/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,42 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev,
}
}

/*
* GRO does not support acceleration of tagged vlan frames, and
* this NIC does not support vlan tag offload, so we must pop
* the tag ourselves to be able to achieve GRO performance that
* is comparable to LRO.
*/

static inline void
myri10ge_vlan_rx(struct net_device *dev, void *addr, struct sk_buff *skb)
{
u8 *va;
struct vlan_ethhdr *veh;
struct skb_frag_struct *frag;
__wsum vsum;

va = addr;
va += MXGEFW_PAD;
veh = (struct vlan_ethhdr *)va;
if ((dev->features & NETIF_F_HW_VLAN_RX) == NETIF_F_HW_VLAN_RX &&
veh->h_vlan_proto == ntohs(ETH_P_8021Q)) {
/* fixup csum if needed */
if (skb->ip_summed == CHECKSUM_COMPLETE) {
vsum = csum_partial(va + ETH_HLEN, VLAN_HLEN, 0);
skb->csum = csum_sub(skb->csum, vsum);
}
/* pop tag */
__vlan_hwaccel_put_tag(skb, ntohs(veh->h_vlan_TCI));
memmove(va + VLAN_HLEN, va, 2 * ETH_ALEN);
skb->len -= VLAN_HLEN;
skb->data_len -= VLAN_HLEN;
frag = skb_shinfo(skb)->frags;
frag->page_offset += VLAN_HLEN;
skb_frag_size_set(frag, skb_frag_size(frag) - VLAN_HLEN);
}
}

static inline int
myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum)
{
Expand Down Expand Up @@ -1326,6 +1362,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum)
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = csum;
}
myri10ge_vlan_rx(mgp->dev, va, skb);
skb_record_rx_queue(skb, ss - &mgp->ss[0]);

napi_gro_frags(&ss->napi);
Expand Down Expand Up @@ -3851,6 +3888,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->netdev_ops = &myri10ge_netdev_ops;
netdev->mtu = myri10ge_initial_mtu;
netdev->hw_features = mgp->features | NETIF_F_RXCSUM;

/* fake NETIF_F_HW_VLAN_RX for good GRO performance */
netdev->hw_features |= NETIF_F_HW_VLAN_RX;

netdev->features = netdev->hw_features;

if (dac_enabled)
Expand Down

0 comments on commit c33672d

Please sign in to comment.