All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  7:09 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  7:09 UTC (permalink / raw)
  To: davem, willemb, dborkman, al.drozdov, viro, eyal.birger, mst,
	netdev, linux-kernel, fransklaver
  Cc: pankaj.m, Maninder Singh

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>
---
v1: replace if()/BUG with BUG_ON() for tx_ring
v2: remove BUG() by removing tx_ring handling

 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/

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  7:09 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  7:09 UTC (permalink / raw)
  To: davem, willemb, dborkman, al.drozdov, viro, eyal.birger, mst,
	netdev, linux-kernel, fransklaver
  Cc: pankaj.m, Maninder Singh

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>
---
v1: replace if()/BUG with BUG_ON() for tx_ring
v2: remove BUG() by removing tx_ring handling

 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
  2015-06-22  7:09 ` Maninder Singh
  (?)
@ 2015-06-23 13:53 ` David Miller
  -1 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2015-06-23 13:53 UTC (permalink / raw)
  To: maninder1.s
  Cc: willemb, dborkman, al.drozdov, viro, eyal.birger, mst, netdev,
	linux-kernel, fransklaver, pankaj.m

From: Maninder Singh <maninder1.s@samsung.com>
Date: Mon, 22 Jun 2015 12:39:16 +0530

> 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>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
  2015-06-22  6:53 ` Maninder Singh
@ 2015-06-22  7:00   ` Frans Klaver
  -1 siblings, 0 replies; 11+ messages in thread
From: Frans Klaver @ 2015-06-22  7:00 UTC (permalink / raw)
  To: Maninder Singh
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, PANKAJ MISHRA

Hi,

On Mon, Jun 22, 2015 at 8:53 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
> Hi Frans,
>
>>> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>>>
>>> v2 =
>>
>>I would keep this below the ---. There's little historical use for
>>this version information when it gets merged.
>>
>>> 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.
>>
>>I'd say tx_ring is false, rather than NULL. It's not a pointer (here).
>>
>>
>>> And also in funciton init_prb_bdqc there is no usage of tx_ring.
>>
>>s,funciton,function,
>
> Thanks for feedback , please check below changelog if it looks ok,
> Then i will share updated patch:-
>
> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Frans Klaver <fransklaver@gmail.com>

No, the Suggested-by: was better for me. You can't go about and add
Signed-off-by lines for someone else without permission ;-).

> ---
> Changes in v2:
>
>  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.
>
>  net/packet/af_packet.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>
>  Thanks
>  Maninder

No, I didn't make myself clear enough, I'm afraid. The info about the
different incarnations of your patch should go below the dashes. The
whole "Remove handling ...." text should be your commit message,
because that is what you want to see in the commit log. Here's an
example:

Subject: [RFC PATCH v2] 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>
---
v1..v2: remove BUG() by removing tx_path

diffstat & patch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  7:00   ` Frans Klaver
  0 siblings, 0 replies; 11+ messages in thread
From: Frans Klaver @ 2015-06-22  7:00 UTC (permalink / raw)
  To: Maninder Singh
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, PANKAJ MISHRA

Hi,

On Mon, Jun 22, 2015 at 8:53 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
> Hi Frans,
>
>>> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>>>
>>> v2 =
>>
>>I would keep this below the ---. There's little historical use for
>>this version information when it gets merged.
>>
>>> 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.
>>
>>I'd say tx_ring is false, rather than NULL. It's not a pointer (here).
>>
>>
>>> And also in funciton init_prb_bdqc there is no usage of tx_ring.
>>
>>s,funciton,function,
>
> Thanks for feedback , please check below changelog if it looks ok,
> Then i will share updated patch:-
>
> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Frans Klaver <fransklaver@gmail.com>

No, the Suggested-by: was better for me. You can't go about and add
Signed-off-by lines for someone else without permission ;-).

> ---
> Changes in v2:
>
>  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.
>
>  net/packet/af_packet.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>
>  Thanks
>  Maninder

No, I didn't make myself clear enough, I'm afraid. The info about the
different incarnations of your patch should go below the dashes. The
whole "Remove handling ...." text should be your commit message,
because that is what you want to see in the commit log. Here's an
example:

Subject: [RFC PATCH v2] 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>
---
v1..v2: remove BUG() by removing tx_path

diffstat & patch

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  6:53 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  6:53 UTC (permalink / raw)
  To: Frans Klaver
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, PANKAJ MISHRA

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 1333 bytes --]

Hi Frans,

>> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>>
>> v2 =
>
>I would keep this below the ---. There's little historical use for
>this version information when it gets merged.
>
>> 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.
>
>I'd say tx_ring is false, rather than NULL. It's not a pointer (here).
>
>
>> And also in funciton init_prb_bdqc there is no usage of tx_ring.
>
>s,funciton,function,

Thanks for feedback , please check below changelog if it looks ok,
Then i will share updated patch:-

v1 = replace if()/BUG with BUG_ON() for tx_ring.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Frans Klaver <fransklaver@gmail.com>
---
Changes in v2:

 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.

 net/packet/af_packet.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
 
 Thanks
 Maninderÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠsåy«\x1e­æ¶\x17…\x01\x06­†ÛiÿÿðÃ\x0fí»\x1fè®\x0få’i\x7f

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  6:53 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  6:53 UTC (permalink / raw)
  To: Frans Klaver
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, PANKAJ MISHRA

Hi Frans,

>> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>>
>> v2 =
>
>I would keep this below the ---. There's little historical use for
>this version information when it gets merged.
>
>> 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.
>
>I'd say tx_ring is false, rather than NULL. It's not a pointer (here).
>
>
>> And also in funciton init_prb_bdqc there is no usage of tx_ring.
>
>s,funciton,function,

Thanks for feedback , please check below changelog if it looks ok,
Then i will share updated patch:-

v1 = replace if()/BUG with BUG_ON() for tx_ring.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Frans Klaver <fransklaver@gmail.com>
---
Changes in v2:

 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.

 net/packet/af_packet.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
 
 Thanks
 Maninder

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
  2015-06-22  5:54 ` Maninder Singh
