From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SSEzdgll2WZPJUJ0lQAz23No9UgkXd+MUn/zh5nKSXo=; b=L+7lgc5DV9d0TMVqgUt75k1jkFArAEcuzCfmQ2gFtsO9U36EuJziYAHm8hPJtj0fbs Lu7bdLUmhbL7+bbxMAiXSZjTIu8MXA3s/rrfxP5TMdUruiAd5CeMfLKV5DJvh/tiNYnH cHejDdvILoSk/9v2fY7HUhv9O1Yoo66YLO9jcp4AWu5eE1VsTJZ+gvkBTxxy8OQKGArP 3WMElOTl88sAJdNH0HyYWgoDLJJ7LUEZZIUZfemN7or9jlZUXXUDNb1QxGOlR/Mle/Id OHc95DognRkWKlYk2eptkBv9Pgfk8h9gBNfFsqnQaDQ0VywTyV5sjX8V/2CU6CMXpWBh 4PYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SSEzdgll2WZPJUJ0lQAz23No9UgkXd+MUn/zh5nKSXo=; b=ESQQCrO+RrujTEYZYW9E11ghy2e6Ynul2AfI7mH75HHTxxEkcDl81MUysONtEcTnMr HFdN3kWq5cgcYWXRMTWjL208ZkJwQwIGY5PcZWd64s9wG2bVQWoXHKopj6vayGlMueYT VSFn+7DckWc3//lg3Q9JNpQRg6ZRrDM19gmrEBd0BGInToOXHRZoM1msSGuKZ01fThdx hZPzRfVNfjQPn8elw6ZHVwAPeiYJu/b76F34Jwp+vSwaW7FRH+Hv01Pjc5tnknkvE5td YlLZtVD6etuyFh/KTImDlpgpK5+4m3LX0u4MAOkecqQXbgTqhgwNrCu3GKgYYb445L0B tdvA== X-Gm-Message-State: AIkVDXKtvkMEclPfZ1Y2P/WZXwuWqbGqiCwytaryh2uqBuO5zu0dOsBGhwu8rqz2iqoviQ== X-Received: by 10.98.13.130 with SMTP id 2mr13789798pfn.185.1484185284703; Wed, 11 Jan 2017 17:41:24 -0800 (PST) Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id b10sm16610464pga.21.2017.01.11.17.41.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jan 2017 17:41:24 -0800 (PST) Date: Wed, 11 Jan 2017 17:41:17 -0800 From: Stephen Hemminger To: Billy McFall Cc: thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, dev@dpdk.org Message-ID: <20170111174117.0b450730@xeon-e3> In-Reply-To: <20170111200323.12938-2-bmcfall@redhat.com> 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 Subject: Re: [dpdk-dev] [PATCH v2 1/3] ethdev: new API to free consumed buffers in Tx ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 01:41:25 -0000 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.