vmxnet3 hotplug support
Subsystems (2)
v3 cover vmxnet3 hotplug support
In reply to a message not in the archiveadd PCI Port Hotplug support to the vmxnet3 PMD
This patch depends on v5 of the following patch set:
remove-pci-driver-from-vdevs.patch
Changes in v3:
Rebase.
Changes in v2:
Update release notes.
Bernard Iremonger (1):
vmxnet3: add PCI Port Hotplug support
doc/guides/rel_notes/release_2_2.rst | 2 ++ drivers/net/vmxnet3/vmxnet3_ethdev.c | 33 +++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
PATCH v3 1/1 vmxnet3: add PCI Port Hotplug support
--- doc/guides/rel_notes/release_2_2.rst | 2 ++ drivers/net/vmxnet3/vmxnet3_ethdev.c | 33 +++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-)
doc/guides/rel_notes/release_2_2.rst +2 -0
@@ -13,6 +13,8 @@ New Features * This change required modifications to librte_ether and all vdev and pdev PMD's. +* **Added port hotplug support to the vmxnet3 PMD.** + Resolved Issues ---------------
drivers/net/vmxnet3/vmxnet3_ethdev.c +29 -4
@@ -70,6 +70,7 @@#define PROCESS_SYS_EVENTS 0static int eth_vmxnet3_dev_init (struct rte_eth_dev *eth_dev); +static int eth_vmxnet3_dev_uninit (struct rte_eth_dev *eth_dev);static int vmxnet3_dev_configure (struct rte_eth_dev *dev);static int vmxnet3_dev_start (struct rte_eth_dev *dev);static void vmxnet3_dev_stop (struct rte_eth_dev *dev);
@@ -296,13 +297,37 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)return 0 ; } +static int +eth_vmxnet3_dev_uninit (struct rte_eth_dev *eth_dev) +{ +struct vmxnet3_hw *hw = eth_dev->data->dev_private; + +PMD_INIT_FUNC_TRACE (); + +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) +return 0 ; + +if (hw->adapter_stopped ==0 ) +vmxnet3_dev_close (eth_dev); + + eth_dev->dev_ops =NULL ; + eth_dev->rx_pkt_burst =NULL ; + eth_dev->tx_pkt_burst =NULL ; + +rte_free (eth_dev->data->mac_addrs); + eth_dev->data->mac_addrs =NULL ; + +return 0 ; +} +static struct eth_driver rte_vmxnet3_pmd = { .pci_drv = { .name ="rte_vmxnet3_pmd" , .id_table = pci_id_vmxnet3_map, - .drv_flags =RTE_PCI_DRV_NEED_MAPPING , + .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_DETACHABLE , }, .eth_dev_init = eth_vmxnet3_dev_init, + .eth_dev_uninit = eth_vmxnet3_dev_uninit, .dev_private_size =sizeof (struct vmxnet3_hw ), };
@@ -581,7 +606,7 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)PMD_INIT_FUNC_TRACE (); -if (hw->adapter_stopped == TRUE) { +if (hw->adapter_stopped ==1 ) {PMD_INIT_LOG (DEBUG ,"Device already closed." );return ; }
@@ -597,7 +622,7 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)/* reset the device */ VMXNET3_WRITE_BAR1_REG (hw,VMXNET3_REG_CMD ,VMXNET3_CMD_RESET_DEV );PMD_INIT_LOG (DEBUG ,"Device reset." ); - hw->adapter_stopped = FALSE; + hw->adapter_stopped =0 ;vmxnet3_dev_clear_queues (dev);
@@ -617,7 +642,7 @@ vmxnet3_dev_close(struct rte_eth_dev *dev)PMD_INIT_FUNC_TRACE ();vmxnet3_dev_stop (dev); - hw->adapter_stopped = TRUE; + hw->adapter_stopped =1 ; } static void
Signature · 1 line
1.9.1
v3 cover vhost_xen: fix compile error
In reply to a message not in the archivechanges in v3:
rebase.
add error details to patch description
changes in v2:
update release notes
Bernard Iremonger (1):
vhost_xen: fix compile error in main.c
doc/guides/rel_notes/release_2_2.rst | 3 +++ examples/vhost_xen/main.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
PATCH v3 1/1 vhost_xen: fix compile error in main.c
/examples/vhost_xen/main.c:659:61: error: âas no member named â ata, rte_pktmbuf_data_len(buff));
rte_memcpy((void *)(uintptr_t)buff_addr, (const void*)buff->data, rte_pktmbuf_data_len(buff));
make[1]: *** [main.o] Error 1 ^
make[1]: *** [main.o] Error 1
--- doc/guides/rel_notes/release_2_2.rst | 3 +++ examples/vhost_xen/main.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-)
doc/guides/rel_notes/release_2_2.rst +3 -0
@@ -92,6 +92,9 @@ Libraries Examples ~~~~~~~~ +* **vhost_xen: Fixed compile error.** + + Fixed compile error in examples/vhost_xen/main.c Other ~~~~~
examples/vhost_xen/main.c +5 -3
@@ -1,7 +1,7 @@/*- * BSD LICENSE * -* Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2015 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -579,6 +579,7 @@ virtio_dev_rx(struct virtio_net *dev, struct rte_mbuf **pkts, uint32_t count)uint16_t res_base_idx, res_end_idx;uint16_t free_entries;uint8_t success =0 ; +void *userdata;LOG_DEBUG (VHOST_DATA ,"(%" PRIu64") virtio_dev_rx()\n" , dev->device_fh); vq = dev->virtqueue_rx;
@@ -656,13 +657,14 @@ virtio_dev_rx(struct virtio_net *dev, struct rte_mbuf **pkts, uint32_t count) vq->used->ring[res_cur_idx & (vq->size -1 )].len = packet_len;/* Copy mbuf data to buffer */ -rte_memcpy ((void *)(uintptr_t )buff_addr, (const void *)buff->data,rte_pktmbuf_data_len (buff)); + userdata = rte_pktmbuf_mtod(buff, void *); +rte_memcpy ((void *)(uintptr_t )buff_addr, userdata,rte_pktmbuf_data_len (buff)); res_cur_idx++; packet_success++;/* mergeable is disabled then a header is required per buffer. */ -rte_memcpy ((void *)(uintptr_t )buff_hdr_addr, (const void *)&virtio_hdr, vq->vhost_hlen); +rte_memcpy ((void *)(uintptr_t )buff_hdr_addr, (const void *)&virtio_hdr, vq->vhost_hlen);if (res_cur_idx < res_end_idx) {/* Prefetch descriptor index. */ rte_prefetch0 (&vq->desc[head[packet_success]]);
Signature · 1 line
1.9.1
Thomas Monjalon
AppliedRe: [PATCH v3 1/1] vmxnet3: add PCI Port Hotplug support
In reply to Bernard Iremonger2015-10-27 17:12, Bernard Iremonger:
Quoted 1 line
Signed-off-by Bernard Iremonger <[email protected]>
Applied, thanks
Re: [PATCH v3 1/1] vhost_xen: fix compile error in main.c
In reply to Bernard Iremonger2015-11-01 15:58, Bernard Iremonger:
Quoted 7 lines
/examples/vhost_xen/main.c:659:61: error: âas no member named â ata,
rte_pktmbuf_data_len(buff));
rte_memcpy((void *)(uintptr_t)buff_addr, (const void*)buff->data, rte_pktmbuf_data_len(buff));
make[1]: *** [main.o] Error 1 ^
make[1]: *** [main.o] Error 1Signed-off-by Bernard Iremonger <[email protected]>
Commit message cleaned and applied, thanks