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_and_depth(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_clear_tstamp(skb); 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
157 BR_INPUT_SKB_CB(skb)->backup_nhid = READ_ONCE(to->backup_nhid); in br_forward()
161 if (should_deliver(to, skb)) { in br_forward()
163 deliver_clone(to, skb, local_orig); in br_forward()
165 __br_forward(to, skb, local_orig); in br_forward()
171 kfree_skb(skb); in br_forward()
177 struct sk_buff *skb, bool local_orig) in maybe_deliver() argument
179 u8 igmp_type = br_multicast_igmp_type(skb); in maybe_deliver()
182 if (!should_deliver(p, skb)) in maybe_deliver()
185 nbp_switchdev_frame_mark_tx_fwd_to_hwdom(p, skb); in maybe_deliver()
190 err = deliver_clone(prev, skb, local_orig); in maybe_deliver()
194 br_multicast_count(p->br, p, skb, igmp_type, BR_MCAST_DIR_TX); in maybe_deliver()
200 void br_flood(struct net_bridge *br, struct sk_buff *skb, in br_flood() argument
207 br_tc_skb_miss_set(skb, pkt_type != BR_PKT_BROADCAST); in br_flood()
219 if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev) in br_flood()
223 if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev) in br_flood()
231 if (BR_INPUT_SKB_CB(skb)->proxyarp_replied && in br_flood()
236 prev = maybe_deliver(prev, p, skb, local_orig); in br_flood()
245 deliver_clone(prev, skb, local_orig); in br_flood()
247 __br_forward(prev, skb, local_orig); in br_flood()
252 kfree_skb(skb); in br_flood()
256 static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, in maybe_deliver_addr() argument
259 struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; in maybe_deliver_addr()
260 const unsigned char *src = eth_hdr(skb)->h_source; in maybe_deliver_addr()
262 if (!should_deliver(p, skb)) in maybe_deliver_addr()
266 if (skb->dev == p->dev && ether_addr_equal(src, addr)) in maybe_deliver_addr()
269 skb = skb_copy(skb, GFP_ATOMIC); in maybe_deliver_addr()
270 if (!skb) { in maybe_deliver_addr()
276 memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN); in maybe_deliver_addr()
278 __br_forward(p, skb, local_orig); in maybe_deliver_addr()
283 struct sk_buff *skb, in br_multicast_flood() argument
292 rp = br_multicast_get_first_rport_node(brmctx, skb); in br_multicast_flood()
301 br_tc_skb_miss_set(skb, true); in br_multicast_flood()
308 rport = br_multicast_rport_from_node_skb(rp, skb); in br_multicast_flood()
314 maybe_deliver_addr(lport, skb, p->eth_addr, in br_multicast_flood()
326 prev = maybe_deliver(prev, port, skb, local_orig); in br_multicast_flood()
340 deliver_clone(prev, skb, local_orig); in br_multicast_flood()
342 __br_forward(prev, skb, local_orig); in br_multicast_flood()
347 kfree_skb(skb); in br_multicast_flood()