From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by dpdk.org (Postfix) with ESMTP id 27EA81B01E for ; Fri, 5 Jan 2018 14:58:04 +0100 (CET) Received: by mail-pl0-f67.google.com with SMTP id b96so3086026pli.2 for ; Fri, 05 Jan 2018 05:58:04 -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=UcW/c+WtKmdN2Ahnou6M6W3/g9ukU+Wq5KxLcd/QoyXHoOf+z5ryr3FY9kFhESwLEP lbKcQ+OpLoddGyqdT29CrRZfBdEBXZIWgr5iZS0A5npXOOWiSNJbBV96AZsPsTIPMuRT WiTeQJA6gt/T+pyTVoq4BgxXi5r1YXe9SnBLGhs9lDSt3852brBHPg3TloeHU5NKqiiS /u6Q+Dckb1JezzWavxGQHuc32N4L56pBzoQybtqEMmDI+P7eCruF+OIHn64eJPrwO+3J 4bNkSjcB6OILHmZ5QXpEaP7YtnGCoEgn8vf9CE0p2pWaRGHNaUU6ep/S2nhGU1V8+Wkp D2Hg== 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=qQSBIWNz9fRzIZg9t0yYDqW56SSwuRnhb4+feq3UcuSIwR6MLdQXjePIrmYcRDEbdn UlhEMZJrTrUj1nGmCcUi4Ao5sQJgBfoBG6kPCIzkANp4TzKwQleNK0cZPwGKEshDEMyt NDBHrFo9lMmHIwHKx60YQNyGLY8GUnCViz69oqCAlDIZAKayvyT40MZzMqXgx4/EtL03 g4uIwoQTQvtFG5lekAA0W9jesaAANny6EZxQc25kOAkiNVYpB9rLjfOUrdQ1yA/11aBG Qgb8g0P5MZ4OdAIrqE9vsjAdkryjEsJyawFhpquDp9PY4V/yXvjfxuBMeHU1UxULacXc KAqg== X-Gm-Message-State: AKGB3mLVWt9UKvcb2lPu6Cy8Rw1zhy7/1NGb4b+OOVZkxZO0W5bgngu7 UNtQfW0TNEwBge7sg1fx9cnzu80U X-Google-Smtp-Source: ACJfBos+7/V5QsNANpF2J7hKARamALy7+7FJgO4hdg/QGRbcA8OIBIkGMHsuuVeN5myvFE1ItjDRuA== X-Received: by 10.84.131.33 with SMTP id 30mr3304506pld.264.1515160683126; Fri, 05 Jan 2018 05:58:03 -0800 (PST) Received: from local.opencloud.tech.localdomain ([183.240.196.56]) by smtp.gmail.com with ESMTPSA id z19sm12390783pfh.39.2018.01.05.05.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 05:58:02 -0800 (PST) From: Tonghao Zhang To: dev@dpdk.org Cc: Tonghao Zhang Date: Fri, 5 Jan 2018 05:57:52 -0800 Message-Id: <1515160676-4296-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 13:58:04 -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