diff options
-rw-r--r-- | net/packet/af_packet.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index ba2548bd85bf..c235da940019 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -437,7 +437,8 @@ static void prb_shutdown_retire_blk_timer(struct packet_sock *po, | |||
437 | { | 437 | { |
438 | struct tpacket_kbdq_core *pkc; | 438 | struct tpacket_kbdq_core *pkc; |
439 | 439 | ||
440 | pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc; | 440 | pkc = tx_ring ? GET_PBDQC_FROM_RB(&po->tx_ring) : |
441 | GET_PBDQC_FROM_RB(&po->rx_ring); | ||
441 | 442 | ||
442 | spin_lock_bh(&rb_queue->lock); | 443 | spin_lock_bh(&rb_queue->lock); |
443 | pkc->delete_blk_timer = 1; | 444 | pkc->delete_blk_timer = 1; |
@@ -463,7 +464,8 @@ static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring) | |||
463 | if (tx_ring) | 464 | if (tx_ring) |
464 | BUG(); | 465 | BUG(); |
465 | 466 | ||
466 | pkc = tx_ring ? &po->tx_ring.prb_bdqc : &po->rx_ring.prb_bdqc; | 467 | pkc = tx_ring ? GET_PBDQC_FROM_RB(&po->tx_ring) : |
468 | GET_PBDQC_FROM_RB(&po->rx_ring); | ||
467 | prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired); | 469 | prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired); |
468 | } | 470 | } |
469 | 471 | ||
@@ -521,7 +523,7 @@ static void init_prb_bdqc(struct packet_sock *po, | |||
521 | struct pgv *pg_vec, | 523 | struct pgv *pg_vec, |
522 | union tpacket_req_u *req_u, int tx_ring) | 524 | union tpacket_req_u *req_u, int tx_ring) |
523 | { | 525 | { |
524 | struct tpacket_kbdq_core *p1 = &rb->prb_bdqc; | 526 | struct tpacket_kbdq_core *p1 = GET_PBDQC_FROM_RB(rb); |
525 | struct tpacket_block_desc *pbd; | 527 | struct tpacket_block_desc *pbd; |
526 | 528 | ||
527 | memset(p1, 0x0, sizeof(*p1)); | 529 | memset(p1, 0x0, sizeof(*p1)); |
@@ -585,7 +587,7 @@ static void _prb_refresh_rx_retire_blk_timer(struct tpacket_kbdq_core *pkc) | |||
585 | static void prb_retire_rx_blk_timer_expired(unsigned long data) | 587 | static void prb_retire_rx_blk_timer_expired(unsigned long data) |
586 | { | 588 | { |
587 | struct packet_sock *po = (struct packet_sock *)data; | 589 | struct packet_sock *po = (struct packet_sock *)data; |
588 | struct tpacket_kbdq_core *pkc = &po->rx_ring.prb_bdqc; | 590 | struct tpacket_kbdq_core *pkc = GET_PBDQC_FROM_RB(&po->rx_ring); |
589 | unsigned int frozen; | 591 | unsigned int frozen; |
590 | struct tpacket_block_desc *pbd; | 592 | struct tpacket_block_desc *pbd; |
591 | 593 | ||