Lines Matching refs:skb

22 static void rmnet_set_skb_proto(struct sk_buff *skb)  in rmnet_set_skb_proto()  argument
24 switch (skb->data[0] & 0xF0) { in rmnet_set_skb_proto()
26 skb->protocol = htons(ETH_P_IP); in rmnet_set_skb_proto()
29 skb->protocol = htons(ETH_P_IPV6); in rmnet_set_skb_proto()
32 skb->protocol = htons(ETH_P_MAP); in rmnet_set_skb_proto()
40 rmnet_deliver_skb(struct sk_buff *skb) in rmnet_deliver_skb() argument
42 struct rmnet_priv *priv = netdev_priv(skb->dev); in rmnet_deliver_skb()
44 skb_reset_transport_header(skb); in rmnet_deliver_skb()
45 skb_reset_network_header(skb); in rmnet_deliver_skb()
46 rmnet_vnd_rx_fixup(skb, skb->dev); in rmnet_deliver_skb()
48 skb->pkt_type = PACKET_HOST; in rmnet_deliver_skb()
49 skb_set_mac_header(skb, 0); in rmnet_deliver_skb()
50 gro_cells_receive(&priv->gro_cells, skb); in rmnet_deliver_skb()
56 __rmnet_map_ingress_handler(struct sk_buff *skb, in __rmnet_map_ingress_handler() argument
59 struct rmnet_map_header *map_header = (void *)skb->data; in __rmnet_map_ingress_handler()
67 return rmnet_map_command(skb, port); in __rmnet_map_ingress_handler()
83 skb->dev = ep->egress_dev; in __rmnet_map_ingress_handler()
87 if (rmnet_map_process_next_hdr_packet(skb, len)) in __rmnet_map_ingress_handler()
89 skb_pull(skb, sizeof(*map_header)); in __rmnet_map_ingress_handler()
90 rmnet_set_skb_proto(skb); in __rmnet_map_ingress_handler()
93 skb_pull(skb, sizeof(*map_header)); in __rmnet_map_ingress_handler()
94 rmnet_set_skb_proto(skb); in __rmnet_map_ingress_handler()
96 !rmnet_map_checksum_downlink_packet(skb, len + pad)) in __rmnet_map_ingress_handler()
97 skb->ip_summed = CHECKSUM_UNNECESSARY; in __rmnet_map_ingress_handler()
100 skb_trim(skb, len); in __rmnet_map_ingress_handler()
101 rmnet_deliver_skb(skb); in __rmnet_map_ingress_handler()
105 kfree_skb(skb); in __rmnet_map_ingress_handler()
109 rmnet_map_ingress_handler(struct sk_buff *skb, in rmnet_map_ingress_handler() argument
114 if (skb->dev->type == ARPHRD_ETHER) { in rmnet_map_ingress_handler()
115 if (pskb_expand_head(skb, ETH_HLEN, 0, GFP_ATOMIC)) { in rmnet_map_ingress_handler()
116 kfree_skb(skb); in rmnet_map_ingress_handler()
120 skb_push(skb, ETH_HLEN); in rmnet_map_ingress_handler()
124 while ((skbn = rmnet_map_deaggregate(skb, port)) != NULL) in rmnet_map_ingress_handler()
127 consume_skb(skb); in rmnet_map_ingress_handler()
129 __rmnet_map_ingress_handler(skb, port); in rmnet_map_ingress_handler()
133 static int rmnet_map_egress_handler(struct sk_buff *skb, in rmnet_map_egress_handler() argument
153 if (skb_cow_head(skb, required_headroom) < 0) in rmnet_map_egress_handler()
157 rmnet_map_checksum_uplink_packet(skb, port, orig_dev, in rmnet_map_egress_handler()
160 map_header = rmnet_map_add_map_header(skb, additional_header_len, in rmnet_map_egress_handler()
167 skb->protocol = htons(ETH_P_MAP); in rmnet_map_egress_handler()
173 rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev) in rmnet_bridge_handler() argument
175 if (skb_mac_header_was_set(skb)) in rmnet_bridge_handler()
176 skb_push(skb, skb->mac_len); in rmnet_bridge_handler()
179 skb->dev = bridge_dev; in rmnet_bridge_handler()
180 dev_queue_xmit(skb); in rmnet_bridge_handler()
192 struct sk_buff *skb = *pskb; in rmnet_rx_handler() local
196 if (!skb) in rmnet_rx_handler()
199 if (skb_linearize(skb)) { in rmnet_rx_handler()
200 kfree_skb(skb); in rmnet_rx_handler()
204 if (skb->pkt_type == PACKET_LOOPBACK) in rmnet_rx_handler()
207 dev = skb->dev; in rmnet_rx_handler()
210 atomic_long_inc(&skb->dev->rx_nohandler); in rmnet_rx_handler()
211 kfree_skb(skb); in rmnet_rx_handler()
217 rmnet_map_ingress_handler(skb, port); in rmnet_rx_handler()
220 rmnet_bridge_handler(skb, port->bridge_ep); in rmnet_rx_handler()
232 void rmnet_egress_handler(struct sk_buff *skb) in rmnet_egress_handler() argument
239 sk_pacing_shift_update(skb->sk, 8); in rmnet_egress_handler()
241 orig_dev = skb->dev; in rmnet_egress_handler()
243 skb->dev = priv->real_dev; in rmnet_egress_handler()
246 port = rmnet_get_port_rcu(skb->dev); in rmnet_egress_handler()
250 if (rmnet_map_egress_handler(skb, port, mux_id, orig_dev)) in rmnet_egress_handler()
253 rmnet_vnd_tx_fixup(skb, orig_dev); in rmnet_egress_handler()
255 dev_queue_xmit(skb); in rmnet_egress_handler()
260 kfree_skb(skb); in rmnet_egress_handler()