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 98D04A034F; Mon, 30 Aug 2021 17:13:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F7DA410E8; Mon, 30 Aug 2021 17:13:31 +0200 (CEST) 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 7496C410E3 for ; Mon, 30 Aug 2021 17:13:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630336409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2DUIQz7gUQ8l3txRyoi7vhObEIIiislSiIGitt5WEw=; b=f3S6Uaqn997Sovg13YSfQk6yMWroUdiBmXmUfsvIsLBRMEP/CVC15qW8ic+3FdQkR9oX4K AYXO+jIIuEad2ezpXb8rfOg3X0rz+/owoAnnQEa8c9Nb9QnXxfMFi4jNEsmRWEjgWdebWY aAXDlDaJ1bGk7ZOhg0nK7AWnAoC0U80= 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-325-KZy53Au9PyqWbBUntT7yVQ-1; Mon, 30 Aug 2021 11:13:26 -0400 X-MC-Unique: KZy53Au9PyqWbBUntT7yVQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65781800FEF; Mon, 30 Aug 2021 15:13:25 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48D4F5C1D5; Mon, 30 Aug 2021 15:13:18 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Maxime Coquelin , Chenbo Xia , Jianfeng Tan , Yuanhan Liu Date: Mon, 30 Aug 2021 17:13:13 +0200 Message-Id: <20210830151313.25481-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH] net/virtio: reconfigure LSC handler when required 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" There is no reason to re-register a interrupt handler for LSC if this feature was not requested in the first place. A simple usecase is when asking for Rx interrupts without LSC interrupt. Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts") Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/net/virtio/virtio_ethdev.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index e58085a2c9..314a291e8c 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1684,13 +1684,15 @@ virtio_configure_intr(struct rte_eth_dev *dev) } } - /* Re-register callback to update max_intr */ - rte_intr_callback_unregister(dev->intr_handle, - virtio_interrupt_handler, - dev); - rte_intr_callback_register(dev->intr_handle, - virtio_interrupt_handler, - dev); + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { + /* Re-register callback to update max_intr */ + rte_intr_callback_unregister(dev->intr_handle, + virtio_interrupt_handler, + dev); + rte_intr_callback_register(dev->intr_handle, + virtio_interrupt_handler, + dev); + } /* DO NOT try to remove this! This function will enable msix, or QEMU * will encounter SIGSEGV when DRIVER_OK is sent. -- 2.23.0