Message ID | 20220819153931.3147384-6-peter.maydell@linaro.org |
---|---|
State | Handled Elsewhere |
Headers | show
Return-Path: <qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: legolas.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=GzQ3s7s/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M8Qxy5RF4z1ygl for <incoming@patchwork.ozlabs.org>; Sat, 20 Aug 2022 01:43:02 +1000 (AEST) Received: from localhost ([::1]:60324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1oP49E-0004EA-LO for incoming@patchwork.ozlabs.org; Fri, 19 Aug 2022 11:43:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1oP46A-0005h7-8t for qemu-ppc@nongnu.org; Fri, 19 Aug 2022 11:39:50 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:45001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1oP462-00064U-Qr for qemu-ppc@nongnu.org; Fri, 19 Aug 2022 11:39:48 -0400 Received: by mail-wr1-x429.google.com with SMTP id k16so5598905wrx.11 for <qemu-ppc@nongnu.org>; Fri, 19 Aug 2022 08:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=cl6TQtvSxV7arO6sC6GB32F3upDS/NEMszQzruWKRcc=; b=GzQ3s7s/pWvsd6xhdPcB3eBKkYXcfsqDGmDVT8dxc2wkiCmXvGWd7kvqe9NWkJXLPX NKnrPdGuCVzZiA5wN2cblqU4HT9GVNWZkSOuBpCgMJtajE3JXtFpedUiX3g2BEY1OFUM ErwfA29zDJNGM5QNSaHdqZI1nqY0QiL0WkkFAwle52+JMtbAMQ/Sl8TJb9ECvT9z0saB Y8nGNDAJZTBcYs3EN54mB7+P/SZNpIAkMF+awJyvh3+mw4++mtCwfvF4AC5bGhcf1obs O7ILTvvW2eo0e4IMpM2nRn4iFbXpOIvw22+d+vagUC53fQRxrc/1/NXaHMwE6Jb1t5kA e6Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=cl6TQtvSxV7arO6sC6GB32F3upDS/NEMszQzruWKRcc=; b=XSyoy+LBgZC0ZTjK7tWabmAVucuMuxNv7yRZKB0foIOi9ys8V40+y3X8gpxh4WL5lZ zSBuumsYlGuUxUewYBLS9U/aGL1ahkoWs/J4h3Y/fwp3QKQPVBtZNf5ErKAsPQe30EIB qukymQxyWk9Zz3//NWjEMCbHVUjymN3xocwHmmI53lS7KJWvgMxrDxVqn0rj2+e/cYex IsSdjgTxN/HlGC/FBwxPAOkU0zJA19RyqyYb4vkBl5xEkTu4isqb5Sv4G0DFUWdE1dDf 6PwSJRfbDSQeJLo8PjJB5f1d8j4ozdICKBfbE6pwc39fdfABHj7o0RfSHD+h/MGYzu5h 2QKA== X-Gm-Message-State: ACgBeo1o9mIjVK768fQm7ca2ulKfQaL2ulr5NPiwDoEYqZd4ahgmc7lR yC9EaVpyS8QZaRsxIQnJf5sfyw== X-Google-Smtp-Source: AA6agR7o9oiM5Ax5NWGoLwW4ocg8WHS1lP829SnIBrG4qeMikWn2BpkhDwixaCAOF1QR1luBKp7KVg== X-Received: by 2002:a5d:6c6b:0:b0:225:dde:ab40 with SMTP id r11-20020a5d6c6b000000b002250ddeab40mr4611589wrz.690.1660923581387; Fri, 19 Aug 2022 08:39:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi13-20020a05600c3d8d00b003a54109a6a0sm5558396wmb.3.2022.08.19.08.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 08:39:41 -0700 (PDT) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>, =?utf-8?q?Marc-Andr=C3=A9_L?= =?utf-8?q?ureau?= <marcandre.lureau@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, =?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= <berrange@redhat.com>, qemu-ppc@nongnu.org Subject: [PATCH v2 05/11] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation Date: Fri, 19 Aug 2022 16:39:25 +0100 Message-Id: <20220819153931.3147384-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819153931.3147384-1-peter.maydell@linaro.org> References: <20220819153931.3147384-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-ppc.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-ppc>, <mailto:qemu-ppc-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-ppc> List-Post: <mailto:qemu-ppc@nongnu.org> List-Help: <mailto:qemu-ppc-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-ppc>, <mailto:qemu-ppc-request@nongnu.org?subject=subscribe> Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-ppc" <qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
misc: Remove variable-length arrays on the stack
|
expand
|
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 208e3e0d798..82aa61fedcd 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1622,15 +1622,16 @@ e1000e_rx_fix_l4_csum(E1000ECore *core, struct NetRxPkt *pkt) } } +/* Min. octets in an ethernet frame sans FCS */ +#define MIN_BUF_SIZE 60 + ssize_t e1000e_receive_iov(E1000ECore *core, const struct iovec *iov, int iovcnt) { static const int maximum_ethernet_hdr_len = (14 + 4); - /* Min. octets in an ethernet frame sans FCS */ - static const int min_buf_size = 60; uint32_t n = 0; - uint8_t min_buf[min_buf_size]; + uint8_t min_buf[MIN_BUF_SIZE]; struct iovec min_iov; uint8_t *filter_buf; size_t size, orig_size;