aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-03-11 22:14:39 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 15:53:54 -0400
commit8a4eb5734e8d1dc60a8c28576bbbdfdcc643626d (patch)
treeed4cd2f9a2a04a30994a8f8964a81834c895c0c9 /drivers/net/macvlan.c
parent2d7011ca79f1a8792e04d131b8ea21db179ab917 (diff)
net: introduce rx_handler results and logic around that
This patch allows rx_handlers to better signalize what to do next to it's caller. That makes skb->deliver_no_wcard no longer needed. kernel-doc for rx_handler_result is taken from Nicolas' patch. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 497991bd3b64..5b37d3c191e4 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -152,9 +152,10 @@ static void macvlan_broadcast(struct sk_buff *skb,
152} 152}
153 153
154/* called under rcu_read_lock() from netif_receive_skb */ 154/* called under rcu_read_lock() from netif_receive_skb */
155static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb) 155static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
156{ 156{
157 struct macvlan_port *port; 157 struct macvlan_port *port;
158 struct sk_buff *skb = *pskb;
158 const struct ethhdr *eth = eth_hdr(skb); 159 const struct ethhdr *eth = eth_hdr(skb);
159 const struct macvlan_dev *vlan; 160 const struct macvlan_dev *vlan;
160 const struct macvlan_dev *src; 161 const struct macvlan_dev *src;
@@ -184,7 +185,7 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
184 */ 185 */
185 macvlan_broadcast(skb, port, src->dev, 186 macvlan_broadcast(skb, port, src->dev,
186 MACVLAN_MODE_VEPA); 187 MACVLAN_MODE_VEPA);
187 return skb; 188 return RX_HANDLER_PASS;
188 } 189 }
189 190
190 if (port->passthru) 191 if (port->passthru)
@@ -192,12 +193,12 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
192 else 193 else
193 vlan = macvlan_hash_lookup(port, eth->h_dest); 194 vlan = macvlan_hash_lookup(port, eth->h_dest);
194 if (vlan == NULL) 195 if (vlan == NULL)
195 return skb; 196 return RX_HANDLER_PASS;
196 197
197 dev = vlan->dev; 198 dev = vlan->dev;
198 if (unlikely(!(dev->flags & IFF_UP))) { 199 if (unlikely(!(dev->flags & IFF_UP))) {
199 kfree_skb(skb); 200 kfree_skb(skb);
200 return NULL; 201 return RX_HANDLER_CONSUMED;
201 } 202 }
202 len = skb->len + ETH_HLEN; 203 len = skb->len + ETH_HLEN;
203 skb = skb_share_check(skb, GFP_ATOMIC); 204 skb = skb_share_check(skb, GFP_ATOMIC);
@@ -211,7 +212,7 @@ static struct sk_buff *macvlan_handle_frame(struct sk_buff *skb)
211 212
212out: 213out:
213 macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0); 214 macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0);
214 return NULL; 215 return RX_HANDLER_CONSUMED;
215} 216}
216 217
217static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) 218static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)