]> git.karo-electronics.de Git - linux-beck.git/commitdiff
packet: remove handling of tx_ring
authorManinder Singh <maninder1.s@samsung.com>
Mon, 22 Jun 2015 07:09:16 +0000 (12:39 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Jun 2015 13:53:29 +0000 (06:53 -0700)
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>
net/packet/af_packet.c

index 20e8c40da90d6454d5a0d326337dc7d5c849dfc2..f5c87031b1214a868dc3468b5ac2cdb3b6447b38 100644 (file)
@@ -543,15 +543,11 @@ static void prb_init_blk_timer(struct packet_sock *po,
        pkc->retire_blk_timer.expires = jiffies;
 }
 
-static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring)
+static void prb_setup_retire_blk_timer(struct packet_sock *po)
 {
        struct tpacket_kbdq_core *pkc;
 
-       if (tx_ring)
-               BUG();
-
-       pkc = tx_ring ? GET_PBDQC_FROM_RB(&po->tx_ring) :
-                       GET_PBDQC_FROM_RB(&po->rx_ring);
+       pkc = GET_PBDQC_FROM_RB(&po->rx_ring);
        prb_init_blk_timer(po, pkc, prb_retire_rx_blk_timer_expired);
 }
 
@@ -607,7 +603,7 @@ static void prb_init_ft_ops(struct tpacket_kbdq_core *p1,
 static void init_prb_bdqc(struct packet_sock *po,
                        struct packet_ring_buffer *rb,
                        struct pgv *pg_vec,
-                       union tpacket_req_u *req_u, int tx_ring)
+                       union tpacket_req_u *req_u)
 {
        struct tpacket_kbdq_core *p1 = GET_PBDQC_FROM_RB(rb);
        struct tpacket_block_desc *pbd;
@@ -634,7 +630,7 @@ static void init_prb_bdqc(struct packet_sock *po,
 
        p1->max_frame_len = p1->kblk_size - BLK_PLUS_PRIV(p1->blk_sizeof_priv);
        prb_init_ft_ops(p1, req_u);
-       prb_setup_retire_blk_timer(po, tx_ring);
+       prb_setup_retire_blk_timer(po);
        prb_open_block(p1, pbd);
 }
 
@@ -4002,7 +3998,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
                 * it above but just being paranoid
                 */
                        if (!tx_ring)
-                               init_prb_bdqc(po, rb, pg_vec, req_u, tx_ring);
+                               init_prb_bdqc(po, rb, pg_vec, req_u);
                        break;
                default:
                        break;