From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58409A052A; Mon, 25 Jan 2021 13:41:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE702140F12; Mon, 25 Jan 2021 13:41:29 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 1E5DD140EB6 for ; Mon, 25 Jan 2021 13:41:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611578487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5dQV7D6P5fhrYPRmpjveJUWa7AAd537dts8MuXwyJgE=; b=c0le1ZPTsATnaIxRGnLwPlPhCp9du7627NCtwnFeDR68cw5yTkAEQTtG/uED9FxX0gmR0p zDkvIIFdSqKBNEndnI/vkDk6oQ1XCOdMQZhnyyoVH+BnGJt3lhnrLe5jyJz1uJiCg/7X0B YBT85eL9Bpl53NMhNtiDd1cXE/T4Q6I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-V8wrGs7aPe-130rd_qHHIg-1; Mon, 25 Jan 2021 07:41:22 -0500 X-MC-Unique: V8wrGs7aPe-130rd_qHHIg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59F201842142; Mon, 25 Jan 2021 12:41:21 +0000 (UTC) Received: from [10.36.110.31] (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A8196F965; Mon, 25 Jan 2021 12:41:11 +0000 (UTC) To: "Xia, Chenbo" , "dev@dpdk.org" , "olivier.matz@6wind.com" , "amorenoz@redhat.com" , "david.marchand@redhat.com" References: <20210119212507.1043636-1-maxime.coquelin@redhat.com> <20210119212507.1043636-10-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <39379089-a4ef-ba28-37a5-580831acdbc3@redhat.com> Date: Mon, 25 Jan 2021 13:41:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 09/44] net/virtio: move MSIX detection to PCI ethdev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 1/21/21 8:12 AM, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, January 20, 2021 5:25 AM >> To: dev@dpdk.org; Xia, Chenbo ; olivier.matz@6wind.com; >> amorenoz@redhat.com; david.marchand@redhat.com >> Cc: Maxime Coquelin >> Subject: [PATCH v2 09/44] net/virtio: move MSIX detection to PCI ethdev >> >> This patch introduces a new callback to notify the bus >> driver some interrupt related operation was done. >> >> This is used by Virtio PCI driver to check msix status. >> >> Signed-off-by: Maxime Coquelin >> --- >> drivers/net/virtio/virtio_ethdev.c | 12 +-- >> drivers/net/virtio/virtio_pci.c | 120 ++++++++++++++----------- >> drivers/net/virtio/virtio_pci.h | 6 +- >> drivers/net/virtio/virtio_pci_ethdev.c | 2 + >> 4 files changed, 82 insertions(+), 58 deletions(-) >> >> diff --git a/drivers/net/virtio/virtio_ethdev.c >> b/drivers/net/virtio/virtio_ethdev.c >> index a3e81f336d..13d5a76376 100644 >> --- a/drivers/net/virtio/virtio_ethdev.c >> +++ b/drivers/net/virtio/virtio_ethdev.c >> @@ -1287,8 +1287,8 @@ virtio_intr_unmask(struct rte_eth_dev *dev) >> if (rte_intr_ack(dev->intr_handle) < 0) >> return -1; >> >> - if (hw->bus_type == VIRTIO_BUS_PCI_LEGACY || hw->bus_type == >> VIRTIO_BUS_PCI_MODERN) >> - hw->use_msix = vtpci_msix_detect(RTE_ETH_DEV_TO_PCI(dev)); >> + if (VTPCI_OPS(hw)->intr_event) > > Emmm.. why is callback called intr_event? The callback detects/checks msix and lsc. > IMHO, maybe intr_detect? Or another similar verb you like 😊 I called it intr_event because it could be used for other purpose than intr detection. But this is the only use for now so let's immplement your suggestion and we can revisit later if needed. >> + VTPCI_OPS(hw)->intr_event(hw); >> >> return 0; > > > >> >> +msix_detect: >> + hw->use_msix = vtpci_msix_detect(dev); >> + > > Just use use the callback introduced? Should also work later when intr_lsc is added. I didn't do it given that it was in the same file and that the callback was to report an event happened. With renaming the callback as you suggest, it makes sense to use it. I will fix in v3. Thanks, Maxime > Thanks, > Chenbo >