Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5818982pxb; Wed, 26 Jan 2022 23:28:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZV6hbZcgprqNd/R0gGfmhTD5h2J2j5o0U9VYnoOtpnrGuWltPM/JvNAhjy1aAwccju3JP X-Received: by 2002:a17:903:124a:: with SMTP id u10mr2647434plh.63.1643268526839; Wed, 26 Jan 2022 23:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643268526; cv=none; d=google.com; s=arc-20160816; b=ivxCuXPuSBID25hlb0GVS3kpppRDaVLMeIQ1zN9xQjayNDdA9JI1d78cumc/ABtdKu 6cnKvYQ53O+a0cF4H3986hfzPvPNpZPBq1HEaEA/XKvAB6SqyNW4MNu4tVtylhk2ABHs 2tvjyBnb3DpwN0NhtsH++eNzD1ySUnk1G4g2kFBgy77pA/TqEApXTr9ostSUe/4tam5R PVLNZb0VNNGC5RmFJYc11BDxX+n6ypMUi4pt6ckhzUP30bJbz8lqb9t47yy9TH7Z1y2H Le157KNWWOVSdyVWyWkbn23EKjm/8ZFQGW9GEGTQ0SzbbxHDIADtADUtaQoSB27J3NZy 9OBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UxDNgTAE0cSB8ZQYqqnLx7ARkRkGdeZUWmVAeW7wE8w=; b=HoG4mgkRi4DcEsFXeHB6RPAAhVqQztYI8P7uQGkLXdHyOlyTMPHohKlb6kQAC9H3r1 l3zbl3/hrNWIcZDiLlpz3sjsvkgVy5XFTzZtiAx2SOJdtbO0JHMSHfuiv2dMoBoFnrGk aZqRyIuM7tlR5EdWlCwiWG+Rz8rvs31ufkWNRT17ebb37lVcwzYXx/FiBYuOSFoSya0Q GqWK7W/UVHptskq8prAcCZv/CZhLHDy2eY8Zu21SOUbnhimdLoGZaU6rWsERnnKa90jA lfBnpM5cWXuUyGAHdiWzJN/Il7aALvt0v/OWfGcZEZnSIxVGu3TZm2ihJ4qTAQtdIPEm 3vcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UxNN2e4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si1606416plh.396.2022.01.26.23.28.35; Wed, 26 Jan 2022 23:28:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UxNN2e4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233985AbiA0Ags (ORCPT + 99 others); Wed, 26 Jan 2022 19:36:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233952AbiA0Agl (ORCPT ); Wed, 26 Jan 2022 19:36:41 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE137C06161C; Wed, 26 Jan 2022 16:36:40 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id p12so1391900edq.9; Wed, 26 Jan 2022 16:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UxDNgTAE0cSB8ZQYqqnLx7ARkRkGdeZUWmVAeW7wE8w=; b=UxNN2e4QMjiLRB3KjFk+d0964K5zS0bXfNJq5W2+9QhwH7rL8wHwommwe6im9aR0AW d+tb1OD2FL48Ue8s8kgOEq0lGC1BKcGReMkE2NUl0EP2iHQmm6n+7cgzkchvY60mB7TX CcGrk9IDvDPw/nKbBiEb3GmJF3FDr+PdQU0p2ogqN8nq3drU/dhrN3dsUG9+7+ysLRHc 3JNN8rFwme1Gw4O85Jv/U5yEB5JsVa0NYWM/2VBvI4cLSnYmdTaWBdQAt42v0OBEw8Xr qhnlmOZUxIgwmp92EIscfExtu1NPReSGR1k0nAUlRtueAL6fA3tfQj/8TBysIjZO/7kO ostg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UxDNgTAE0cSB8ZQYqqnLx7ARkRkGdeZUWmVAeW7wE8w=; b=nfNy/UyAvrGe91dPOAcU9R7ZLpwyH96kL4W/B8UfoxVGo0BjEEcIcOUG03K4GVxjKK crQ3dYh5VwBxg6QzgE7m9j0Yo/VM1XD83b7hFEKV8s6KXvQ/te2jQNrf7yW3QtkIqJaZ Wek214noTo3xBmoocz8vxO3Gj6g5x/J13J+a16GMGBYyhXsdREV+a1/ROYmUljcVh6bl nbQlFtQUGc4/gxmmacJIP3oW+f2Ze/hGt0mZlZrd6su/CT+Lwp69ALOnKXAXXBDWVeK4 4hhoTXlqd39GWoZUtxv/yhuBjmGceFE6TQXQaJa3DOsYYbc5ElUrFijHJVaoJ5y3DXDo ct7g== X-Gm-Message-State: AOAM531wtpUjBivDqd4IbxPRQL86w12wXZPRRywfz74LoLDBOUTUA94z thTGyY+wqvXe+DbQjz3CofX2szqcqU8= X-Received: by 2002:a05:6402:2898:: with SMTP id eg24mr1456329edb.142.1643243799013; Wed, 26 Jan 2022 16:36:39 -0800 (PST) Received: from 127.0.0.1localhost ([85.255.234.222]) by smtp.gmail.com with ESMTPSA id op27sm8039235ejb.103.2022.01.26.16.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 16:36:38 -0800 (PST) From: Pavel Begunkov To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski Cc: Eric Dumazet , Willem de Bruijn , linux-kernel@vger.kernel.org, Paolo Abeni , Pavel Begunkov Subject: [PATCH net-next v2 02/10] udp6: shuffle up->pending AF_INET bits Date: Thu, 27 Jan 2022 00:36:23 +0000 Message-Id: <54bfbd199f8e371333082a123de432211248eaae.1643243772.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Corked AF_INET for ipv6 socket doesn't appear to be the hottest case, so move it out of the common path under up->pending check to remove overhead. Signed-off-by: Pavel Begunkov --- net/ipv6/udp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 528b81ef19c9..e221a6957b1f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1363,9 +1363,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) } } - if (up->pending == AF_INET) - return udp_sendmsg(sk, msg, len); - /* Rough check on arithmetic overflow, better check is made in ip6_append_data(). */ @@ -1374,6 +1371,8 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; if (up->pending) { + if (up->pending == AF_INET) + return udp_sendmsg(sk, msg, len); /* * There are pending frames. * The socket lock must be held while it's corked. -- 2.34.1