diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/packet/af_packet.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 03bb45adf2fc..82a6f34d39d0 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -335,7 +335,7 @@ struct packet_skb_cb { | |||
335 | (((x)->kactive_blk_num < ((x)->knum_blocks-1)) ? \ | 335 | (((x)->kactive_blk_num < ((x)->knum_blocks-1)) ? \ |
336 | ((x)->kactive_blk_num+1) : 0) | 336 | ((x)->kactive_blk_num+1) : 0) |
337 | 337 | ||
338 | static inline struct packet_sock *pkt_sk(struct sock *sk) | 338 | static struct packet_sock *pkt_sk(struct sock *sk) |
339 | { | 339 | { |
340 | return (struct packet_sock *)sk; | 340 | return (struct packet_sock *)sk; |
341 | } | 341 | } |
@@ -477,7 +477,7 @@ static void *packet_lookup_frame(struct packet_sock *po, | |||
477 | return h.raw; | 477 | return h.raw; |
478 | } | 478 | } |
479 | 479 | ||
480 | static inline void *packet_current_frame(struct packet_sock *po, | 480 | static void *packet_current_frame(struct packet_sock *po, |
481 | struct packet_ring_buffer *rb, | 481 | struct packet_ring_buffer *rb, |
482 | int status) | 482 | int status) |
483 | { | 483 | { |
@@ -715,7 +715,7 @@ out: | |||
715 | spin_unlock(&po->sk.sk_receive_queue.lock); | 715 | spin_unlock(&po->sk.sk_receive_queue.lock); |
716 | } | 716 | } |
717 | 717 | ||
718 | static inline void prb_flush_block(struct tpacket_kbdq_core *pkc1, | 718 | static void prb_flush_block(struct tpacket_kbdq_core *pkc1, |
719 | struct tpacket_block_desc *pbd1, __u32 status) | 719 | struct tpacket_block_desc *pbd1, __u32 status) |
720 | { | 720 | { |
721 | /* Flush everything minus the block header */ | 721 | /* Flush everything minus the block header */ |
@@ -793,7 +793,7 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1, | |||
793 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); | 793 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); |
794 | } | 794 | } |
795 | 795 | ||
796 | static inline void prb_thaw_queue(struct tpacket_kbdq_core *pkc) | 796 | static void prb_thaw_queue(struct tpacket_kbdq_core *pkc) |
797 | { | 797 | { |
798 | pkc->reset_pending_on_curr_blk = 0; | 798 | pkc->reset_pending_on_curr_blk = 0; |
799 | } | 799 | } |
@@ -869,7 +869,7 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1, | |||
869 | * case and __packet_lookup_frame_in_block will check if block-0 | 869 | * case and __packet_lookup_frame_in_block will check if block-0 |
870 | * is free and can now be re-used. | 870 | * is free and can now be re-used. |
871 | */ | 871 | */ |
872 | static inline void prb_freeze_queue(struct tpacket_kbdq_core *pkc, | 872 | static void prb_freeze_queue(struct tpacket_kbdq_core *pkc, |
873 | struct packet_sock *po) | 873 | struct packet_sock *po) |
874 | { | 874 | { |
875 | pkc->reset_pending_on_curr_blk = 1; | 875 | pkc->reset_pending_on_curr_blk = 1; |
@@ -940,36 +940,36 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, | |||
940 | BUG(); | 940 | BUG(); |
941 | } | 941 | } |
942 | 942 | ||
943 | static inline int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, | 943 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, |
944 | struct tpacket_block_desc *pbd) | 944 | struct tpacket_block_desc *pbd) |
945 | { | 945 | { |
946 | return TP_STATUS_USER & BLOCK_STATUS(pbd); | 946 | return TP_STATUS_USER & BLOCK_STATUS(pbd); |
947 | } | 947 | } |
948 | 948 | ||
949 | static inline int prb_queue_frozen(struct tpacket_kbdq_core *pkc) | 949 | static int prb_queue_frozen(struct tpacket_kbdq_core *pkc) |
950 | { | 950 | { |
951 | return pkc->reset_pending_on_curr_blk; | 951 | return pkc->reset_pending_on_curr_blk; |
952 | } | 952 | } |
953 | 953 | ||
954 | static inline void prb_clear_blk_fill_status(struct packet_ring_buffer *rb) | 954 | static void prb_clear_blk_fill_status(struct packet_ring_buffer *rb) |
955 | { | 955 | { |
956 | struct tpacket_kbdq_core *pkc = GET_PBDQC_FROM_RB(rb); | 956 | struct tpacket_kbdq_core *pkc = GET_PBDQC_FROM_RB(rb); |
957 | atomic_dec(&pkc->blk_fill_in_prog); | 957 | atomic_dec(&pkc->blk_fill_in_prog); |
958 | } | 958 | } |
959 | 959 | ||
960 | static inline void prb_fill_rxhash(struct tpacket_kbdq_core *pkc, | 960 | static void prb_fill_rxhash(struct tpacket_kbdq_core *pkc, |
961 | struct tpacket3_hdr *ppd) | 961 | struct tpacket3_hdr *ppd) |
962 | { | 962 | { |
963 | ppd->hv1.tp_rxhash = skb_get_rxhash(pkc->skb); | 963 | ppd->hv1.tp_rxhash = skb_get_rxhash(pkc->skb); |
964 | } | 964 | } |
965 | 965 | ||
966 | static inline void prb_clear_rxhash(struct tpacket_kbdq_core *pkc, | 966 | static void prb_clear_rxhash(struct tpacket_kbdq_core *pkc, |
967 | struct tpacket3_hdr *ppd) | 967 | struct tpacket3_hdr *ppd) |
968 | { | 968 | { |
969 | ppd->hv1.tp_rxhash = 0; | 969 | ppd->hv1.tp_rxhash = 0; |
970 | } | 970 | } |
971 | 971 | ||
972 | static inline void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, | 972 | static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, |
973 | struct tpacket3_hdr *ppd) | 973 | struct tpacket3_hdr *ppd) |
974 | { | 974 | { |
975 | if (vlan_tx_tag_present(pkc->skb)) { | 975 | if (vlan_tx_tag_present(pkc->skb)) { |
@@ -991,7 +991,7 @@ static void prb_run_all_ft_ops(struct tpacket_kbdq_core *pkc, | |||
991 | prb_clear_rxhash(pkc, ppd); | 991 | prb_clear_rxhash(pkc, ppd); |
992 | } | 992 | } |
993 | 993 | ||
994 | static inline void prb_fill_curr_block(char *curr, | 994 | static void prb_fill_curr_block(char *curr, |
995 | struct tpacket_kbdq_core *pkc, | 995 | struct tpacket_kbdq_core *pkc, |
996 | struct tpacket_block_desc *pbd, | 996 | struct tpacket_block_desc *pbd, |
997 | unsigned int len) | 997 | unsigned int len) |
@@ -1071,7 +1071,7 @@ static void *__packet_lookup_frame_in_block(struct packet_sock *po, | |||
1071 | return NULL; | 1071 | return NULL; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | static inline void *packet_current_rx_frame(struct packet_sock *po, | 1074 | static void *packet_current_rx_frame(struct packet_sock *po, |
1075 | struct sk_buff *skb, | 1075 | struct sk_buff *skb, |
1076 | int status, unsigned int len) | 1076 | int status, unsigned int len) |
1077 | { | 1077 | { |
@@ -1091,7 +1091,7 @@ static inline void *packet_current_rx_frame(struct packet_sock *po, | |||
1091 | } | 1091 | } |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | static inline void *prb_lookup_block(struct packet_sock *po, | 1094 | static void *prb_lookup_block(struct packet_sock *po, |
1095 | struct packet_ring_buffer *rb, | 1095 | struct packet_ring_buffer *rb, |
1096 | unsigned int previous, | 1096 | unsigned int previous, |
1097 | int status) | 1097 | int status) |
@@ -1104,7 +1104,7 @@ static inline void *prb_lookup_block(struct packet_sock *po, | |||
1104 | return pbd; | 1104 | return pbd; |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | static inline int prb_previous_blk_num(struct packet_ring_buffer *rb) | 1107 | static int prb_previous_blk_num(struct packet_ring_buffer *rb) |
1108 | { | 1108 | { |
1109 | unsigned int prev; | 1109 | unsigned int prev; |
1110 | if (rb->prb_bdqc.kactive_blk_num) | 1110 | if (rb->prb_bdqc.kactive_blk_num) |
@@ -1115,7 +1115,7 @@ static inline int prb_previous_blk_num(struct packet_ring_buffer *rb) | |||
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | /* Assumes caller has held the rx_queue.lock */ | 1117 | /* Assumes caller has held the rx_queue.lock */ |
1118 | static inline void *__prb_previous_block(struct packet_sock *po, | 1118 | static void *__prb_previous_block(struct packet_sock *po, |
1119 | struct packet_ring_buffer *rb, | 1119 | struct packet_ring_buffer *rb, |
1120 | int status) | 1120 | int status) |
1121 | { | 1121 | { |
@@ -1123,7 +1123,7 @@ static inline void *__prb_previous_block(struct packet_sock *po, | |||
1123 | return prb_lookup_block(po, rb, previous, status); | 1123 | return prb_lookup_block(po, rb, previous, status); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | static inline void *packet_previous_rx_frame(struct packet_sock *po, | 1126 | static void *packet_previous_rx_frame(struct packet_sock *po, |
1127 | struct packet_ring_buffer *rb, | 1127 | struct packet_ring_buffer *rb, |
1128 | int status) | 1128 | int status) |
1129 | { | 1129 | { |
@@ -1133,7 +1133,7 @@ static inline void *packet_previous_rx_frame(struct packet_sock *po, | |||
1133 | return __prb_previous_block(po, rb, status); | 1133 | return __prb_previous_block(po, rb, status); |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static inline void packet_increment_rx_head(struct packet_sock *po, | 1136 | static void packet_increment_rx_head(struct packet_sock *po, |
1137 | struct packet_ring_buffer *rb) | 1137 | struct packet_ring_buffer *rb) |
1138 | { | 1138 | { |
1139 | switch (po->tp_version) { | 1139 | switch (po->tp_version) { |
@@ -1148,7 +1148,7 @@ static inline void packet_increment_rx_head(struct packet_sock *po, | |||
1148 | } | 1148 | } |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | static inline void *packet_previous_frame(struct packet_sock *po, | 1151 | static void *packet_previous_frame(struct packet_sock *po, |
1152 | struct packet_ring_buffer *rb, | 1152 | struct packet_ring_buffer *rb, |
1153 | int status) | 1153 | int status) |
1154 | { | 1154 | { |
@@ -1156,7 +1156,7 @@ static inline void *packet_previous_frame(struct packet_sock *po, | |||
1156 | return packet_lookup_frame(po, rb, previous, status); | 1156 | return packet_lookup_frame(po, rb, previous, status); |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static inline void packet_increment_head(struct packet_ring_buffer *buff) | 1159 | static void packet_increment_head(struct packet_ring_buffer *buff) |
1160 | { | 1160 | { |
1161 | buff->head = buff->head != buff->frame_max ? buff->head+1 : 0; | 1161 | buff->head = buff->head != buff->frame_max ? buff->head+1 : 0; |
1162 | } | 1162 | } |
@@ -1558,7 +1558,7 @@ out_free: | |||
1558 | return err; | 1558 | return err; |
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | static inline unsigned int run_filter(const struct sk_buff *skb, | 1561 | static unsigned int run_filter(const struct sk_buff *skb, |
1562 | const struct sock *sk, | 1562 | const struct sock *sk, |
1563 | unsigned int res) | 1563 | unsigned int res) |
1564 | { | 1564 | { |
@@ -2167,10 +2167,10 @@ out: | |||
2167 | return err; | 2167 | return err; |
2168 | } | 2168 | } |
2169 | 2169 | ||
2170 | static inline struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad, | 2170 | static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad, |
2171 | size_t reserve, size_t len, | 2171 | size_t reserve, size_t len, |
2172 | size_t linear, int noblock, | 2172 | size_t linear, int noblock, |
2173 | int *err) | 2173 | int *err) |
2174 | { | 2174 | { |
2175 | struct sk_buff *skb; | 2175 | struct sk_buff *skb; |
2176 | 2176 | ||
@@ -3494,7 +3494,7 @@ static void free_pg_vec(struct pgv *pg_vec, unsigned int order, | |||
3494 | kfree(pg_vec); | 3494 | kfree(pg_vec); |
3495 | } | 3495 | } |
3496 | 3496 | ||
3497 | static inline char *alloc_one_pg_vec_page(unsigned long order) | 3497 | static char *alloc_one_pg_vec_page(unsigned long order) |
3498 | { | 3498 | { |
3499 | char *buffer = NULL; | 3499 | char *buffer = NULL; |
3500 | gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | | 3500 | gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | |