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 7D2EEA055B; Fri, 3 Jun 2022 12:19:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1959A40694; Fri, 3 Jun 2022 12:19:26 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id A395F40691 for ; Fri, 3 Jun 2022 12:19:24 +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 (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id B6007F0; Fri, 3 Jun 2022 13:19:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B6007F0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1654251564; bh=Ox4GqpY4e1VyKyX/ZDaRpraCS9Yq5mL0owZPkhhkmTE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ivy/nLp7C68Z0s0VBlln8sbSS/USTP26ivqURF2EBnIfPap6SPAvecLqjhxcCSOz1 gsASox6GPdonTQlHHKloPV5sQGcftk/9VuPZ7HkLAlrj2riyYKFTolukPUOHVNdqv5 yROVTtgT3VG1XS6weKABGQ2F1UvXrl8hFAiWAOw0= Message-ID: <55fb8d25-4e86-1676-7803-3d23ba714003@oktetlabs.ru> Date: Fri, 3 Jun 2022 13:19:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v1 3/5] ethdev: add API for direct rearm mode Content-Language: en-US To: Honnappa Nagarahalli , Feifei Wang , Ray Kinsella Cc: "dev@dpdk.org" , nd , Ruifeng Wang , "thomas@monjalon.net" , Ferruh Yigit References: <20220420081650.2043183-1-feifei.wang2@arm.com> <20220420081650.2043183-4-feifei.wang2@arm.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 5/11/22 01:49, Honnappa Nagarahalli wrote: >>> On 4/20/22 11:16, Feifei Wang wrote: >>>> Add API for enabling direct rearm mode and for mapping RX and TX >>>> queues. Currently, the API supports 1:1(txq : rxq) mapping. >>>> >>>> Suggested-by: Honnappa Nagarahalli >>>> Signed-off-by: Feifei Wang >>>> Reviewed-by: Ruifeng Wang >>>> Reviewed-by: Honnappa Nagarahalli >>>> + (*dev->dev_ops->rx_queue_direct_rearm_enable)(dev, >>> rx_queue_id); >>>> + (*dev->dev_ops->rx_queue_direct_rearm_map)(dev, rx_queue_id, >>>> + tx_port_id, tx_queue_id); >>> >>> We must check that function pointers are not NULL as usual. >>> Return values must be checked. >> [Feifei] I agree with this, The check for pointer and return value will be added >> >>> Isn't is safe to setup map and than enable. >>> Otherwise we definitely need disable. >> [Feifei] I will change code that map first and then set 'rxq->offload' to enable >> direct-rearm mode. >> >>> Also, what should happen on Tx port unplug? How to continue if we >>> still have Rx port up and running? >> [Feifei] For direct rearm mode, if Tx port unplug, it means there is no buffer >> from Tx. >> And then, Rx will put buffer from mempool as usual for rearm. > Andrew, when you say 'TX port unplug', do you mean the 'rte_eth_dev_tx_queue_stop' is called? Is calling 'rte_eth_dev_tx_queue_stop' allowed when the device is running? I think that deferred start and presence of rte_eth_dev_tx_queue_stop() implies the possibility to stop Tx queue. But, yes, application should care about conditions to have no traffic running to Tx queue. Anyway, I was talking about hot unplug of the entire device used as Tx port in above config.