diff options
author | Maninder Singh <maninder1.s@samsung.com> | 2015-06-22 03:09:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-23 09:53:29 -0400 |
commit | e8e85cc5eb5701b935a06b5b3a03a8532946f969 (patch) | |
tree | e5940fb353d55cbed39d3b10a898223ff72944a7 /net/packet | |
parent | 138b15ed877eff8149ae32c12fa1f4795c9cb4cf (diff) |
packet: remove handling of tx_ring
Remove handling of tx_ring in prb_setup_retire_blk_timer
for TPACKET_V3 because init_prb_bdqc is called only for zero tx_ring
and thus prb_setup_retire_blk_timer for zero tx_ring only.
And also in functon init_prb_bdqc there is no usage of tx_ring.
Thus removing tx_ring from init_prb_bdqc.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Suggested-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 20e8c40da90d..f5c87031b121 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -543,15 +543,11 @@ static void prb_init_blk_timer(struct packet_sock *po, | |||
543 | pkc->retire_blk_timer.expires = jiffies; | 543 | pkc->retire_blk_timer.expires = jiffies; |
544 | } | 544 | } |
545 | 545 | ||
546 | static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring) | 546 | static void prb_setup_retire_blk_timer(struct packet_sock *po) |
547 | { | 547 | { |
548 | struct tpacket_kbdq_core *pkc; | 548 | struct tpacket_kbdq_core *pkc; |
549 | 549 | ||
550 | if (tx_ring) | 550 | pkc = GET_PBDQC_FROM_RB(&po->rx_ring); |
551 | BUG(); | ||
552 | |||
553 | pkc = tx_ring ? GET_PBDQC_FROM_RB(&po->tx_ring) : | ||
554 | GET_PBDQC_FROM_RB(&po->rx_ring); | ||
555 | prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired); | 551 | prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired); |
556 | } | 552 | } |
557 | 553 | ||
@@ -607,7 +603,7 @@ static void prb_init_ft_ops(struct tpacket_kbdq_core *p1, | |||
607 | static void init_prb_bdqc(struct packet_sock *po, | 603 | static void init_prb_bdqc(struct packet_sock *po, |
608 | struct packet_ring_buffer *rb, | 604 | struct packet_ring_buffer *rb, |
609 | struct pgv *pg_vec, | 605 | struct pgv *pg_vec, |
610 | union tpacket_req_u *req_u, int tx_ring) | 606 | union tpacket_req_u *req_u) |
611 | { | 607 | { |
612 | struct tpacket_kbdq_core *p1 = GET_PBDQC_FROM_RB(rb); | 608 | struct tpacket_kbdq_core *p1 = GET_PBDQC_FROM_RB(rb); |
613 | struct tpacket_block_desc *pbd; | 609 | struct tpacket_block_desc *pbd; |
@@ -634,7 +630,7 @@ static void init_prb_bdqc(struct packet_sock *po, | |||
634 | 630 | ||
635 | p1->max_frame_len = p1->kblk_size - BLK_PLUS_PRIV(p1->blk_sizeof_priv); | 631 | p1->max_frame_len = p1->kblk_size - BLK_PLUS_PRIV(p1->blk_sizeof_priv); |
636 | prb_init_ft_ops(p1, req_u); | 632 | prb_init_ft_ops(p1, req_u); |
637 | prb_setup_retire_blk_timer(po, tx_ring); | 633 | prb_setup_retire_blk_timer(po); |
638 | prb_open_block(p1, pbd); | 634 | prb_open_block(p1, pbd); |
639 | } | 635 | } |
640 | 636 | ||
@@ -4002,7 +3998,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, | |||
4002 | * it above but just being paranoid | 3998 | * it above but just being paranoid |
4003 | */ | 3999 | */ |
4004 | if (!tx_ring) | 4000 | if (!tx_ring) |
4005 | init_prb_bdqc(po, rb, pg_vec, req_u, tx_ring); | 4001 | init_prb_bdqc(po, rb, pg_vec, req_u); |
4006 | break; | 4002 | break; |
4007 | default: | 4003 | default: |
4008 | break; | 4004 | break; |