aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-29 04:39:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-29 04:39:41 -0400
commit4099e01224e2afcaeea439cd92db3e7cf6e0f84f (patch)
treecb733ec9ab8eff25ccf1f231644ce190a92122a1 /drivers
parent129dd9677b30a07bb832247dfe8d6089f1ac61a0 (diff)
niu: Add GRO support.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/niu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 50c11126a3db..02c37e2f08a9 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3441,7 +3441,8 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
3441 return num_rcr; 3441 return num_rcr;
3442} 3442}
3443 3443
3444static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp) 3444static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
3445 struct rx_ring_info *rp)
3445{ 3446{
3446 unsigned int index = rp->rcr_index; 3447 unsigned int index = rp->rcr_index;
3447 struct sk_buff *skb; 3448 struct sk_buff *skb;
@@ -3518,7 +3519,7 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
3518 3519
3519 skb->protocol = eth_type_trans(skb, np->dev); 3520 skb->protocol = eth_type_trans(skb, np->dev);
3520 skb_record_rx_queue(skb, rp->rx_channel); 3521 skb_record_rx_queue(skb, rp->rx_channel);
3521 netif_receive_skb(skb); 3522 napi_gro_receive(napi, skb);
3522 3523
3523 return num_rcr; 3524 return num_rcr;
3524} 3525}
@@ -3706,7 +3707,8 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
3706 } 3707 }
3707} 3708}
3708 3709
3709static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget) 3710static int niu_rx_work(struct napi_struct *napi, struct niu *np,
3711 struct rx_ring_info *rp, int budget)
3710{ 3712{
3711 int qlen, rcr_done = 0, work_done = 0; 3713 int qlen, rcr_done = 0, work_done = 0;
3712 struct rxdma_mailbox *mbox = rp->mbox; 3714 struct rxdma_mailbox *mbox = rp->mbox;
@@ -3728,7 +3730,7 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget)
3728 rcr_done = work_done = 0; 3730 rcr_done = work_done = 0;
3729 qlen = min(qlen, budget); 3731 qlen = min(qlen, budget);
3730 while (work_done < qlen) { 3732 while (work_done < qlen) {
3731 rcr_done += niu_process_rx_pkt(np, rp); 3733 rcr_done += niu_process_rx_pkt(napi, np, rp);
3732 work_done++; 3734 work_done++;
3733 } 3735 }
3734 3736
@@ -3776,7 +3778,7 @@ static int niu_poll_core(struct niu *np, struct niu_ldg *lp, int budget)
3776 if (rx_vec & (1 << rp->rx_channel)) { 3778 if (rx_vec & (1 << rp->rx_channel)) {
3777 int this_work_done; 3779 int this_work_done;
3778 3780
3779 this_work_done = niu_rx_work(np, rp, 3781 this_work_done = niu_rx_work(&lp->napi, np, rp,
3780 budget); 3782 budget);
3781 3783
3782 budget -= this_work_done; 3784 budget -= this_work_done;