From patchwork Tue Feb 14 21:20:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Figg X-Patchwork-Id: 141201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id C98EDB6FE0 for ; Wed, 15 Feb 2012 08:20:24 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RxPnO-00064P-3f; Tue, 14 Feb 2012 21:20:18 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RxPnL-00063t-BO for kernel-team@lists.ubuntu.com; Tue, 14 Feb 2012 21:20:15 +0000 Received: from static-50-53-107-235.bvtn.or.frontiernet.net ([50.53.107.235] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RxPnK-0007tk-Qw for kernel-team@lists.ubuntu.com; Tue, 14 Feb 2012 21:20:15 +0000 From: Brad Figg To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/3] be2net: move to new vlan model Date: Tue, 14 Feb 2012 13:20:06 -0800 Message-Id: <1329254408-22456-2-git-send-email-brad.figg@canonical.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1329254408-22456-1-git-send-email-brad.figg@canonical.com> References: <1329254408-22456-1-git-send-email-brad.figg@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Ajit Khaparde CVE-CVE-2011-3347 BugLink: http://bugs.launchpad.net/bugs/880893 Signed-off-by: Ajit Khaparde Signed-off-by: David S. Miller (cherry picked from commit 4c5102f94c175d81790a3a288e85efd4a8a1649a) Signed-off-by: Brad Figg --- drivers/net/benet/be.h | 1 - drivers/net/benet/be_main.c | 34 +++++++++------------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index a7db870..5112000 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h @@ -332,7 +332,6 @@ struct be_adapter { u8 eq_next_idx; struct be_drv_stats drv_stats; - struct vlan_group *vlan_grp; u16 vlans_added; u16 max_vlans; /* Number of vlans supported */ u8 vlan_tag[VLAN_N_VID]; diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index a485f7f..146e420 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c @@ -648,7 +648,7 @@ static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr, AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1); } - if (adapter->vlan_grp && vlan_tx_tag_present(skb)) { + if (vlan_tx_tag_present(skb)) { AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1); vlan_tag = vlan_tx_tag_get(skb); vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; @@ -842,13 +842,6 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num) return status; } -static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp) -{ - struct be_adapter *adapter = netdev_priv(netdev); - - adapter->vlan_grp = grp; -} - static void be_vlan_add_vid(struct net_device *netdev, u16 vid) { struct be_adapter *adapter = netdev_priv(netdev); @@ -867,7 +860,6 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) struct be_adapter *adapter = netdev_priv(netdev); adapter->vlans_added--; - vlan_group_set_device(adapter->vlan_grp, vid, NULL); if (!be_physfn(adapter)) return; @@ -1196,16 +1188,10 @@ static void be_rx_compl_process(struct be_adapter *adapter, skb->rxhash = rxcp->rss_hash; - if (unlikely(rxcp->vlanf)) { - if (!adapter->vlan_grp || adapter->vlans_added == 0) { - kfree_skb(skb); - return; - } - vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, - rxcp->vlan_tag); - } else { - netif_receive_skb(skb); - } + if (unlikely(rxcp->vlanf)) + __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); + + netif_receive_skb(skb); } /* Process the RX completion indicated by rxcp when GRO is enabled */ @@ -1259,11 +1245,10 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, if (adapter->netdev->features & NETIF_F_RXHASH) skb->rxhash = rxcp->rss_hash; - if (likely(!rxcp->vlanf)) - napi_gro_frags(&eq_obj->napi); - else - vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, - rxcp->vlan_tag); + if (unlikely(rxcp->vlanf)) + __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag); + + napi_gro_frags(&eq_obj->napi); } static void be_parse_rx_compl_v1(struct be_adapter *adapter, @@ -2901,7 +2886,6 @@ static struct net_device_ops be_netdev_ops = { .ndo_set_mac_address = be_mac_addr_set, .ndo_change_mtu = be_change_mtu, .ndo_validate_addr = eth_validate_addr, - .ndo_vlan_rx_register = be_vlan_register, .ndo_vlan_rx_add_vid = be_vlan_add_vid, .ndo_vlan_rx_kill_vid = be_vlan_rem_vid, .ndo_set_vf_mac = be_set_vf_mac,