From nobody Tue May 13 17:18:17 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=1675224871; cv=none; d=zohomail.com; s=zohoarc; b=RltEJuebb4/vVp3WpOsgaex6aMkU7jp1DbkC1czk26mA+3bK79gc2jY2p1Hgz0dPNGc/fZ3LYKqtWXmXraF00rFKcB2/kEoMphtCN0uFwf78ErwQF5f3Y//P9+k+odLXCZLzyreD7WN8kpvTZZ2TG2GVZeiSJly84XsOiDFACeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675224871; 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=PhtkOTUgmnCFlCx/KUeop3PpLzbdZh6TLaRwuZegK2w=; b=a05tlLaCoV3si3nHZ9zB2No2qPAWx6mwqLb9g9qXxWnPkH90WCjfEyJ1ainqjj5WlR9sahyYTWZCkO5/cCvDmTq5721DHWLyIf4ctNN+amsq2utlDIUvlNBTXa6dl6ImMEls0st0YCJxfJ6NQylJQUmCmUpdBLJG321J0GofF4k= 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 1675224871338365.53880041519585; Tue, 31 Jan 2023 20:14:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pN4V9-0000b2-Tb; Tue, 31 Jan 2023 23:13:39 -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 1pN4V8-0000aS-8K for qemu-devel@nongnu.org; Tue, 31 Jan 2023 23:13:38 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pN4V6-00015O-R3 for qemu-devel@nongnu.org; Tue, 31 Jan 2023 23:13:38 -0500 Received: by mail-pl1-x631.google.com with SMTP id d3so17200723plr.10 for ; Tue, 31 Jan 2023 20:13:36 -0800 (PST) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id q8-20020a17090a7a8800b0022c01052e92sm231350pjf.56.2023.01.31.20.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 20:13:35 -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=PhtkOTUgmnCFlCx/KUeop3PpLzbdZh6TLaRwuZegK2w=; b=nKTt2NdMg8z8T+sQSGe+asXcL+qC3IQx5jSCa1wr3xfrg61iEqkN3Far19XRcX+6d3 D8h68+nF94RUMMQE7KcGbqaNI7iDW8iJvPY44Uhbxzv7CQIgSn41TlPnsHVSVmq8CUDI EBOB6Hxeo2vnFamc4BVHbMFJvmmsTnvB7R3M1GhnvyPIUHVG0BEPn2ZaYudUvtjMoTGm OcJt/nBhKUm5+1hzZmcZH3aVH94cO3vpYU3zW2b1LUqH7edBG3ikKYYbhOgSq97QQ7aR ncuEYKpQNOZguDk9/SUK+n/TalX7X+IeRIrEh5ACxctxtV/u0kwyc+MCfZVU9PkRpge6 QgJg== 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=PhtkOTUgmnCFlCx/KUeop3PpLzbdZh6TLaRwuZegK2w=; b=4ng2YkjXsZR0pLAazLJg2hVkr38Nmg36id2R788IWI6Q+ev/xn86FJ2pugLbrPuu3C sF4aPgQeDDbz1wmthaEuuj26IaQ0br9IYn7ePYO6QePT+Wa8zMOQ+rM7A/Y8QIcfSAja lGrbiSSyVItQma0lsoe+wvFcMW+fOwFXLqjWbFA+BTp2hdYhQcLLkSZODITYlHiDMoZx 3b85TzNyemuUmzn85x/qoC/h2CtKjd+F4hBAj/BG89MC836YlcgLQUW7Q1hcLfGLDIg5 TSrrVqCbZmyNHZpCb9g3nlBE5d9PghWHMQIXSJYQ8SDm9/i2B7dTeRri/iuGsjSh58/g VCug== X-Gm-Message-State: AO0yUKUA1WMhcpl4zryJ6AUWwGCQsPYxAIJnhrVXi+LVJtKG948ze+TS zAy8Ti5Y0xcTWVt8GHhEqmoZEg== X-Google-Smtp-Source: AK7set/WS15T+JGsLiPdv/m+9/V/XYEohEhB6xzROixrrsoA77XC+tiVjr3jXAWyB7Z/spfB0e7lyQ== X-Received: by 2002:a17:90b:380b:b0:22c:ad11:af32 with SMTP id mq11-20020a17090b380b00b0022cad11af32mr9633430pjb.17.1675224816197; Tue, 31 Jan 2023 20:13:36 -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 , Gal Hammer , Akihiko Odaki Subject: [PATCH v6 1/9] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr Date: Wed, 1 Feb 2023 13:13:12 +0900 Message-Id: <20230201041320.32096-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230201041320.32096-1-akihiko.odaki@daynix.com> References: <20230201041320.32096-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::631; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x631.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=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+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: 1675224871725100001 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 986a3adfe9..be5b65f0e9 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.1