From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27507C31E49 for ; Thu, 13 Jun 2019 17:00:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED09B206BB for ; Thu, 13 Jun 2019 17:00:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730793AbfFMQ7r (ORCPT ); Thu, 13 Jun 2019 12:59:47 -0400 Received: from mga17.intel.com ([192.55.52.151]:54789 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729807AbfFMALc (ORCPT ); Wed, 12 Jun 2019 20:11:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 17:11:32 -0700 X-ExtLoop1: 1 Received: from ellie.jf.intel.com (HELO ellie) ([10.54.70.22]) by fmsmga006.fm.intel.com with ESMTP; 12 Jun 2019 17:11:31 -0700 From: Vinicius Costa Gomes To: Eric Dumazet , "David S . Miller" , Willem de Bruijn , Mahesh Bandewar Cc: netdev , Eric Dumazet , Eric Dumazet Subject: Re: [PATCH net-next 8/8] net/packet: introduce packet_rcv_try_clear_pressure() helper In-Reply-To: <20190612165233.109749-9-edumazet@google.com> References: <20190612165233.109749-1-edumazet@google.com> <20190612165233.109749-9-edumazet@google.com> Date: Wed, 12 Jun 2019 17:11:31 -0700 Message-ID: <87imtafioc.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, Eric Dumazet 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 > Suggested-by: Willem de Bruijn > --- > 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 Cheers, -- Vinicius