[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/31] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr
From: |
Akihiko Odaki |
Subject: |
[PATCH 19/31] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr |
Date: |
Thu, 12 Jan 2023 18:57:31 +0900 |
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 <gal.hammer@sap.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
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 1cb1125d9f..4bffa1523d 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -278,6 +278,12 @@ bool net_tx_pkt_parse(struct NetTxPkt *pkt)
}
}
+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 4ec8bbe9bd..4e70453c12 100644
--- a/hw/net/net_tx_pkt.h
+++ b/hw/net/net_tx_pkt.h
@@ -44,6 +44,14 @@ void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice
*pci_dev,
*/
void net_tx_pkt_uninit(struct NetTxPkt *pkt);
+/**
+ * get ethernet header
+ *
+ * @pkt: packet
+ * @ret: ethernet header
+ */
+struct eth_header *net_tx_pkt_get_eth_hdr(struct NetTxPkt *pkt);
+
/**
* get virtio header
*
--
2.39.0
- Re: [PATCH 13/31] e1000: Configure ResettableClass, (continued)
- [PATCH 14/31] e1000e: Configure ResettableClass, Akihiko Odaki, 2023/01/12
- [PATCH 15/31] e1000e: Introduce e1000_rx_desc_union, Akihiko Odaki, 2023/01/12
- [PATCH 16/31] e1000e: Set MII_ANER_NWAY, Akihiko Odaki, 2023/01/12
- [PATCH 17/31] tests/qtest/e1000e-test: Fix the code style, Akihiko Odaki, 2023/01/12
- [PATCH 18/31] tests/qtest/libqos/e1000e: Remove duplicate register definitions, Akihiko Odaki, 2023/01/12
- [PATCH 19/31] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr,
Akihiko Odaki <=
- [PATCH 20/31] pcie: Introduce pcie_sriov_num_vfs, Akihiko Odaki, 2023/01/12
- [PATCH 21/31] e1000: Split header files, Akihiko Odaki, 2023/01/12
- [PATCH 22/31] igb: Copy e1000e code, Akihiko Odaki, 2023/01/12
- [PATCH 23/31] igb: Rename identifiers, Akihiko Odaki, 2023/01/12
- [PATCH 24/31] igb: Build igb, Akihiko Odaki, 2023/01/12
- [PATCH 26/31] tests/qtest/e1000e-test: Fabricate ethernet header, Akihiko Odaki, 2023/01/12
- [PATCH 25/31] igb: Transform to 82576 implementation, Akihiko Odaki, 2023/01/12
- [PATCH 27/31] tests/qtest/libqos/e1000e: Export macreg functions, Akihiko Odaki, 2023/01/12