<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - [DPDK-23.11] hotplug_mp/attach_detach_dev_primary_cross_loop: re-attach device failed in multiple processes"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1303">1303</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[DPDK-23.11] hotplug_mp/attach_detach_dev_primary_cross_loop: re-attach device failed in multiple processes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>23.11
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>examples
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tingtingx.liao@intel.com
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">Environment

DPDK version: 77f913752a55c0262bfda99a1b69ca0bd804c6c7
OS: Ubuntu 22.04.3 LTS/5.15.0-82-generic
Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
NIC hardware: Ethernet Controller E810-C for SFP 1593
Hardware platform: Intel(R) Xeon(R) Gold 6139 CPU @ 2.30GHz
NIC driver: ice-1.13.0_rc90_2_g5c64af920_dirty
NIC firmware: 4.40 0x8001afdb 1.3444.0

Test Setup

1. compile hotplug_mp.
meson configure -Dexamples=multi_process/hotplug_mp x86_64-native-linuxapp-gcc
ninja -C x86_64-native-linuxapp-gcc

2. bind all PF to ice and start 3 processes
./usertools/dpdk-devbind.py -b ice 0000:18:00.0
PRIMARY process: x86_64-native-linuxapp-gcc/examples/dpdk-hotplug_mp  
--proc-type=auto 
SECONDARY process-1: x86_64-native-linuxapp-gcc/examples/dpdk-hotplug_mp  
--proc-type=auto 
SECONDARY process-2: x86_64-native-linuxapp-gcc/examples/dpdk-hotplug_mp  
--proc-type=auto

3. bind all PF to vfio-pci
./usertools/dpdk-devbind.py -b vfio-pci 0000:18:00.0

4. attach device in PRIMARY process
attach 0000:18:00.0

5. detach device in SECONDARY process-1
detach 0000:18:00.0

6. re-attach device in PRIMARY process
attach 0000:18:00.0

[Output]
EAL: Using IOMMU type 1 (Type 1)
EAL: Probe PCI driver: net_ice (8086:1593) device: 0000:18:00.0 (socket 1)
ice_load_pkg_type(): Active package is: 1.3.36.0, ICE OS Default Package
(double VLAN mode)
EAL: Failed to attach device on secondary process
EAL: Releasing PCI mapped resource for 0000:18:00.0
EAL: Calling pci_unmap_resource for 0000:18:00.0 at 0x2202010000
EAL: Calling pci_unmap_resource for 0000:18:00.0 at 0x2204010000
failed to attached device 0000:18:00.0 
Expected Result
Explain what is the expected result in text or as an example output:

[Expected Result]
EAL: Using IOMMU type 1 (Type 1)
EAL: Probe PCI driver: net_ice (8086:1593) device: 0000:18:00.0 (socket 1)
ice_load_pkg_type(): Active package is: 1.3.36.0, ICE OS Default Package
(double VLAN mode)
attached device 0000:18:00.0

Regression
Is this issue a regression: (Y/N)Y
commit 36c46e738120c381cf663c96692454c5aa75e203
Author: David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>>
Date:   Wed Sep 27 13:45:15 2023 +0200



    ethdev: cleanup shared data with the last port



    If no port is allocated and no port owner is still registered,
    ethdev from a primary process may release the memzone used to store
    port data.
    This makes it possible for the DPDK memory allocator to release
    associated resources back to the OS.



    Signed-off-by: David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>>
    Acked-by: Morten Brørup <<a href="mailto:mb@smartsharesystems.com">mb@smartsharesystems.com</a>>
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1303">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>