aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipvlan/ipvlan_core.c
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2016-02-20 22:31:41 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-21 22:43:24 -0500
commitab5b7013db3cc637a8f19e00d71310e40db75bf6 (patch)
treee4843b1960e13c8d184ac91b937e659773304094 /drivers/net/ipvlan/ipvlan_core.c
parente93fbc5a15ff25d4f9fd92a13c33cd37d99a2340 (diff)
ipvlan: misc changes
1. scope correction for few functions that are used in single file. 2. Adjust variables that are used in fast-path to fit into single cacheline 3. Update rcv_frame() to skip shared check for frames coming over wire Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_core.c')
-rw-r--r--drivers/net/ipvlan/ipvlan_core.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 4e60c6bbdb6e..d6d0524ee5fd 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -53,8 +53,8 @@ static u8 ipvlan_get_v4_hash(const void *iaddr)
53 IPVLAN_HASH_MASK; 53 IPVLAN_HASH_MASK;
54} 54}
55 55
56struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port, 56static struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port,
57 const void *iaddr, bool is_v6) 57 const void *iaddr, bool is_v6)
58{ 58{
59 struct ipvl_addr *addr; 59 struct ipvl_addr *addr;
60 u8 hash; 60 u8 hash;
@@ -265,20 +265,25 @@ static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff **pskb,
265 struct sk_buff *skb = *pskb; 265 struct sk_buff *skb = *pskb;
266 266
267 len = skb->len + ETH_HLEN; 267 len = skb->len + ETH_HLEN;
268 if (unlikely(!(dev->flags & IFF_UP))) { 268 /* Only packets exchanged between two local slaves need to have
269 kfree_skb(skb); 269 * device-up check as well as skb-share check.
270 goto out; 270 */
271 } 271 if (local) {
272 if (unlikely(!(dev->flags & IFF_UP))) {
273 kfree_skb(skb);
274 goto out;
275 }
272 276
273 skb = skb_share_check(skb, GFP_ATOMIC); 277 skb = skb_share_check(skb, GFP_ATOMIC);
274 if (!skb) 278 if (!skb)
275 goto out; 279 goto out;
276 280
277 *pskb = skb; 281 *pskb = skb;
282 }
278 skb->dev = dev; 283 skb->dev = dev;
279 skb->pkt_type = PACKET_HOST;
280 284
281 if (local) { 285 if (local) {
286 skb->pkt_type = PACKET_HOST;
282 if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS) 287 if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS)
283 success = true; 288 success = true;
284 } else { 289 } else {