On 02/23/2016 01:37 AM, Leonid Bloch wrote:From: Dmitry Fleytman <address@hidden>
This patch drops "vmx" prefix from packet abstrations names to emphasize the fact they are generic and not tied to any specific network device.
These abstrations will be reused by e1000e emulation implementation introduced by following patches so their names need generalization.
This patch (except renamed files, adjusted comments and changes in MAINTAINTERS) was produced by:
git grep -lz 'vmxnet_tx_pkt' | xargs -0 perl -i'' -pE "s/vmxnet_tx_pkt/net_tx_pkt/g" git grep -lz 'vmxnet_rx_pkt' | xargs -0 perl -i'' -pE "s/vmxnet_rx_pkt/net_rx_pkt/g" git grep -lz 'VmxnetTxPkt' | xargs -0 perl -i'' -pE "s/VmxnetTxPkt/NetTxPkt/g" git grep -lz 'VMXNET_TX_PKT' | xargs -0 perl -i'' -pE "s/VMXNET_TX_PKT/NET_TX_PKT/g" git grep -lz 'VmxnetRxPkt' | xargs -0 perl -i'' -pE "s/VmxnetRxPkt/NetRxPkt/g" git grep -lz 'VMXNET_RX_PKT' | xargs -0 perl -i'' -pE "s/VMXNET_RX_PKT/NET_RX_PKT/g" sed -ie 's/VMXNET_/NET_/g' hw/net/vmxnet_rx_pkt.c sed -ie 's/VMXNET_/NET_/g' hw/net/vmxnet_tx_pkt.c
Signed-off-by: Dmitry Fleytman <address@hidden> Signed-off-by: Leonid Bloch <address@hidden> --- MAINTAINERS | 8 + hw/net/Makefile.objs | 2 +- hw/net/net_rx_pkt.c | 187 ++++++++++++++++ hw/net/net_rx_pkt.h | 176 +++++++++++++++ hw/net/net_tx_pkt.c | 581 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/net/net_tx_pkt.h | 148 +++++++++++++ hw/net/vmxnet3.c | 88 ++++---- hw/net/vmxnet_rx_pkt.c | 187 ---------------- hw/net/vmxnet_rx_pkt.h | 176 --------------- hw/net/vmxnet_tx_pkt.c | 581 ------------------------------------------------- hw/net/vmxnet_tx_pkt.h | 148 ------------- tests/Makefile | 4 +- 12 files changed, 1147 insertions(+), 1139 deletions(-) create mode 100644 hw/net/net_rx_pkt.c create mode 100644 hw/net/net_rx_pkt.h create mode 100644 hw/net/net_tx_pkt.c create mode 100644 hw/net/net_tx_pkt.h delete mode 100644 hw/net/vmxnet_rx_pkt.c delete mode 100644 hw/net/vmxnet_rx_pkt.h delete mode 100644 hw/net/vmxnet_tx_pkt.c delete mode 100644 hw/net/vmxnet_tx_pkt.h
diff --git a/MAINTAINERS b/MAINTAINERS index 02710f8..3a7c108 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -937,6 +937,14 @@ S: Maintained F: hw/*/xilinx_* F: include/hw/xilinx.h
+Network packet abstractions +M: Dmitry Fleytman <address@hidden> +S: Maintained +F: include/net/eth.h +F: net/eth.c +F: hw/net/net_rx_pkt* +F: hw/net/net_tx_pkt* +
[...] +} + +bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, + size_t len) +{ + hwaddr mapped_len = 0; + struct iovec *ventry; + assert(pkt); + assert(pkt->max_raw_frags > pkt->raw_frags); + + if (!len) { + return true; + } + + ventry = &pkt->raw[pkt->raw_frags]; + mapped_len = len; + + ventry->iov_base = cpu_physical_memory_map(pa, &mapped_len, false);
I see an interesting issue here. The e1000e codes use pci_dma_XXXhelpers, so actually it was ready for IOMMU. We probably want that herealso, otherwise e1000e with IOMMU may break. And since the codes wereshared with vmxnet3, so probably need another patch to convert vmxnet3to use dma helpers.
Done. Thanks.
[...]
|