From patchwork Mon Nov 9 16:56:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 320928 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1890149ilc; Mon, 9 Nov 2020 08:56:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGOmd0ovSX4JPVu9VRlnIACPbtIBxBNKjYF4cLAOpAAzeF2R8kN6jf6wa9OWPv0rRpjcGp X-Received: by 2002:a17:906:7254:: with SMTP id n20mr15128902ejk.382.1604941005347; Mon, 09 Nov 2020 08:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604941005; cv=none; d=google.com; s=arc-20160816; b=UCN7jlM1wyI7dJOJTEEQBUmdkSTRdyAzb4Are6ySomDaphF7oOQVWUSf/KeC0GME7i aMpuQN0f2m5JTGUOah/JPWFZTwsr9yg7ASNLz8oWvnIEQThV0LoklOmMAew32eWkiMw2 aDr8SwXqGXY2fk86Vh6Lm/wsC8m6gc1ALWmRF/5vpA4puPsGp1B1QtT0x9VHSXA7+Oh9 b/nkCsMQ8MMdzJmig2zkIF+BehOerFqrmPW54irQCDjLUzHvSu2qqLr6uXPAo61sbE1+ ttUZZm75kuIJHvKCQAtQQyQf5Pxx5AhTxr8tUqtsP7Xw4mGyRCEsEWOh5ovpcdSzpmsg q3ZA== 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=4yWrXzwfznxNU372UdbxuIAHo54u4g17q1CuRCAU4Gc=; b=Z7NtsOf6hRHtB8mp/NhqJnpw3kUy9eEhsTDTKPtdU41LTTTiambffgCI3QCaHFSb4X tnXBdON7J+5iZhtYOPWmsQiO5dNqOAKejSeeYpiWu2rJHg0x8vJOha03AoDe3ktd8xB9 P8LSwa4fvveE0QazTwABuf4zaw+4jhnYby4+Sqxse2b8k+ccyrPE21uDtLYyw3GHZORh ohmkS14iv7lbv48KF+fcpDUCUWrNFluFYl9Fqb5ZUktVNvPibHF1D5nWHIX7J2Wo3HqU s+dq3GvXw4EEG2bnqGPxxByXUEEE/qfLzXip0G672JfzNiWhtBDNVPrV8AsYZzsIovp/ 06Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jYHzo1/s"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si8159322ejy.607.2020.11.09.08.56.45; Mon, 09 Nov 2020 08:56:45 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b="jYHzo1/s"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730895AbgKIQ4o (ORCPT + 8 others); Mon, 9 Nov 2020 11:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729776AbgKIQ4m (ORCPT ); Mon, 9 Nov 2020 11:56:42 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C162BC0613D3 for ; Mon, 9 Nov 2020 08:56:40 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id n12so10508369ioc.2 for ; Mon, 09 Nov 2020 08:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4yWrXzwfznxNU372UdbxuIAHo54u4g17q1CuRCAU4Gc=; b=jYHzo1/shxPWr7/tBwF8gfq6RrvxnXOGHH/E1Fa7/3/U7/J74dAGnw+6bPfm58XK8n ZF+CsKprjhQtuqJgD302DAM7pr6EE2hBXPfBzcT9d4M3Kwhrh7GqZYPayqPkXNGSIyD3 MYjnueSZFkrqTsjENpheg2B4xQAVsjr9v7io2CHLNjXvmHxC+xeegYgfuXNq5Q4q8tgG OHshgukqDszdWe+IY2PmP5BNiu6ZZla76vGfqwi8FvXEFtQXr0/e7z4B3hCXONTUYIhl e+y/7cT7fePz9PBc3/pFPJ9gJr8VT5u/LEYsB51DPfnXvmJ47W96xAOSDJn2kYKPhuQ0 SAnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4yWrXzwfznxNU372UdbxuIAHo54u4g17q1CuRCAU4Gc=; b=nBcJPlaA9EWJB5VweY3fw1NHoruIZKiqnow2uMYXjUCYJxTefhCCtj180Xhv07toD8 tEdmbYptwFejYvdobqeMaO2oALiYyD4VYlsiztPHGdgU/8+16yU2CyB8IUcSoJhnUltV xN9pdg+spGuXTiUV03l8bnYMXuh2+SS6ALZiFxZ1O6ucOX+pvtc8yeEh1wFneTuZiy6Q Rb98fxhFmk/j6XVeFuWjv68aOV3Ul5sAYybB8CFOex2kaNKcE9pZmjw3ORqKwWAKHPSN TKc3CjWJMxt1aViCR1DD3BGIwNLUl8thwc+MCjn/iOXi003R1ZtLEGiRfZvCw2nnGW3J 8wDw== X-Gm-Message-State: AOAM533YqJEm+EnNHHGSOT9MQIwlKnSVCrI60XIE5EBeLttp+lmeNYCz V5QYaDuLr1DjNFM8rNMAIO0AXg== X-Received: by 2002:a02:cd02:: with SMTP id g2mr11928881jaq.22.1604941000087; Mon, 09 Nov 2020 08:56:40 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id j85sm7576556ilg.82.2020.11.09.08.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 08:56:39 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/4] net: ipa: don't break build on large transaction size Date: Mon, 9 Nov 2020 10:56:32 -0600 Message-Id: <20201109165635.5449-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201109165635.5449-1-elder@linaro.org> References: <20201109165635.5449-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The following call in ipa_validate_build() is erroneous: BUILD_BUG_ON(sizeof(struct gsi_trans) > 128); The fact is, it is not a bug for the size of a GSI transaction to be bigger than 128 bytes. The correct operation of the driver is not dependent on the size of this structure. The only consequence of the transaction being large is that the amount of memory required is larger. The problem this was trying to flag is that a *slight* increase in the size of this structure will have a disproportionate effect on the amount of memory used. E.g. if the structure grew to 132 bytes the memory requirement for the transaction arrays would be about double. With various debugging build flags enabled, the size grows to 160 bytes. But there's no reason to treat that as a build-time bug. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 3 --- 1 file changed, 3 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index a580cab794b1c..d1e582707800a 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -680,9 +680,6 @@ static void ipa_validate_build(void) */ BUILD_BUG_ON(GSI_TLV_MAX > U8_MAX); - /* Exceeding 128 bytes makes the transaction pool *much* larger */ - BUILD_BUG_ON(sizeof(struct gsi_trans) > 128); - /* This is used as a divisor */ BUILD_BUG_ON(!IPA_AGGR_GRANULARITY);