[dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings allocation

Renata Saiakhova renata.saiakhova at ekinops.com
Tue May 5 13:19:30 CEST 2020


Hi Thomas,

In our application dpdk port can be connected and disconnected:

Connect:
new_port_id = netdev_dpdk_get_port_by_devargs(dpdk_port->pci_addr_str);

   if (!rte_eth_dev_is_valid_port(new_port_id)) {
      /* Device not found in DPDK, attempt to attach it */
      if (rte_dev_probe(dpdk_port->pci_addr_str)) {
         new_port_id = DPDK_ETH_PORT_ID_INVALID;
      } else {
         new_port_id = netdev_dpdk_get_port_by_devargs(dpdk_port->pci_addr_str);
         if (rte_eth_dev_is_valid_port(new_port_id)) {
            LO_TRACE("Device '%s' attached to DPDK", dpdk_port->pci_addr_str);
         } else {
            /* Attach unsuccessful */
            new_port_id = DPDK_ETH_PORT_ID_INVALID;
         }
      }
   }

Disconnect:

   dp_ConfigureRxQueues(dpdk_port, FALSE);
   rte_eth_dev_set_link_down(port_id);
   rte_eth_dev_stop(port_id);
   rte_eth_dev_close(port_id);

and yes, exactly, port id is recycled by eth_dev. Next time, switching from igb port to ixgbe with the same port and using HW rings of bigger size for ixgbe creates memory corruption.

Kind regards,
Renata



________________________________
From: Thomas Monjalon <thomas at monjalon.net>
Sent: Tuesday, May 5, 2020 1:01 PM
To: Renata Saiakhova <renata.saiakhova at ekinops.com>
Cc: dev at dpdk.org <dev at dpdk.org>; ferruh.yigit at intel.com <ferruh.yigit at intel.com>; arybchenko at solarflare.com <arybchenko at solarflare.com>
Subject: Re: [dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings allocation

03/05/2020 18:26, Renata Saiakhova:
> igb and ixgbe drivers allocate HW rings using rte_eth_dma_zone_reserve(),
> which checks first if the memzone exists for a given name, consisting of port
> id, queue_id, rx/tx direction, but not for the size, alignment, and socket_id.
> If the memzone with a given name exists it is returned, otherwise it is
> allocated.
> Disconnecting dpdk port from one type of interface (igb) and connecting it
> to another type of interface (ixgbe) for the same port id, potentially creates
> memory overlap and corruption, because it may require memzone of bigger size.
> That's what is happening from switching from igb to ixgbe having the same port
> id.

I don't understand the use case.
Do you mean you close one port and open another one,
so the port id is recycled by ethdev?

Please could you elaborate with some code snippet?







More information about the dev mailing list