From patchwork Thu Jul 11 12:57:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yasufumi Ogawa X-Patchwork-Id: 56340 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D85B4C8E; Thu, 11 Jul 2019 14:59:45 +0200 (CEST) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id 336954C8E for ; Thu, 11 Jul 2019 14:59:44 +0200 (CEST) Received: by mail-oi1-f193.google.com with SMTP id t76so4405709oih.4 for ; Thu, 11 Jul 2019 05:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Rjx4ZcKhgT9PeumrdlPTQRHyutlAxbDgcohgQ/cOQi0=; b=EgzbSNBmmHupc+sbKUwiGFIzMfRQpRZfCTCuE57+zW1cHvWb6xu0OLrBZZqly4NRdq M5kZjtzod4vAESfaxcm6lMFe0J9quC970LBw4u2cts7LW3deLn5fHEgZW/U4hbLaUP1Y Nyox2FJ00bGPwSHzuVYsDD5M9TYi2XYhpDRPILh7tX+Hp5dqFN+oKGCHSIPelLbxiUAg OuKLVfv5lO5BAiUKg14DIeH3SObYDcdQc3WxoodcJixCcXN3zCgWnTRkBnGoifq3HlqR YHFX3D53Xws1wj0RgytTs9QFqWWu05Q13qVfhD82s9PjHf5UJ8tlubfpjeNpdVdM2WS0 tAag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Rjx4ZcKhgT9PeumrdlPTQRHyutlAxbDgcohgQ/cOQi0=; b=JYbmH7viWTUXAhH/GXUDhf5lIz5quvpPNmSpCafm0WXv+BmZsWWJmP/qn6x2zot1fa Uzzia2/TkOr1+LcWPNgxf1zUNLMMsoZ+2bzktBLmYEiK3J1N4CF0SaFWjf/9FPIFFyXi pVximc72Q+g5tc2veEETu4aBqfbdwkL+8/iIxF5L3ScsTc+8r7c3AIqZ8eWDJTgagZKo P2kR6hNEfbyYfYQpkAQXusLPQ+iw8uSBYR4HnFjI2gpzdCFCDa4SntVud71+nr81MmmO paWZJLuzIMI4zEvWqli2qOYP3i8OXVOQJJeHXUKl5bLyqwyY8mLlpJcOzRKzg4BB/iTI ZXjg== X-Gm-Message-State: APjAAAWt6mGOtfjIAVe0DmVBaEA6vCz11tOSpa0GE1lW2w5UhefIo2fP 5CSFwwaNz8V+mQU8QhQ7FoNssVVPkWDgze8g4Jp3FMCt X-Google-Smtp-Source: APXvYqx40UXouCE5RiZxV5YR0/9adkHzGmXqtF5ZNeRW0/yg7TiSIW3ng49ZdwB8sp9OA7f6IppAFuQKfwz1AJPrPaA= X-Received: by 2002:aca:4f4a:: with SMTP id d71mr2439945oib.20.1562849983374; Thu, 11 Jul 2019 05:59:43 -0700 (PDT) MIME-Version: 1.0 From: Ogawa Yasufumi Date: Thu, 11 Jul 2019 21:57:50 +0900 Message-ID: To: dev@dpdk.org X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] Failed to hotplug add a device from secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi all, I have developed a multi-process app and am struggling to fix an error while adding PMD from secondary process with hotplug feature. As we reported in [1], I think it is because initializing hogplugged device is changed to be done by primary first, then secondary. However, initialization in secondary might work properly, so `rx_pkt_burst` and `tx_pkt_burst` are NULL. [1] https://bugs.dpdk.org/show_bug.cgi?id=194 It might happen other than vhost. I confirmed that ring and pcap PMD work fine, but failed to run null PMD. I've got realized there is a bug in probe function, such as rte_pmd_vhsot_probe() in drivers/net/vhost/rte_eth_vhost.c, called from secondary. I have fixed the issue in nullpmd by simply adding burst functions as following. However, I'm not sure if it is correct way. In addition, cannot fix for vhost because there are still some variables shold be setup in secondary. Could anyone help us for fixing the issue, or give us some advice? Regards, Yasufumi diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 159c1c1fd..5e5b719c0 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -623,6 +623,13 @@ rte_pmd_null_probe(struct rte_vdev_device *dev) /* TODO: request info from primary to set up Rx and Tx */ eth_dev->dev_ops = &ops; eth_dev->device = &dev->device; + if (packet_copy) { + eth_dev->rx_pkt_burst = eth_null_copy_rx; + eth_dev->tx_pkt_burst = eth_null_copy_tx; + } else { + eth_dev->rx_pkt_burst = eth_null_rx; + eth_dev->tx_pkt_burst = eth_null_tx; + } rte_eth_dev_probing_finish(eth_dev); return 0;