@ 2015-06-22  6:33   ` Frans Klaver
  -1 siblings, 0 replies; 11+ messages in thread
From: Frans Klaver @ 2015-06-22  6:33 UTC (permalink / raw)
  To: Maninder Singh
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, pankaj.m

On Mon, Jun 22, 2015 at 7:54 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>
> v2 =

I would keep this below the ---. There's little historical use for
this version information when it gets merged.

> 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.

I'd say tx_ring is false, rather than NULL. It's not a pointer (here).


> And also in funciton init_prb_bdqc there is no usage of tx_ring.

s,funciton,function,


> Thus removing tx_ring from init_prb_bdqc.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Suggested-by: Frans Klaver <fransklaver@gmail.com>
> ---
>  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

Looks like what I made myself yesterday evening.

Thanks,
Frans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  6:33   ` Frans Klaver
  0 siblings, 0 replies; 11+ messages in thread
From: Frans Klaver @ 2015-06-22  6:33 UTC (permalink / raw)
  To: Maninder Singh
  Cc: davem, Willem de Bruijn, dborkman, Alexander Drozdov, Al Viro,
	Eyal Birger, mst, netdev, linux-kernel, pankaj.m

On Mon, Jun 22, 2015 at 7:54 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
> v1 = replace if()/BUG with BUG_ON() for tx_ring.
>
> v2 =

I would keep this below the ---. There's little historical use for
this version information when it gets merged.

> 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.

I'd say tx_ring is false, rather than NULL. It's not a pointer (here).


> And also in funciton init_prb_bdqc there is no usage of tx_ring.

s,funciton,function,


> Thus removing tx_ring from init_prb_bdqc.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Suggested-by: Frans Klaver <fransklaver@gmail.com>
> ---
>  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

Looks like what I made myself yesterday evening.

Thanks,
Frans

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  5:54 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  5:54 UTC (permalink / raw)
  To: davem, willemb, dborkman, al.drozdov, viro, eyal.birger, mst,
	netdev, linux-kernel, fransklaver
  Cc: pankaj.m, Maninder Singh

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 <maninder1.s@samsung.com>
Suggested-by: Frans Klaver <fransklaver@gmail.com>
---
 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/

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [RFC PATCH v2] packet: remove handling of tx_ring
@ 2015-06-22  5:54 ` Maninder Singh
  0 siblings, 0 replies; 11+ messages in thread
From: Maninder Singh @ 2015-06-22  5:54 UTC (permalink / raw)
  To: davem, willemb, dborkman, al.drozdov, viro, eyal.birger, mst,
	netdev, linux-kernel, fransklaver
  Cc: pankaj.m, Maninder Singh

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 <maninder1.s@samsung.com>
Suggested-by: Frans Klaver <fransklaver@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-23 13:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22  7:09 [RFC PATCH v2] packet: remove handling of tx_ring Maninder Singh
2015-06-22  7:09 ` Maninder Singh
2015-06-23 13:53 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2015-06-22  6:53 Maninder Singh
2015-06-22  6:53 ` Maninder Singh
2015-06-22  7:00 ` Frans Klaver
2015-06-22  7:00   ` Frans Klaver
2015-06-22  5:54 Maninder Singh
2015-06-22  5:54 ` Maninder Singh
2015-06-22  6:33 ` Frans Klaver
2015-06-22  6:33   ` Frans Klaver

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.