DPDK patches and discussions
 help / color / mirror / Atom feed
From: Renata Saiakhova <renata.saiakhova@ekinops.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"arybchenko@solarflare.com" <arybchenko@solarflare.com>
Subject: Re: [dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings allocation
Date: Tue, 5 May 2020 11:19:30 +0000	[thread overview]
Message-ID: <MRXP264MB0325FC5A1C2E99A1FA83F56B92A70@MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <2456587.k3LOHGUjKi@thomas>

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@monjalon.net>
Sent: Tuesday, May 5, 2020 1:01 PM
To: Renata Saiakhova <renata.saiakhova@ekinops.com>
Cc: dev@dpdk.org <dev@dpdk.org>; ferruh.yigit@intel.com <ferruh.yigit@intel.com>; arybchenko@solarflare.com <arybchenko@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?






  reply	other threads:[~2020-05-06 10:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 16:26 Renata Saiakhova
2020-05-03 16:26 ` [dpdk-dev] [PATCH 1/2] librte_ethdev: Introduce a function to release HW rings Renata Saiakhova
2020-05-05 10:25   ` Burakov, Anatoly
2020-05-05 10:45     ` Burakov, Anatoly
2020-05-05 12:49       ` Renata Saiakhova
2020-05-05 13:36         ` Burakov, Anatoly
2020-05-05 15:47   ` Lukasz Wojciechowski
2020-05-05 17:25     ` Renata Saiakhova
2020-05-05 17:31       ` Lukasz Wojciechowski
2020-05-06 10:14       ` Burakov, Anatoly
2020-05-03 16:26 ` [dpdk-dev] [PATCH 2/2] drivers/net: Fix in e1000 and ixgbe HW rings memory overlap Renata Saiakhova
2020-05-05 10:28   ` Burakov, Anatoly
2020-05-05 10:59     ` Thomas Monjalon
2020-05-05 11:36       ` Burakov, Anatoly
2020-05-05 11:01 ` [dpdk-dev] [PATCH 0/2] Memory corruption due to HW rings allocation Thomas Monjalon
2020-05-05 11:19   ` Renata Saiakhova [this message]
2020-05-05 12:35     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MRXP264MB0325FC5A1C2E99A1FA83F56B92A70@MRXP264MB0325.FRAP264.PROD.OUTLOOK.COM \
    --to=renata.saiakhova@ekinops.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).