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: 1396918 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jYHzo1/s; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CVHG51jfhz9sS8 for ; Tue, 10 Nov 2020 03:56:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730895AbgKIQ4o (ORCPT ); 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-Google-Smtp-Source: ABdhPJxvcCfXLOJfmraw+ovVfPKnpgsipKccPYgqGzi70V4WprW2vxvAfS7xedEDe5hPuFXlH8YgSQ== 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(-) 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);