From patchwork Mon Oct 24 05:17:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gobert X-Patchwork-Id: 13641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2917033wru; Tue, 1 Nov 2022 05:08:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BUIA2CfTZa8vpyVNvrHK5PsUsemvwn4ybc//wpytSYSf6vNa5I/f5aS6RmOQZPmpRpdLv X-Received: by 2002:a17:902:a502:b0:186:aed2:f69d with SMTP id s2-20020a170902a50200b00186aed2f69dmr19446469plq.46.1667304505852; Tue, 01 Nov 2022 05:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667304505; cv=none; d=google.com; s=arc-20160816; b=WfNXa7OM5c37CsH4JkH2GLlHpbSfrD+jGnT8Yj3fNNI+y4HsQkxOgrF0E6IrLqeJqk Iqkh2NE1d44ErKTyEqGjBPCNwZCzlR18mtBj+PVb3lnkEktYufp0bQX1d5vAuPl/x45M D4AB6C47BJiIizw/qrDu5W1JJhrwJAcq/blnh4lPQySQEgAu3aHj4Mg4js2W8aWdK9MV ly1zaB0TH/e6foaQFa5Kvd8kmJwWy1z1HQWspuDfmZmoJiFVuQsN2BxXanYoIE3LduLu FeGLFmrCLhYa+SakzGijIR+RkRNjo57y3jN86qD6N6vWuEK1w90RBW/8yokjNGxDK9zp hZlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=dDiFLbcCPs9I3+qSQ2/UHfejkBwzWQ533NU4ZUsGCPY=; b=A+NcvOim+FNXcLs7LAj26Mug5h7BLpJMSy1y2jWA3l6UONDFZ72V0JVdsf/jgqkoCw spBGwXejzXfvcrcq80BXYMSzz6tA/ETymSv6/RidV/o6LH049p5CuIDD05w7uibCMESr iQ44IwG1HlCxPEQVfO1Rao/WxzhGfrAhoE7Vva8YlLXa3LmzCjHR8wh1i1Eiiro6Nf0w Rxyd/mlIlQAcEhAQ8TrWQv08R9fv4l9ZpGDQc8zA5rsLpNB/kxcihWbZwhnKFDuz/wC6 EocFCtviB5PTUT4zLyoX43xB9cY5zBlMHidTxgmc8xl/2agBMOwTJ52vifKmhy5Ydsa9 bVTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AECDTUUM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a17090341c800b0017f5ea2e8easi13672054ple.357.2022.11.01.05.08.11; Tue, 01 Nov 2022 05:08:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AECDTUUM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbiKAMBn (ORCPT + 99 others); Tue, 1 Nov 2022 08:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbiKAMBk (ORCPT ); Tue, 1 Nov 2022 08:01:40 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5630A63F0; Tue, 1 Nov 2022 05:01:39 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id h9so19857368wrt.0; Tue, 01 Nov 2022 05:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=dDiFLbcCPs9I3+qSQ2/UHfejkBwzWQ533NU4ZUsGCPY=; b=AECDTUUM7wPd78XMLMkzvlsVEc+oowtP7u+lfBMn+oxn2MelQNpZ5WiTFK+33zC9oQ AoIHVqndwGCRvMZwS0ecfzu2a1jw0yI15Y+BULVfPJQNRQIcq13MojBOtutuZIj5W+V/ GaZH5hxLK5yG9DZKgcgNu6/WqrUd7+meIfaLdVf96San3sh8Nxy9Mej8yr+lcIKGiqX7 80MxdWmkR0YhVa/FrIi3kIZvXHLjsusAGUrPXZDRdJ4Rzo0RLyoLOZyIQgm1N9F8I1HI zVRSO+lZurvyBZ8qJrme6uzzK7Ewv+LR4m97k8uKsXnLeKURdMMTU/qMEXRDrpJUTytB PrxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dDiFLbcCPs9I3+qSQ2/UHfejkBwzWQ533NU4ZUsGCPY=; b=GGvcz1uauXsZIaX7KvpyKauRp5Pgrhe4CXWR7HrcgoL1dgxopmUsU1DA6p8fyEBfdx n7bC4foXOQudM26Ms72mIyc0hRbmeDMtlTPnwGxRhOyrFdJtwR6QDxqfuWx+1d85n9UK p16sEOZuOJncVSa+iobcmLa+rxr1QNGNZjsd9zvFD3jyFFYy4p8VcvOat4Wu5cn8Mdiz jEXN0F82btvYFsm60ZiumA/02IM94Zu8uRUJZsWKg43cD1W3g/vYvcHcD7pEm142JEy7 WaB6kN8gD2CLFrF6Nt47ahEfT4zoJm74MX2ZFEpDsQw0rKgTdKOPbUK4PqjfsIdj19ax 2lqg== X-Gm-Message-State: ACrzQf2leJwQBrEoNNXy6eAZwVXfv5kaR8EwtTzIjekhhAaJHgzl00DB rPSKsuz/DuotnXFQRCxqyxk= X-Received: by 2002:adf:dbc5:0:b0:22c:c605:3b81 with SMTP id e5-20020adfdbc5000000b0022cc6053b81mr11287837wrj.218.1667304097843; Tue, 01 Nov 2022 05:01:37 -0700 (PDT) Received: from debian ([89.238.191.199]) by smtp.gmail.com with ESMTPSA id m13-20020adffe4d000000b0022afcc11f65sm9911489wrs.47.2022.11.01.05.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 05:01:37 -0700 (PDT) Date: Mon, 24 Oct 2022 07:17:49 +0200 From: Richard Gobert To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lixiaoyan@google.com, alexanderduyck@fb.com, richardbgobert@gmail.com, steffen.klassert@secunet.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] gro: avoid checking for a failed search Message-ID: <20221024051744.GA48642@debian> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_96_XX, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748295489087086103?= X-GMAIL-MSGID: =?utf-8?q?1748295489087086103?= After searching for a protocol handler in dev_gro_receive, checking for failure is redundant. Skip the failure code after finding the corresponding handler. Signed-off-by: Richard Gobert --- net/core/gro.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/gro.c b/net/core/gro.c index bc9451743307..a4e1b5a5be64 100644 --- a/net/core/gro.c +++ b/net/core/gro.c @@ -522,13 +522,13 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive, ipv6_gro_receive, inet_gro_receive, &gro_list->list, skb); - break; + rcu_read_unlock(); + goto found; } rcu_read_unlock(); + goto normal; - if (&ptype->list == head) - goto normal; - +found: if (PTR_ERR(pp) == -EINPROGRESS) { ret = GRO_CONSUMED; goto ok;