From nobody Fri Jul 4 07:41:42 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1674535790; cv=none; d=zohomail.com; s=zohoarc; b=JH/L86/iq4rSkkABHKsJZgbba4iMRsRnWXP6lSKloPRlQAhF/dl2LUqEvha8AoU/I+2IQuHVGfpyb4ssxME8LXadKO1EyCrWn9IDMgkFkyBtGA+IBLZkBPNU+tVyCDvNGlQsdvm++413ZsimQGqJ/WybE5jtcnzV/QQ40Mb79pA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674535790; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=31UNhnQD3wPnVE0Wq0E+3g5/UlpM2T3rdfjZKAYdn6A=; b=fgWyEeGKhDbTuDENsXRT/KztfUQOoaA+AIwe+xGTp2W91MUnlBxgY5cB682lr2DRcLp8r+vWi2DM+y7YucLupWBOzMBFSWjJwTCpxj6ENkPvdA8JG2n8V32EBMoJ3H4XFEaNdaktnZHhpjPXlauOOfkebB7QGDUvsf5d7oT4pFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674535790363145.92919601626375; Mon, 23 Jan 2023 20:49:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKBDA-0005zJ-V3; Mon, 23 Jan 2023 23:47:08 -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 1pKBD9-0005yV-Dd for qemu-devel@nongnu.org; Mon, 23 Jan 2023 23:47:07 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKBD7-0004xk-Tq for qemu-devel@nongnu.org; Mon, 23 Jan 2023 23:47:07 -0500 Received: by mail-pj1-x1030.google.com with SMTP id mm11-20020a17090b358b00b0022bf61de7beso6864pjb.2 for ; Mon, 23 Jan 2023 20:47:05 -0800 (PST) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id l6-20020a17090a4d4600b00226f9c7474esm7324855pjh.54.2023.01.23.20.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 20:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=31UNhnQD3wPnVE0Wq0E+3g5/UlpM2T3rdfjZKAYdn6A=; b=fvNHmNMiCIYsx+xIXBZ+7xPtIPCnDMi6eGaRD21OpDf1qwphp+0HLxBoL0vG4evboA DAJjieQSrTF49oju5KLdsfvSpfdHb5Mu986lQTYJnr/FR1abxQUdIrgYoTQct3oZS8WT 41nE7agj01+Y6/ZF5pog0Z8AGLN2re28MDS0YPabSu50NxFwhOy/4yOsGLjf5lHJAnaJ nt5WneysxdJudtIQqohNlzfUHSz3QnnDaepS2PcYPCSP7K6NtRyXcQ/NYzQ3LpxWra1e kX1ijlgM+IV4i6fufZ+YoUPlb+JE5ZASL4x8Tih1saVh1BkLs0nxOBo4Bg3d+nM2zgRC jduw== 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 :subject:date:message-id:reply-to; bh=31UNhnQD3wPnVE0Wq0E+3g5/UlpM2T3rdfjZKAYdn6A=; b=IU2LFob67+RxSkGX0ZUwuV/qaBa0OOnleRvNkvUWfmU54KJkCAT9s9gUhTJ1TsN/JY 0Z5PmV63Q/39mP/Rsuu8msffRQbwtAJDYef4Y/wExtiuTR7AJt7P6HeIsqbJYrLpJHuL g+VpCQH2+agQV0keecEhzqJrTSK5yhUjG0FRLXlrKZI0B4EU6QDR17eox8sMCIERl+Pt lv16tyUQ0Bco33d04bQPjOlE5Xa3dQ9ElFTdXZx1rfEnByHYICAAQz8UzLOoTZhbv+nE bgCi+Jx3C/5cb0q3MC7Q3SkuRBAk6CN4ZsZSkkCNolBrmbOoQJTa9mpXfkbhBL1YHg7J e5ZA== X-Gm-Message-State: AFqh2kphXFQnLjabAGHjS5DypYs/tbJpGbZ8gFa8etuodVHa6TJgtiTr MugrCf4UCizdybkGa8jauOBW+A== X-Google-Smtp-Source: AMrXdXt7wISBYrnkYmQq1fUnraBNC+/rXHer1G14Lmgfp36SfUDTqRUKW1X6Yfu9Th1dt4v7EqLLZg== X-Received: by 2002:a17:90a:199:b0:22b:b794:bb43 with SMTP id 25-20020a17090a019900b0022bb794bb43mr14031931pjc.38.1674535624536; Mon, 23 Jan 2023 20:47:04 -0800 (PST) From: Akihiko Odaki To: Cc: Jason Wang , Dmitry Fleytman , "Michael S . Tsirkin" , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Wainer dos Santos Moschetta , Beraldo Leal , Cleber Rosa , Laurent Vivier , Paolo Bonzini , Alexander Bulekov , Bandan Das , Stefan Hajnoczi , Darren Kenny , Qiuhao Li , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, devel@daynix.com, Yan Vugenfirer , Yuri Benditovich , Sriram Yagnaraman , Akihiko Odaki , Gal Hammer Subject: [PATCH v3 01/13] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr Date: Tue, 24 Jan 2023 13:46:38 +0900 Message-Id: <20230124044650.14144-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230124044650.14144-1-akihiko.odaki@daynix.com> References: <20230124044650.14144-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1030; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1674535790663100001 Content-Type: text/plain; charset="utf-8" Expose the ethernet header so that igb can utilize it to perform the internal routing among its SR-IOV functions. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++++++ hw/net/net_tx_pkt.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index e5c3e1e10b..cab10eecd5 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -273,6 +273,12 @@ bool net_tx_pkt_parse(struct NetTxPkt *pkt) } } =20 +struct eth_header *net_tx_pkt_get_eth_hdr(struct NetTxPkt *pkt) +{ + assert(pkt); + return (struct eth_header *)&pkt->l2_hdr; +} + struct virtio_net_hdr *net_tx_pkt_get_vhdr(struct NetTxPkt *pkt) { assert(pkt); diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h index f57b4e034b..2e51b73b6c 100644 --- a/hw/net/net_tx_pkt.h +++ b/hw/net/net_tx_pkt.h @@ -45,6 +45,14 @@ void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *p= ci_dev, */ void net_tx_pkt_uninit(struct NetTxPkt *pkt); =20 +/** + * get ethernet header + * + * @pkt: packet + * @ret: ethernet header + */ +struct eth_header *net_tx_pkt_get_eth_hdr(struct NetTxPkt *pkt); + /** * get virtio header * --=20 2.39.0