diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-07-20 08:54:16 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-22 00:47:54 +0400 |
commit | 87737663d5d7668c8553c572a5a7c26e86c5842b (patch) | |
tree | 9a8f3d1c26ace7787364b8a681f7b4c4eed97775 /drivers/net/cxgb4vf/sge.c | |
parent | 133b08513a99d44d9ed916bb83e46343f6ad2855 (diff) | |
download | linux-87737663d5d7668c8553c572a5a7c26e86c5842b.tar.xz |
cxgb4vf: do vlan cleanup
- unify vlan and nonvlan rx path
- kill pi->vlan_grp and cxgb4vf_vlan_rx_register
- allow to turn on/off rx/tx vlan accel via ethtool (set_features)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4vf/sge.c')
-rw-r--r-- | drivers/net/cxgb4vf/sge.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c index 5fd75fdaa631..cffb328c46c3 100644 --- a/drivers/net/cxgb4vf/sge.c +++ b/drivers/net/cxgb4vf/sge.c @@ -1491,20 +1491,10 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, skb->ip_summed = CHECKSUM_UNNECESSARY; skb_record_rx_queue(skb, rxq->rspq.idx); - if (unlikely(pkt->vlan_ex)) { - struct port_info *pi = netdev_priv(rxq->rspq.netdev); - struct vlan_group *grp = pi->vlan_grp; - - rxq->stats.vlan_ex++; - if (likely(grp)) { - ret = vlan_gro_frags(&rxq->rspq.napi, grp, - be16_to_cpu(pkt->vlan)); - goto stats; - } - } + if (pkt->vlan_ex) + __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan)); ret = napi_gro_frags(&rxq->rspq.napi); -stats: if (ret == GRO_HELD) rxq->stats.lro_pkts++; else if (ret == GRO_MERGED || ret == GRO_MERGED_FREE) @@ -1525,7 +1515,6 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, const struct pkt_gl *gl) { struct sk_buff *skb; - struct port_info *pi; const struct cpl_rx_pkt *pkt = (void *)&rsp[1]; bool csum_ok = pkt->csum_calc && !pkt->err_vec; struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq); @@ -1553,7 +1542,6 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, __skb_pull(skb, PKTSHIFT); skb->protocol = eth_type_trans(skb, rspq->netdev); skb_record_rx_queue(skb, rspq->idx); - pi = netdev_priv(skb->dev); rxq->stats.pkts++; if (csum_ok && (rspq->netdev->features & NETIF_F_RXCSUM) && @@ -1569,20 +1557,12 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, } else skb_checksum_none_assert(skb); - /* - * Deliver the packet to the stack. - */ - if (unlikely(pkt->vlan_ex)) { - struct vlan_group *grp = pi->vlan_grp; - + if (pkt->vlan_ex) { rxq->stats.vlan_ex++; - if (likely(grp)) - vlan_hwaccel_receive_skb(skb, grp, - be16_to_cpu(pkt->vlan)); - else - dev_kfree_skb_any(skb); - } else - netif_receive_skb(skb); + __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan)); + } + + netif_receive_skb(skb); return 0; } |