From nobody Mon Feb 9 22:23:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620249102; cv=none; d=zohomail.com; s=zohoarc; b=Ui3vwkEEe5I0e+NVzYhsbhER6o+t7hqIyNEuB8fAyZZjKn3/2X6Z9u31wxPjVu1k1d1aFbONhwt5ete81/laaJ1WRZAPqNlIn1QRmq2VA1/ztMlv7PFlffC/noVL9wpQk+WyZ6+4rDcWXQDobmczL5rP5wyyCu4bX+XHm5aHXXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620249102; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=okjMXaVx8fDoFf7fItgqe0Cv4qcw3tBNnKOpyhy+thg=; b=KSpYdG8lEza09gIemQefeEKzixS4S3kBFw22+efhcSdyQACtXbS5ZJB0mOyH0ojbFjoq3Me9P4ataaEmBuVNr+HyrlfVY2qEWewnZNP7LmY1+XoRcScK76Jh/dNAMzpS1Do46+TeAQ7K0NWIMDCEyRyOi/49asf8HBq7BdB4om0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620249102152392.13019343243616; Wed, 5 May 2021 14:11:42 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-VWsuiJahOB-A-YrvLRGuuA-1; Wed, 05 May 2021 17:11:37 -0400 Received: by mail-wr1-f70.google.com with SMTP id q18-20020adfc5120000b029010c2bdd72adso1209035wrf.16 for ; Wed, 05 May 2021 14:11:37 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (astrasbourg-653-1-188-220.w90-13.abo.wanadoo.fr. [90.13.127.220]) by smtp.gmail.com with ESMTPSA id b8sm731588wrx.15.2021.05.05.14.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 14:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620249101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=okjMXaVx8fDoFf7fItgqe0Cv4qcw3tBNnKOpyhy+thg=; b=gFFejwEdZaXFgMC7PwwxejfSWJid+OyH3lJJRJn4/7WpDm4RAn4WfZZO5FdZq2kipPvwZy ti2b/0pnFzouGmBY2LZNGiQB08+mlJ6mK1xuj7sTXPNVwqL5FfLcISvd2VV3lQ+9W8+8l1 eNBDbALszvQiwDKLDW9sd9szFnSJEUU= X-MC-Unique: VWsuiJahOB-A-YrvLRGuuA-1 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=okjMXaVx8fDoFf7fItgqe0Cv4qcw3tBNnKOpyhy+thg=; b=dUtk4af2cEU9zF3GQTmXRjuLYB0iV75yoqOMVoofvOovUCEk/H29bqBSa/PlpRu0hE vJ512Kd7H28u/WqFLCd04ZVL1v3rPisfvnZQmgDztCR3IIVNvz5enK0bRgbsUNgkZw45 g9Uo5r7g8oj+rw1jDier2nprIJEL0BHjxbHcfcOwe7Mt9hbDNuoWevo0BuIKr5Am1i18 IXPIJD3XPTRgUaS6Mz+6MGzomgkLXVGo8Pym57ijmqB0fE+PI+GecmuGuDPvE0cvi5pJ 6uUk4CaSWAiBlhYPcaCgvUqj27kGln2zMXpNj0pC7IpDu57qNRGLmh4jD52y3D0S6Ixl 37hg== X-Gm-Message-State: AOAM530yPS93iWVdJ3Fol2OslAOw8GoUaBFi7j80dVB0I1VSpylzB/pC 4A1+8+iknjlVzlWomfs+m7vTg+g0MwaxdrSgySwogk9IMpwC+N6npFIxMxFBRlQ5T4iVyvoz52O FekTzTIaUI6UL5g== X-Received: by 2002:a5d:498c:: with SMTP id r12mr1052493wrq.31.1620249096458; Wed, 05 May 2021 14:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygKaQEFEtv8AaUMv9HVvDd6sZKBrSj7AlKCgqWQrVlPcb96sC0MDFakbG/VDWfABiIy17/3g== X-Received: by 2002:a5d:498c:: with SMTP id r12mr1052482wrq.31.1620249096339; Wed, 05 May 2021 14:11:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-ppc@nongnu.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Dmitry Fleytman , Jason Wang Subject: [PATCH 09/23] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation Date: Wed, 5 May 2021 23:10:33 +0200 Message-Id: <20210505211047.1496765-10-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210505211047.1496765-1-philmd@redhat.com> References: <20210505211047.1496765-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The compiler isn't clever enough to figure 'min_buf_size' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Jason Wang Reviewed-by: Richard Henderson --- hw/net/e1000e_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index b75f2ab8fc1..4b1d4521a50 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -1621,15 +1621,16 @@ e1000e_rx_fix_l4_csum(E1000ECore *core, struct NetR= xPkt *pkt) } } =20 +/* 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 =3D (14 + 4); - /* Min. octets in an ethernet frame sans FCS */ - static const int min_buf_size =3D 60; =20 uint32_t n =3D 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; --=20 2.26.3