Commit 5dc401ee authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Greg Kroah-Hartman

[PATCH] aoe [1/3]: support multiple AoE listeners

Always clone incoming skbs, allowing other AoE listeners
to exist in the kernel.
Signed-off-by: default avatar"Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1c6f3fca
...@@ -92,18 +92,6 @@ mac_addr(char addr[6]) ...@@ -92,18 +92,6 @@ mac_addr(char addr[6])
return __be64_to_cpu(n); return __be64_to_cpu(n);
} }
static struct sk_buff *
skb_check(struct sk_buff *skb)
{
if (skb_is_nonlinear(skb))
if ((skb = skb_share_check(skb, GFP_ATOMIC)))
if (skb_linearize(skb, GFP_ATOMIC) < 0) {
dev_kfree_skb(skb);
return NULL;
}
return skb;
}
void void
aoenet_xmit(struct sk_buff *sl) aoenet_xmit(struct sk_buff *sl)
{ {
...@@ -125,14 +113,14 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, ...@@ -125,14 +113,14 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
struct aoe_hdr *h; struct aoe_hdr *h;
u32 n; u32 n;
skb = skb_check(skb); skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb) if (skb == NULL)
return 0; return 0;
if (skb_is_nonlinear(skb))
if (skb_linearize(skb, GFP_ATOMIC) < 0)
goto exit;
if (!is_aoe_netif(ifp)) if (!is_aoe_netif(ifp))
goto exit; goto exit;
//skb->len += ETH_HLEN; /* (1) */
skb_push(skb, ETH_HLEN); /* (1) */ skb_push(skb, ETH_HLEN); /* (1) */
h = (struct aoe_hdr *) skb->mac.raw; h = (struct aoe_hdr *) skb->mac.raw;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment