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 767C0A0C4B; Thu, 17 Jun 2021 17:18:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DFF04067A; Thu, 17 Jun 2021 17:18:41 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 7F8C340150 for ; Thu, 17 Jun 2021 17:18:39 +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) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 28F627F40D; Thu, 17 Jun 2021 18:18:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 28F627F40D DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1623943119; bh=PYv0jz4CMu7ZqpHUBxmOgEHFVBtbsWU4B0drbIUQNfk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=mJAMsukkbPuDSU+l4rahRP/pXYh8X12s3aaBKT+6Gj4hKzydPUey6OOb094lhf1G2 ydvDx7rBnpGyKKAJ3qMbFjUfR8xAdrOJLsAF8PwQt2QOsqip2pd6s4Vl02qphosDxA F2VqHVfMAHaxzhd0PI9H0fvEswNqiRfiQjq0EMjU= To: "Min Hu (Connor)" , dev@dpdk.org Cc: ferruh.yigit@intel.com, Stephen Hemminger References: <1623548576-34995-2-git-send-email-humin29@huawei.com> <1623720869-26320-1-git-send-email-humin29@huawei.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <6a9b27c2-1bab-e2a2-a6e6-c1e4300505c4@oktetlabs.ru> Date: Thu, 17 Jun 2021 18:18:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <1623720869-26320-1-git-send-email-humin29@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net/hns3: support Tx push quick doorbell to improve perf 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 6/15/21 4:34 AM, Min Hu (Connor) wrote: > From: Chengwen Feng > > Kunpeng 930 support Tx push mode which could improve performance, It > works like below: > 1. Add PCIe bar45 which support driver direct write the Tx descriptor > or tail reg to it. > 2. Support three operations: a) direct write one Tx descriptor, b) > direct write two Tx descriptors, c) direct write tail reg. > 3. The original tail reg located at bar23, the above bar45 tail reg > could provide better bandwidth from the hardware perspective. > > The hns3 driver only support direct write tail reg (also have the name > of quick doorbell), the detail: > Considering compatibility, firmware will report Tx push capa if the > hardware support it. > > Signed-off-by: Chengwen Feng > Signed-off-by: Min Hu (Connor) With description mangled a bit and few minor fixes described below. Applied, thanks. [snip] > diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c > index 1d7a769..1fb16cd 100644 > --- a/drivers/net/hns3/hns3_rxtx.c > +++ b/drivers/net/hns3/hns3_rxtx.c > @@ -2892,6 +2892,69 @@ hns3_tx_queue_conf_check(struct hns3_hw *hw, const struct rte_eth_txconf *conf, > return 0; > } > > +static void * > +hns3_tx_push_get_queue_tail_reg(struct rte_eth_dev *dev, uint16_t queue_id) > +{ > +#define HNS3_TX_PUSH_TQP_REGION_SIZE 0x10000 > +#define HNS3_TX_PUSH_QUICK_DOORBELL_OFFSET 64 > +#define HNS3_TX_PUSH_PCI_BAR_INDEX 4 > + > + struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device); > + uint8_t bar_id = HNS3_TX_PUSH_PCI_BAR_INDEX; > + > + /* > + * If device support Tx push then its PCIe bar45 must exist, and DPDK > + * framework will mmap the bar45 default in pci probe stage. pci -> PCI > + * > + * In the bar45, the first half is for roce(RDMA over Converged roce -> RoCE > + * Ethernet), and the second half is for NIC, every TQP occupy 64KB. > + * > + * The quick doorbell located at 64B offset in the TQP region. > + */ > + return (void *)((char *)pci_dev->mem_resource[bar_id].addr + > + (pci_dev->mem_resource[bar_id].len >> 1) + > + HNS3_TX_PUSH_TQP_REGION_SIZE * queue_id + > + HNS3_TX_PUSH_QUICK_DOORBELL_OFFSET); Remove unnecessary type cast to 'void *'. [snip]