diff options
-rw-r--r-- | net/packet/af_packet.c | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index dd5cd49b0e09..8ec1bca7f859 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -742,36 +742,33 @@ static void prb_open_block(struct tpacket_kbdq_core *pkc1, | |||
742 | 742 | ||
743 | smp_rmb(); | 743 | smp_rmb(); |
744 | 744 | ||
745 | if (likely(TP_STATUS_KERNEL == BLOCK_STATUS(pbd1))) { | 745 | /* We could have just memset this but we will lose the |
746 | * flexibility of making the priv area sticky | ||
747 | */ | ||
746 | 748 | ||
747 | /* We could have just memset this but we will lose the | 749 | BLOCK_SNUM(pbd1) = pkc1->knxt_seq_num++; |
748 | * flexibility of making the priv area sticky | 750 | BLOCK_NUM_PKTS(pbd1) = 0; |
749 | */ | 751 | BLOCK_LEN(pbd1) = BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
750 | BLOCK_SNUM(pbd1) = pkc1->knxt_seq_num++; | ||
751 | BLOCK_NUM_PKTS(pbd1) = 0; | ||
752 | BLOCK_LEN(pbd1) = BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
753 | getnstimeofday(&ts); | ||
754 | h1->ts_first_pkt.ts_sec = ts.tv_sec; | ||
755 | h1->ts_first_pkt.ts_nsec = ts.tv_nsec; | ||
756 | pkc1->pkblk_start = (char *)pbd1; | ||
757 | pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
758 | BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); | ||
759 | BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN; | ||
760 | pbd1->version = pkc1->version; | ||
761 | pkc1->prev = pkc1->nxt_offset; | ||
762 | pkc1->pkblk_end = pkc1->pkblk_start + pkc1->kblk_size; | ||
763 | prb_thaw_queue(pkc1); | ||
764 | _prb_refresh_rx_retire_blk_timer(pkc1); | ||
765 | 752 | ||
766 | smp_wmb(); | 753 | getnstimeofday(&ts); |
767 | 754 | ||
768 | return; | 755 | h1->ts_first_pkt.ts_sec = ts.tv_sec; |
769 | } | 756 | h1->ts_first_pkt.ts_nsec = ts.tv_nsec; |
770 | 757 | ||
771 | WARN(1, "ERROR block:%p is NOT FREE status:%d kactive_blk_num:%d\n", | 758 | pkc1->pkblk_start = (char *)pbd1; |
772 | pbd1, BLOCK_STATUS(pbd1), pkc1->kactive_blk_num); | 759 | pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
773 | dump_stack(); | 760 | |
774 | BUG(); | 761 | BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv); |
762 | BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN; | ||
763 | |||
764 | pbd1->version = pkc1->version; | ||
765 | pkc1->prev = pkc1->nxt_offset; | ||
766 | pkc1->pkblk_end = pkc1->pkblk_start + pkc1->kblk_size; | ||
767 | |||
768 | prb_thaw_queue(pkc1); | ||
769 | _prb_refresh_rx_retire_blk_timer(pkc1); | ||
770 | |||
771 | smp_wmb(); | ||
775 | } | 772 | } |
776 | 773 | ||
777 | /* | 774 | /* |
@@ -862,10 +859,6 @@ static void prb_retire_current_block(struct tpacket_kbdq_core *pkc, | |||
862 | prb_close_block(pkc, pbd, po, status); | 859 | prb_close_block(pkc, pbd, po, status); |
863 | return; | 860 | return; |
864 | } | 861 | } |
865 | |||
866 | WARN(1, "ERROR-pbd[%d]:%p\n", pkc->kactive_blk_num, pbd); | ||
867 | dump_stack(); | ||
868 | BUG(); | ||
869 | } | 862 | } |
870 | 863 | ||
871 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, | 864 | static int prb_curr_blk_in_use(struct tpacket_kbdq_core *pkc, |