File tree 4 files changed +16
-3
lines changed
4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 150
150
xsc_dev_close (struct xsc_dev * xdev , int repr_id )
151
151
{
152
152
xsc_dev_clear_pct (xdev , repr_id );
153
- return xdev -> dev_ops -> dev_close (xdev );
153
+
154
+ if (repr_id == xdev -> num_repr_ports - 1 )
155
+ return xdev -> dev_ops -> dev_close (xdev );
156
+ return 0 ;
154
157
}
155
158
156
159
int
Original file line number Diff line number Diff line change @@ -860,13 +860,21 @@ xsc_ethdev_init(struct rte_eth_dev *eth_dev)
860
860
static int
861
861
xsc_ethdev_uninit (struct rte_eth_dev * eth_dev )
862
862
{
863
+ int ret = 0 ;
864
+ uint16_t port_id ;
863
865
struct xsc_ethdev_priv * priv = TO_XSC_ETHDEV_PRIV (eth_dev );
864
866
865
867
PMD_INIT_FUNC_TRACE ();
868
+ RTE_ETH_FOREACH_DEV_OF (port_id , eth_dev -> device ) {
869
+ if (port_id != eth_dev -> data -> port_id )
870
+ ret |= rte_eth_dev_close (port_id );
871
+ }
866
872
867
- xsc_dev_uninit (priv -> xdev );
873
+ ret |= xsc_ethdev_close (eth_dev );
874
+ xsc_dev_pct_uninit ();
875
+ rte_free (priv -> xdev );
868
876
869
- return 0 ;
877
+ return ret == 0 ? 0 : - EIO ;
870
878
}
871
879
872
880
static int
Original file line number Diff line number Diff line change 383
383
xsc_dev_pct_uninit (void )
384
384
{
385
385
rte_free (xsc_pct_mgr .bmp_mem );
386
+ xsc_pct_mgr .bmp_mem = NULL ;
386
387
}
387
388
388
389
int
Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ xsc_vfio_dev_close(struct xsc_dev *xdev)
178
178
struct xsc_vfio_priv * vfio_priv = (struct xsc_vfio_priv * )xdev -> dev_priv ;
179
179
180
180
xsc_vfio_mbox_destroy (vfio_priv -> cmdq );
181
+ rte_pci_unmap_device (xdev -> pci_dev );
181
182
rte_free (vfio_priv );
182
183
183
184
return 0 ;
You can’t perform that action at this time.
0 commit comments