From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 1/3] ethdev: new API to free consumed buffers in Tx ring Date: Wed, 11 Jan 2017 17:41:17 -0800 Message-ID: <20170111174117.0b450730@xeon-e3> References: <20170111200323.12938-1-bmcfall@redhat.com> <20170111200323.12938-2-bmcfall@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, dev@dpdk.org To: Billy McFall Return-path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 644685A29 for ; Thu, 12 Jan 2017 02:41:25 +0100 (CET) Received: by mail-pf0-f174.google.com with SMTP id f144so3442363pfa.2 for ; Wed, 11 Jan 2017 17:41:25 -0800 (PST) In-Reply-To: <20170111200323.12938-2-bmcfall@redhat.com> 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 Wed, 11 Jan 2017 15:03:21 -0500 Billy McFall wrote: > /** > + * Request the driver to free mbufs currently cached by the driver. The > + * driver will only free the mbuf if it is no longer in use. It is the > + * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is > + * called if needed. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_id > + * The index of the transmit queue through which output packets must be > + * sent. > + * The value must be in the range [0, nb_tx_queue - 1] previously supplied > + * to rte_eth_dev_configure(). > + * @param free_cnt > + * Maximum number of packets to free. Use 0 to indicate all possible packets > + * should be freed. Note that a packet may be using multiple mbufs. > + * @return > + * Failure: < 0 > + * -ENODEV: Invalid interface > + * -ENOTSUP: Driver does not support function > + * Success: >= 0 > + * 0-n: Number of packets freed. More packets may still remain in ring that > + * are in use. > + */ > + > +static inline int > +rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) Extra white space. > +{ > + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > + > + /* Validate Input Data. Bail if not valid or not supported. */ > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_done_cleanup, -ENOTSUP); > + > + /* Call driver to free pending mbufs. */ > + return (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id], > + free_cnt); > +} > + It doesn't look like this is something that needs to be in critical path. Therefore it makes no sense to inline it.