Lines Matching refs:skb
22 const struct sk_buff *skb) in should_deliver() argument
27 return ((p->flags & BR_HAIRPIN_MODE) || skb->dev != p->dev) && in should_deliver()
28 p->state == BR_STATE_FORWARDING && br_allowed_egress(vg, skb) && in should_deliver()
29 nbp_switchdev_allowed_egress(p, skb) && in should_deliver()
30 !br_skb_isolated(p, skb); in should_deliver()
33 int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb) in br_dev_queue_push_xmit() argument
35 skb_push(skb, ETH_HLEN); in br_dev_queue_push_xmit()
36 if (!is_skb_forwardable(skb->dev, skb)) in br_dev_queue_push_xmit()
39 br_drop_fake_rtable(skb); in br_dev_queue_push_xmit()
41 if (skb->ip_summed == CHECKSUM_PARTIAL && in br_dev_queue_push_xmit()
42 eth_type_vlan(skb->protocol)) { in br_dev_queue_push_xmit()
45 if (!__vlan_get_protocol(skb, skb->protocol, &depth)) in br_dev_queue_push_xmit()
48 skb_set_network_header(skb, depth); in br_dev_queue_push_xmit()
51 br_switchdev_frame_set_offload_fwd_mark(skb); in br_dev_queue_push_xmit()
53 dev_queue_xmit(skb); in br_dev_queue_push_xmit()
58 kfree_skb(skb); in br_dev_queue_push_xmit()
63 int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb) in br_forward_finish() argument
65 skb->tstamp = 0; in br_forward_finish()
67 net, sk, skb, NULL, skb->dev, in br_forward_finish()
74 struct sk_buff *skb, bool local_orig) in __br_forward() argument
84 nbp_switchdev_frame_mark_tx_fwd_offload(to, skb); in __br_forward()
87 skb = br_handle_vlan(to->br, to, vg, skb); in __br_forward()
88 if (!skb) in __br_forward()
91 indev = skb->dev; in __br_forward()
92 skb->dev = to->dev; in __br_forward()
94 if (skb_warn_if_lro(skb)) { in __br_forward()
95 kfree_skb(skb); in __br_forward()
99 skb_forward_csum(skb); in __br_forward()
103 skb_push(skb, ETH_HLEN); in __br_forward()
104 if (!is_skb_forwardable(skb->dev, skb)) in __br_forward()
105 kfree_skb(skb); in __br_forward()
107 br_netpoll_send_skb(to, skb); in __br_forward()
111 net = dev_net(skb->dev); in __br_forward()
116 net, NULL, skb, indev, skb->dev, in __br_forward()
121 struct sk_buff *skb, bool local_orig) in deliver_clone() argument
123 struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; in deliver_clone()
125 skb = skb_clone(skb, GFP_ATOMIC); in deliver_clone()
126 if (!skb) { in deliver_clone()
131 __br_forward(prev, skb, local_orig); in deliver_clone()
145 struct sk_buff *skb, bool local_rcv, bool local_orig) in br_forward() argument
160 if (should_deliver(to, skb)) { in br_forward()
162 deliver_clone(to, skb, local_orig); in br_forward()
164 __br_forward(to, skb, local_orig); in br_forward()
170 kfree_skb(skb); in br_forward()
176 struct sk_buff *skb, bool local_orig) in maybe_deliver() argument
178 u8 igmp_type = br_multicast_igmp_type(skb); in maybe_deliver()
181 if (!should_deliver(p, skb)) in maybe_deliver()
184 nbp_switchdev_frame_mark_tx_fwd_to_hwdom(p, skb); in maybe_deliver()
189 err = deliver_clone(prev, skb, local_orig); in maybe_deliver()
193 br_multicast_count(p->br, p, skb, igmp_type, BR_MCAST_DIR_TX); in maybe_deliver()
199 void br_flood(struct net_bridge *br, struct sk_buff *skb, in br_flood() argument
215 if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev) in br_flood()
219 if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev) in br_flood()
228 BR_INPUT_SKB_CB(skb)->proxyarp_replied) in br_flood()
231 prev = maybe_deliver(prev, p, skb, local_orig); in br_flood()
240 deliver_clone(prev, skb, local_orig); in br_flood()
242 __br_forward(prev, skb, local_orig); in br_flood()
247 kfree_skb(skb); in br_flood()
251 static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, in maybe_deliver_addr() argument
254 struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; in maybe_deliver_addr()
255 const unsigned char *src = eth_hdr(skb)->h_source; in maybe_deliver_addr()
257 if (!should_deliver(p, skb)) in maybe_deliver_addr()
261 if (skb->dev == p->dev && ether_addr_equal(src, addr)) in maybe_deliver_addr()
264 skb = skb_copy(skb, GFP_ATOMIC); in maybe_deliver_addr()
265 if (!skb) { in maybe_deliver_addr()
271 memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN); in maybe_deliver_addr()
273 __br_forward(p, skb, local_orig); in maybe_deliver_addr()
278 struct sk_buff *skb, in br_multicast_flood() argument
287 rp = br_multicast_get_first_rport_node(brmctx, skb); in br_multicast_flood()
302 rport = br_multicast_rport_from_node_skb(rp, skb); in br_multicast_flood()
308 maybe_deliver_addr(lport, skb, p->eth_addr, in br_multicast_flood()
320 prev = maybe_deliver(prev, port, skb, local_orig); in br_multicast_flood()
334 deliver_clone(prev, skb, local_orig); in br_multicast_flood()
336 __br_forward(prev, skb, local_orig); in br_multicast_flood()
341 kfree_skb(skb); in br_multicast_flood()