diff options
author | Ed L. Cashin <ecashin@coraid.com> | 2006-02-07 11:26:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 22:01:56 -0800 |
commit | 5dc401ee74c5d6a24867acd8302c55da9ae4f0ce (patch) | |
tree | 85fbb0a15834b236133c3d068b38fe6058fa57d0 /drivers/block/aoe | |
parent | 1c6f3fcac03a16c901ee5acd58100bff963add6d (diff) | |
download | kernel-crypto-5dc401ee74c5d6a24867acd8302c55da9ae4f0ce.tar.gz kernel-crypto-5dc401ee74c5d6a24867acd8302c55da9ae4f0ce.tar.xz kernel-crypto-5dc401ee74c5d6a24867acd8302c55da9ae4f0ce.zip |
[PATCH] aoe [1/3]: support multiple AoE listeners
Always clone incoming skbs, allowing other AoE listeners
to exist in the kernel.
Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r-- | drivers/block/aoe/aoenet.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index 4be976940f6..fdff774b8ab 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c @@ -92,18 +92,6 @@ mac_addr(char addr[6]) 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 aoenet_xmit(struct sk_buff *sl) { @@ -125,14 +113,14 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct aoe_hdr *h; u32 n; - skb = skb_check(skb); - if (!skb) + skb = skb_share_check(skb, GFP_ATOMIC); + if (skb == NULL) return 0; - + if (skb_is_nonlinear(skb)) + if (skb_linearize(skb, GFP_ATOMIC) < 0) + goto exit; if (!is_aoe_netif(ifp)) goto exit; - - //skb->len += ETH_HLEN; /* (1) */ skb_push(skb, ETH_HLEN); /* (1) */ h = (struct aoe_hdr *) skb->mac.raw; |