netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Willem de Bruijn <willemb@google.com>,
	Mahesh Bandewar <maheshb@google.com>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 8/8] net/packet: introduce packet_rcv_try_clear_pressure() helper
Date: Wed, 12 Jun 2019 17:11:31 -0700	[thread overview]
Message-ID: <87imtafioc.fsf@intel.com> (raw)
In-Reply-To: <20190612165233.109749-9-edumazet@google.com>

Hi,

Eric Dumazet <edumazet@google.com> writes:

> There are two places where we want to clear the pressure
> if possible, add a helper to make it more obvious.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Suggested-by: Willem de Bruijn <willemb@google.com>
> ---
>  net/packet/af_packet.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index d409e2fdaa7ee8ddf261354f91b682e403f40e9e..8c27e198268ab5148daa8e90aa2f53546623b9ed 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -1271,6 +1271,13 @@ static int packet_rcv_has_room(struct packet_sock *po, struct sk_buff *skb)
>  	return ret;
>  }
>  
> +static void packet_rcv_try_clear_pressure(struct packet_sock *po)
> +{
> +	if (READ_ONCE(po->pressure) &&
> +	    __packet_rcv_has_room(po, NULL) == ROOM_NORMAL)
> +		WRITE_ONCE(po->pressure,  0);

Just a couple of (microscopical?) nitpicks, double space here and on the
commit message of patch 1/8.

Series look good.

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>


Cheers,
--
Vinicius

  reply	other threads:[~2019-06-13 17:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 16:52 [PATCH net-next 0/8] net/packet: better behavior under DDOS Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 1/8] net/packet: constify __packet_get_status() argument Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 2/8] net/packet: constify packet_lookup_frame() and __tpacket_has_room() Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 3/8] net/packet: constify prb_lookup_block() and __tpacket_v3_has_room() Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 4/8] net/packet: constify __packet_rcv_has_room() Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 5/8] net/packet: make tp_drops atomic Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 6/8] net/packet: implement shortcut in tpacket_rcv() Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 7/8] net/packet: remove locking from packet_rcv_has_room() Eric Dumazet
2019-06-12 16:52 ` [PATCH net-next 8/8] net/packet: introduce packet_rcv_try_clear_pressure() helper Eric Dumazet
2019-06-13  0:11   ` Vinicius Costa Gomes [this message]
2019-06-12 17:15 ` [PATCH net-next 0/8] net/packet: better behavior under DDOS Willem de Bruijn
2019-06-15  1:53 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imtafioc.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).