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-24 01:01:56 -0500 |
commit | 5dc401ee74c5d6a24867acd8302c55da9ae4f0ce (patch) | |
tree | 85fbb0a15834b236133c3d068b38fe6058fa57d0 /drivers/block | |
parent | 1c6f3fcac03a16c901ee5acd58100bff963add6d (diff) |
[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')
-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 4be976940f69..fdff774b8ab9 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
@@ -92,18 +92,6 @@ mac_addr(char addr[6]) | |||
92 | return __be64_to_cpu(n); | 92 | return __be64_to_cpu(n); |
93 | } | 93 | } |
94 | 94 | ||
95 | static struct sk_buff * | ||
96 | skb_check(struct sk_buff *skb) | ||
97 | { | ||
98 | if (skb_is_nonlinear(skb)) | ||
99 | if ((skb = skb_share_check(skb, GFP_ATOMIC))) | ||
100 | if (skb_linearize(skb, GFP_ATOMIC) < 0) { | ||
101 | dev_kfree_skb(skb); | ||
102 | return NULL; | ||
103 | } | ||
104 | return skb; | ||
105 | } | ||
106 | |||
107 | void | 95 | void |
108 | aoenet_xmit(struct sk_buff *sl) | 96 | aoenet_xmit(struct sk_buff *sl) |
109 | { | 97 | { |
@@ -125,14 +113,14 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, | |||
125 | struct aoe_hdr *h; | 113 | struct aoe_hdr *h; |
126 | u32 n; | 114 | u32 n; |
127 | 115 | ||
128 | skb = skb_check(skb); | 116 | skb = skb_share_check(skb, GFP_ATOMIC); |
129 | if (!skb) | 117 | if (skb == NULL) |
130 | return 0; | 118 | return 0; |
131 | 119 | if (skb_is_nonlinear(skb)) | |
120 | if (skb_linearize(skb, GFP_ATOMIC) < 0) | ||
121 | goto exit; | ||
132 | if (!is_aoe_netif(ifp)) | 122 | if (!is_aoe_netif(ifp)) |
133 | goto exit; | 123 | goto exit; |
134 | |||
135 | //skb->len += ETH_HLEN; /* (1) */ | ||
136 | skb_push(skb, ETH_HLEN); /* (1) */ | 124 | skb_push(skb, ETH_HLEN); /* (1) */ |
137 | 125 | ||
138 | h = (struct aoe_hdr *) skb->mac.raw; | 126 | h = (struct aoe_hdr *) skb->mac.raw; |