Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755936AbbFVF4p (ORCPT ); Mon, 22 Jun 2015 01:56:45 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:35695 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753573AbbFVF4h (ORCPT ); Mon, 22 Jun 2015 01:56:37 -0400 X-AuditID: cbfee690-f796f6d000005054-68-5587a392a0cc From: Maninder Singh To: davem@davemloft.net, willemb@google.com, dborkman@redhat.com, al.drozdov@gmail.com, viro@zeniv.linux.org.uk, eyal.birger@gmail.com, mst@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, fransklaver@gmail.com Cc: pankaj.m@samsung.com, Maninder Singh Subject: [RFC PATCH v2] packet: remove handling of tx_ring Date: Mon, 22 Jun 2015 11:24:57 +0530 Message-id: <1434952497-15216-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsWyRsSkVnfS4vZQg+WTdS3+zTjDbjHnfAuL xYn/RxgtTrlYLL57j8ni8q45bBaH57exWPz/9YrV4tgCMYt7b7YyWZz/e5zV4t2WI+wOPB5b Vt5k8tg56y67x4JNpR7v911l8+jbsorR4/MmOY9NT94yBbBHcdmkpOZklqUW6dslcGVMbj7G XHBEsGL90rQGxsN8XYycHBICJhIv5s5mgrDFJC7cW8/WxcjFISSwlFHi8sRF7DBFq/obmCES ixglvrbtAusQEvjJKHFmGxuIzSagJ7Fq1x4WkCIRgZeMEleevGTsYuTgYBZwkpj+VQ+kRljA SuJx2yqwXhYBVYnD67eALeAVcJc49/AnE0i5hICCxJxJNiBjJAQ2sUtM3TWBEaJeQOLb5EMs EDWyEpsOMEPcJilxcMUNlgmMggsYGVYxiqYWJBcUJ6UXmegVJ+YWl+al6yXn525iBAb86X/P JuxgvHfA+hCjAAejEg8vx6L2UCHWxLLiytx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MlG2I4n9AGfv6xk3qhPSL75/rMj6 Km/dxaX3ZI2SvEtXvw9f3LaT1/GGyf1ran3bDyhMfef69AnzS67UPeVLmVS7nqRcTTlUrMRS nJFoqMVcVJwIACISPfu9AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2305 Lines: 69 v1 = replace if()/BUG with BUG_ON() for tx_ring. v2 = remove handling of tx_ring in prb_setup_retire_blk_timer for TPACKET_V3 because init_prb_bdqc is called only for NULL tx_ring and thus prb_setup_retire_blk_timer for NULL tx_ring only. And also in funciton init_prb_bdqc there is no usage of tx_ring. Thus removing tx_ring from init_prb_bdqc. Signed-off-by: Maninder Singh Suggested-by: Frans Klaver --- net/packet/af_packet.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index fd51641..aeafcf0 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, 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); } @@ -4001,7 +3997,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; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/