Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6372334ybi; Wed, 29 May 2019 06:58:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVt7wdiqdRrO9eqBXW+xYjc2jXd6uy8cQ22gkwZqoNUin6x0REzm2mRVSMLC9DnJ1GaaLU X-Received: by 2002:a62:d41c:: with SMTP id a28mr51573000pfh.31.1559138323603; Wed, 29 May 2019 06:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559138323; cv=none; d=google.com; s=arc-20160816; b=TZyZA8MCqnvXJ8tTg/h+EnI6SxHelkB7G1VmFdQryV8sW+BZ44A7sYD2LPQUgRG5uF Qzm24wEtTbKhpDOjzT7y18+fJ3L8hmGjvinj+XYA7JKCYP9+OI5+4RXtZiH88DCRZKr7 d8bNM6cSr36zIVp8MvfsJNkUAthgUp9lZN1Hh03zwWr0Bt2wn0vnP8I1uCkJalxdHVKt 8y41H/rOtYS1jI1OAvw13NduCJdGPUM7lspJiHlB4rGhEyKPsvv2rHntdDA9qHX/0BSq jsrYDAn6k0OTBA/nWkOV/BHRKo42KvuagOJOkj3WFXpmufuZtwC2z9ddJbgCecd3jLKQ jJPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=LbTz9QfJWMgyv4fipzRBw0f6ydNdnq7zYT3VxBkO7bw=; b=UZ6ySne9DdhTby0K5maXNUOjC9u2dUKDg32PbQgg5VstS+1SWoSFV2+6xyNcwKMoKX ohxML81jK5OHgYCytKAlyRdySEBI8wo6KF1ojMHVQtK5GNxOaQku0I7CktBlh9nIjv6A Do0I373ApB21BxrsbQJIHK35a8M6mPU16PfHbKP207hi80rXtfR3WuJKJd2FORW+px3V cl/JAlwS1Hco3zpNjtYRE+aUd2Pg5ENzZBhh+NiJTeLmfJSk/obGT9wr62TjC9NpiUFv 0XruMxweSVlL3wXIl7p6q7mHijwB2Sy0kQ1gbiN9s+7/JJrhzgCRs2ZlOIF8KXR12l5w EK9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si11358563pgj.257.2019.05.29.06.58.24; Wed, 29 May 2019 06:58:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbfE2N5L (ORCPT + 99 others); Wed, 29 May 2019 09:57:11 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:32860 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbfE2N5L (ORCPT ); Wed, 29 May 2019 09:57:11 -0400 Received: by mail-lf1-f67.google.com with SMTP id y17so2182322lfe.0 for ; Wed, 29 May 2019 06:57:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LbTz9QfJWMgyv4fipzRBw0f6ydNdnq7zYT3VxBkO7bw=; b=it/+scwZRNqk3BIUV2qDMTpdIRPz1/xnNmQPf8Lx/5XAHT+ma5DD8LJlS7niJdC6zM bei2D8bZh0lknFB29jIEwnoSZFL3UCV9RJQXIXGFjSZ8mX6MJLh7qjFkqgUhWjWh4aGw plgUAbH+Nyk+/TZMtOsnl8oCl1hYlzfA/O4rMWIwckrSPDsawOvPcEO5Lu1qbXkVwPdw JfcRePInhC8Xee6CpLNgiIKljSiihSTOF3SHo/2RYxN3z0K4mcIHe5tYLZH49ZGLFMwp +MdOlorJhwLjYMtX7/6jRvclCdfSxi5l5aGa23W57anUVI8U9D03jZGGJGSFRifgwxnt zQ/g== X-Gm-Message-State: APjAAAUjHsP0EYg9osM60qOVzKrW3Habpz8Y7oWPJrEIl9P8v6mB80jk G6NI7cpVjpTiRDRTwjVZZo6H0YOKs0ebeBiSqwCgtA== X-Received: by 2002:ac2:429a:: with SMTP id m26mr3191323lfh.152.1559138229226; Wed, 29 May 2019 06:57:09 -0700 (PDT) MIME-Version: 1.0 References: <20190528235844.19360-1-mcroce@redhat.com> In-Reply-To: <20190528235844.19360-1-mcroce@redhat.com> From: Matteo Croce Date: Wed, 29 May 2019 15:56:33 +0200 Message-ID: Subject: Re: [PATCH net-next] net: avoid indirect calls in L4 checksum calculation To: netdev Cc: "David S. Miller" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 1:58 AM Matteo Croce wrote: > > Commit 283c16a2dfd3 ("indirect call wrappers: helpers to speed-up > indirect calls of builtin") introduces some macros to avoid doing > indirect calls. > > Use these helpers to remove two indirect calls in the L4 checksum > calculation for devices which don't have hardware support for it. > > As a test I generate packets with pktgen out to a dummy interface > with HW checksumming disabled, to have the checksum calculated in > every sent packet. > The packet rate measured with an i7-6700K CPU and a single pktgen > thread raised from 6143 to 6608 Kpps, an increase by 7.5% > > Suggested-by: Davide Caratti > Signed-off-by: Matteo Croce I found a build error with CONFIG_LIBCRC32C=m: ld: net/core/skbuff.o: in function `sctp_csum_update': skbuff.c:(.text+0x2640): undefined reference to `crc32c' ld: net/core/skbuff.o: in function `__skb_checksum': (.text+0x2aba): undefined reference to `crc32c' ld: (.text+0x2cf9): undefined reference to `crc32c' I have two possible solutions for this: - use INDIRECT_CALL_1 and leave the SCTP callback called by an indirect pointer - use IS_BUILTIN(CONFIG_LIBCRC32C) around the sctp_csum_combine usage I'm more toward the first one, which will also avoid the net/sctp/checksum.h inclusion. -- Matteo Croce per aspera ad upstream