From patchwork Mon Jan 8 15:41:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 760780 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp948196wrz; Mon, 8 Jan 2024 07:42:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQx7DRBpjDUNnEeAnzKMPbUX8WEoVoWVfS8ymLQ2n8pegufYmYusiOylDyxRMK3OF21vKN X-Received: by 2002:a05:622a:5c9b:b0:429:8bdd:c04e with SMTP id ge27-20020a05622a5c9b00b004298bddc04emr5207834qtb.63.1704728534612; Mon, 08 Jan 2024 07:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704728534; cv=none; d=google.com; s=arc-20160816; b=rLDSYwoloI4qhnjKCxclyemcF6svTDvaDr5M7KhAhu3MAJOA97QC61J6C7kV3fORBY EEzbOkHh36uG9mzxIsnlFAI2JWWkXaNrM8RFrs16HzQEIT6Scro4yOgOYKgdYK1STGFJ 99NJOPQ80tbtViUHUOYf/afTRXrW3EHNsk6JDMLIATegjQ5Xl4oq6eLKUZBeFEFwqJ3/ sCzO/FmTS3iPAH+qmVE5EY6AfNsuZpkK7Byk/d9ATHRjSVOOo+9cnzz7iXnLJdhduiH0 WVtU1v00zJVSwbaYhOteyKSMY8CXi4VVKPUu3svoW/n0oqTDXUAolQH1rcf1QjUC5EPP o7eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; fh=TaUyCdJyxT89iWOiEV2W2xcUaxU0N6MwaKLWYqTePQE=; b=q4hxsaDtkpgok1wFBwvT/1enNdLdqACY5W21yWc8qvb06hjMY4ObLVtZZ4/q6IEKQS LO0QL8FfyBx5WQOWzcU308sF79Fsj7o68opfqc6luCSdOOAH2GIwXzjIU5MaSXQAkxEb Rmdj0qFF0hfWCfCU+khwkZTmx2+Lwk4Dq8qO4JbYt83YB3fJFO0FlBlhUMFfNQkBkUmD UH9Mdb5UGTn9lRSaiBqkhbL3dQhzZziANErEL+EL4jwyUrvkgw5fND6+N7PLCEycqkVZ UTrNykXXtH7OBy7gwkFa0zkGpA65benkQJ5u2f6qfD5H+S4tEVH+IZQcpkDwGzaRkiOf 5S1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j8InsCNr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 18-20020ac85912000000b004279142b1bbsi7987183qty.465.2024.01.08.07.42.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jan 2024 07:42:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j8InsCNr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMrkt-0000aS-2t; Mon, 08 Jan 2024 10:41:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMrko-0000YF-F6 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:41:31 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMrkm-0001SD-G2 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:41:30 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33765009941so1622782f8f.3 for ; Mon, 08 Jan 2024 07:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704728486; x=1705333286; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; b=j8InsCNr2tKOzvyLiaSEr24bZXrMCLN/8vnu7ggvl06qOUwNIMe3WV//oJEJDZA2ka Zv7tLZHC3xanz63b9UfDzsX0eOukoAvPrji7O0CsAmlMX8bkPSRC0XS1Njhqq+gzpv3i IMqaKiqAadiaK/6LdbZZ1OHCFr+TGSG6jP7UPVnl3KCYvv8mW4Zq6nWNws5VlCW+MHGx FM+ZhgHs5vlb+zKN+rbTG+xUShfstepbU4WMGC1CR5FfDolGiA37zFIYzXX/XWHh3CMH 8YQheqm+ifGnyPulbweRK+8xuUkCTEtuTysrVDRiwLUjwvnHt9snZRMieS2ArogxVhOz DeLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704728486; x=1705333286; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OgFybPQwNuMp3NAFbCe3JoR0imHvNQVIavgG+VFaK5A=; b=upi7EctyA7SU5BRtHpR8ofRtS+6O1HiJtWlYiKKQjF7mCAlVOAfzodKCtDlbOauE1x VVWHstavVYpDtb8awwE/Ui9XiFA4kPGavIe4hUVodl14+jtOuFgoB6PZgACDxqlbSR5c ndboD2FX1V+l/zGynnDapM278lPcXjIn15dsOrJ+gpzIOwinnjIDL8n3r5iw359Fpq9Y EvvfD97SDxsxaD5318U5z0NV6jnNxlFGOYTAvGEEfsgboJ7/amsixglHS7GQNLn023op qQBUKZArD10MPdEfZRlYI6mseNZ/hGmPMde0oOGE91yqRPGX6ABQ9qUyF2zK0NgzbjZW 6JUg== X-Gm-Message-State: AOJu0Ywou+6AMVWT6ioKV9ugQWwgmkvprB3b+B0Pw+udrulHroIlfou2 Nb7OpFRQWtz+VrWb+3iXduvpnFIryIAYkpi/TenhLXPHz9M= X-Received: by 2002:a05:6000:14e:b0:337:2940:ab7b with SMTP id r14-20020a056000014e00b003372940ab7bmr2615978wrx.1.1704728486010; Mon, 08 Jan 2024 07:41:26 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.62]) by smtp.gmail.com with ESMTPSA id f12-20020adfc98c000000b003366aad3564sm8100493wrh.30.2024.01.08.07.41.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 08 Jan 2024 07:41:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Dmitry Fleytman , Bin Meng , Jason Wang , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH] net/eth: Have eth_pad_short_frame() take void* arguments Date: Mon, 8 Jan 2024 16:41:23 +0100 Message-ID: <20240108154123.53680-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Any kind of buffer can hold an Ethernet frame, no just arrays of unsigned chars. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- include/net/eth.h | 2 +- net/eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/eth.h b/include/net/eth.h index 3b80b6e07f..d73737f07d 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -434,7 +434,7 @@ eth_parse_ipv6_hdr(const struct iovec *pkt, int pkt_frags, * @pkt_size: size of the original Ethernet frame * @return true if the frame is padded, otherwise false */ -bool eth_pad_short_frame(uint8_t *padded_pkt, size_t *padded_buflen, +bool eth_pad_short_frame(void *padded_pkt, size_t *padded_buflen, const void *pkt, size_t pkt_size); #endif diff --git a/net/eth.c b/net/eth.c index 3f680cc033..25c6eb9b20 100644 --- a/net/eth.c +++ b/net/eth.c @@ -520,7 +520,7 @@ bool eth_parse_ipv6_hdr(const struct iovec *pkt, int pkt_frags, return true; } -bool eth_pad_short_frame(uint8_t *padded_pkt, size_t *padded_buflen, +bool eth_pad_short_frame(void *padded_pkt, size_t *padded_buflen, const void *pkt, size_t pkt_size) { assert(padded_buflen && *padded_buflen >= ETH_ZLEN);