From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by dpdk.org (Postfix) with ESMTP id 279591B024 for ; Fri, 5 Jan 2018 15:11:56 +0100 (CET) Received: by mail-pl0-f68.google.com with SMTP id s10so3101455plj.5 for ; Fri, 05 Jan 2018 06:11:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=taDJhXuHP13oGN9z7hPL1I4bNeWeJgbnKDGoRHhXvkI=; b=ayYYIv42SZDGHFz3WRB2C1o0a2RiwszZFR4TVwmnN6NytOPaCrWNgdG9MUp8rU9i0s loHDWwPLDnwrk6OVplrUe7qYwxll0j0Y4YLBxXmtISLHj14fLSeCwlsfz8J1dnV5QICC TR3oBwMxSZUYjHVOaQxGxBGuNLb7knqX2lW0LMmPQKv7TmgJcK9MT7XVKXNTHVbevoDG 8QkMzsxFVfpZe+gxfTIOyg4XzCrjD5plHIeKhc3/ZJe3qjTQ9RQkJqh+sdDhBFx3NPZI 7d6/WRV4NAmo2aBzDvzf5akFu8st8sQ+QLobkHle0BrvDE1smyUq8W6RDZJUpCu/euW0 2h7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=taDJhXuHP13oGN9z7hPL1I4bNeWeJgbnKDGoRHhXvkI=; b=B02QbHpzoRLUzlgMNcIi8JjX6B3nW8sudDPBwgvDgEVJNeiqYAUX/D+YzzW8K3Jz+R im8sb8rxIFEbxEligDsLojVfsmPJ4VRX/fZ1/S9xIGfaHP5fKFO23Ui11LS0ADLQqtSM NXcKQvxll1WCfnlbWuD5FXlyWizzxNs9QomnvPyfn3Iq1EW5UfnfJrFjDmeM2Q9a+rgF ogZUxYU41b3dvWd0Ey+POrGf4CLcznSmio3mHbWdlpEtQaR0z7/efR0j9GFymNlBFDGt OetxnghDXCxeLz03LwEwd3o4b0KKEy5WMAAeKQxmZ603zwhkmWUSzBT7SfWk0ZmJmifA RHZw== X-Gm-Message-State: AKGB3mLiffaq1rP7j+Tgfnzisn4+SjW4FWkUtrzR+f6MOJAuLYeI5As9 5Op3SbET+CAt9hp6mtJHLlsLW51r X-Google-Smtp-Source: ACJfBos09dULpj+U7DojJoDcAfr+j1kKi8j15Qfxxfh0AUI8UpE3NkKwU7DBExavwotgTZ7MxxKReA== X-Received: by 10.159.198.73 with SMTP id y9mr3308371plt.385.1515161515080; Fri, 05 Jan 2018 06:11:55 -0800 (PST) Received: from local.opencloud.tech.localdomain ([219.147.95.160]) by smtp.gmail.com with ESMTPSA id w19sm12990407pfa.127.2018.01.05.06.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 06:11:54 -0800 (PST) From: Tonghao Zhang To: dev@dpdk.org Cc: Tonghao Zhang Date: Fri, 5 Jan 2018 06:10:35 -0800 Message-Id: <1515161439-4792-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH 1/5] net/ixgbevf: unregister irq handler when other interrupts not allowed. 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: , X-List-Received-Date: Fri, 05 Jan 2018 14:11:56 -0000 When we bind the ixgbe VF (e.g 82599 card) to igb_uio and enable the rx-interrupt, there will be more than one epoll_wait on intr_handle.fd. One is in "eal-intr-thread" thread, and the others are in the thread which call the "rte_epoll_wait". The problem is that sometiems "eal-intr-thread" thread will process the rx interrupt, and then rte_epoll_wait can't get the event any more, and the packets may be lost. We should unregister the status interrupt handler in "eal-intr-thread" thread and the ixgbe pf is in the same case. Signed-off-by: Tonghao Zhang --- drivers/net/ixgbe/ixgbe_ethdev.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 43e0132..e67389f 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5049,6 +5049,15 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, } ixgbevf_configure_msix(dev); + if (!rte_intr_allow_others(intr_handle)) { + rte_intr_callback_unregister(intr_handle, + ixgbevf_dev_interrupt_handler, + dev); + if (dev->data->dev_conf.intr_conf.lsc != 0) + PMD_INIT_LOG(INFO, "lsc won't enable because of" + " no intr multiplex"); + } + /* When a VF port is bound to VFIO-PCI, only miscellaneous interrupt * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ). * If previous VFIO interrupt mapping setting in eth_ixgbevf_dev_init( ) @@ -5091,6 +5100,12 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, ixgbe_dev_clear_queues(dev); + if (!rte_intr_allow_others(intr_handle)) + /* resume to the default handler */ + rte_intr_callback_register(intr_handle, + ixgbevf_dev_interrupt_handler, + (void *)dev); + /* Clean datapath event and queue/vec mapping */ rte_intr_efd_disable(intr_handle); if (intr_handle->intr_vec != NULL) { -- 1.8.3.1