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 BEE65A0A0C; Mon, 5 Jul 2021 10:58:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D91E40141; Mon, 5 Jul 2021 10:58:21 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CF7404003C for ; Mon, 5 Jul 2021 10:58:19 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 5E69B7F504; Mon, 5 Jul 2021 11:58:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 5E69B7F504 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625475499; bh=eH07lFb1TPLSDCPXjx/sDvdpVZWEOp2XXpw0g7FcVGw=; h=Subject:To:References:From:Date:In-Reply-To; b=LBUJtFaskZ9t/NO75Hpy4jufadx/nLazy9jVKLMdrhBjPNbjjBcUoRoiSeUEJ5qko IbzLTX/C2KyeRCGoeLFX7XguTz6QfbvCJBPY307XFdt6bQN+kinQi2ACtWJhPOWC7R 8SkqD8FIRZ2gi9K2uSWkzEERT5/BzLuvWoYYBZBE= To: Jiawen Wu , dev@dpdk.org References: <20210617110005.4132926-1-jiawenwu@trustnetic.com> <20210617110005.4132926-11-jiawenwu@trustnetic.com> <52460389-4422-31c8-76fa-0a8790aa033d@oktetlabs.ru> <00a701d7716c$d705b0c0$85111240$@trustnetic.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <423e6fce-24ef-efa3-b032-565aca256a79@oktetlabs.ru> Date: Mon, 5 Jul 2021 11:58:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <00a701d7716c$d705b0c0$85111240$@trustnetic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 10/19] net/ngbe: support link update 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 7/5/21 10:10 AM, Jiawen Wu wrote: > On July 3, 2021 12:24 AM, Andrew Rybchenko wrote: >> On 6/17/21 1:59 PM, Jiawen Wu wrote: >>> Register to handle device interrupt. >>> >>> Signed-off-by: Jiawen Wu >> >> [snip] >> >>> diff --git a/doc/guides/nics/ngbe.rst b/doc/guides/nics/ngbe.rst index >>> 54d0665db9..0918cc2918 100644 >>> --- a/doc/guides/nics/ngbe.rst >>> +++ b/doc/guides/nics/ngbe.rst >>> @@ -8,6 +8,11 @@ The NGBE PMD (librte_pmd_ngbe) provides poll mode >>> driver support for Wangxun 1 Gigabit Ethernet NICs. >>> >>> >>> +Features >>> +-------- >>> + >>> +- Link state information >>> + >> >> Two empty lines before the section. >> >>> Prerequisites >>> ------------- >>> >> >> [snip] >> >>> diff --git a/drivers/net/ngbe/ngbe_ethdev.c >>> b/drivers/net/ngbe/ngbe_ethdev.c index deca64137d..c952023e8b 100644 >>> --- a/drivers/net/ngbe/ngbe_ethdev.c >>> +++ b/drivers/net/ngbe/ngbe_ethdev.c >>> @@ -141,6 +175,23 @@ eth_ngbe_dev_init(struct rte_eth_dev *eth_dev, >> void *init_params __rte_unused) >>> return -ENOMEM; >>> } >>> >>> + ctrl_ext = rd32(hw, NGBE_PORTCTL); >>> + /* let hardware know driver is loaded */ >>> + ctrl_ext |= NGBE_PORTCTL_DRVLOAD; >>> + /* Set PF Reset Done bit so PF/VF Mail Ops can work */ >>> + ctrl_ext |= NGBE_PORTCTL_RSTDONE; >>> + wr32(hw, NGBE_PORTCTL, ctrl_ext); >>> + ngbe_flush(hw); >>> + >>> + rte_intr_callback_register(intr_handle, >>> + ngbe_dev_interrupt_handler, eth_dev); >>> + >>> + /* enable uio/vfio intr/eventfd mapping */ >>> + rte_intr_enable(intr_handle); >>> + >>> + /* enable support intr */ >>> + ngbe_enable_intr(eth_dev); >>> + >> >> I don't understand why it is done unconditionally regardless of the >> corresponding bit in dev_conf. > > Sorry...I don't quite understand what you mean. May be it is OK and it is specific to your HW, but typically interrupts are only enabled and used if requested via either dev_conf->intr_conf.lsc for link status change OR dev_conf->intr_conf.rxq for Rx queues.