Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299978
b: refs/heads/master
c: e072b3f
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed May 1, 2012
1 parent 2d2304e commit e0944ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f42941b5d1d13542b1a755a9e4f633aa72e4d3e
refs/heads/master: e072b3fad5f3915102c94628b4971f52ff99dd05
28 changes: 17 additions & 11 deletions trunk/drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2495,9 +2495,11 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
skb->ip_summed = re->skb->ip_summed;
skb->csum = re->skb->csum;
skb->rxhash = re->skb->rxhash;
skb->vlan_tci = re->skb->vlan_tci;

pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
length, PCI_DMA_FROMDEVICE);
re->skb->vlan_tci = 0;
re->skb->rxhash = 0;
re->skb->ip_summed = CHECKSUM_NONE;
skb_put(skb, length);
Expand Down Expand Up @@ -2583,16 +2585,16 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
struct sk_buff *skb = NULL;
u16 count = (status & GMR_FS_LEN) >> 16;

if (status & GMR_FS_VLAN)
count -= VLAN_HLEN; /* Account for vlan tag */

netif_printk(sky2, rx_status, KERN_DEBUG, dev,
"rx slot %u status 0x%x len %d\n",
sky2->rx_next, status, length);

sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
prefetch(sky2->rx_ring + sky2->rx_next);

if (vlan_tx_tag_present(re->skb))
count -= VLAN_HLEN; /* Account for vlan tag */

/* This chip has hardware problems that generates bogus status.
* So do only marginal checking and expect higher level protocols
* to handle crap frames.
Expand Down Expand Up @@ -2650,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
}

static inline void sky2_skb_rx(const struct sky2_port *sky2,
u32 status, struct sk_buff *skb)
struct sk_buff *skb)
{
if (status & GMR_FS_VLAN)
__vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));

if (skb->ip_summed == CHECKSUM_NONE)
netif_receive_skb(skb);
else
Expand Down Expand Up @@ -2708,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status)
}
}

static void sky2_rx_tag(struct sky2_port *sky2, u16 length)
{
struct sk_buff *skb;

skb = sky2->rx_ring[sky2->rx_next].skb;
__vlan_hwaccel_put_tag(skb, be16_to_cpu(length));
}

static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
{
struct sk_buff *skb;
Expand Down Expand Up @@ -2766,20 +2773,19 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
}

skb->protocol = eth_type_trans(skb, dev);

sky2_skb_rx(sky2, status, skb);
sky2_skb_rx(sky2, skb);

/* Stop after net poll weight */
if (++work_done >= to_do)
goto exit_loop;
break;

case OP_RXVLAN:
sky2->rx_tag = length;
sky2_rx_tag(sky2, length);
break;

case OP_RXCHKSVLAN:
sky2->rx_tag = length;
sky2_rx_tag(sky2, length);
/* fall through */
case OP_RXCHKS:
if (likely(dev->features & NETIF_F_RXCSUM))
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/marvell/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2241,7 +2241,6 @@ struct sky2_port {
u16 rx_pending;
u16 rx_data_size;
u16 rx_nfrags;
u16 rx_tag;

struct {
unsigned long last;
Expand Down

0 comments on commit e0944ad

Please sign in to comment.