From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 1/3] ether: Add API to support setting TX rate for queue and VF Date: Wed, 28 May 2014 00:47:52 +0200 Message-ID: <2115230.WNnKFPWGt0@xps13> References: <1401090331-18455-1-git-send-email-changchun.ouyang@intel.com> <1401090331-18455-2-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Ouyang Changchun Return-path: In-Reply-To: <1401090331-18455-2-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Changchun, 2014-05-26 15:45, Ouyang Changchun: > /** > + * Set the rate limitation for a queue on an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_idx > + * The queue id. > + * @param tx_rate > + * The tx rate allocated from the total link speed for this queue. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support this feature. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EINVAL) if bad parameter. > + */ > +int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, > + uint16_t tx_rate); > + > +/** > + * Set the rate limitation for a vf on an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param vf > + * VF id. > + * @param tx_rate > + * The tx rate allocated from the total link speed for this VF id. > + * @param q_msk > + * The queue mask which need to set the rate. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support this feature. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EINVAL) if bad parameter. > + */ > +int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, > + uint16_t tx_rate, uint64_t q_msk); You are defining an API function specifically for VF. It's not generic and shouldn't appear in the API. We now have to be careful about the API and try to build a robust generic API which could become stable. Is it possible to imagine another API where only port and queue parameters are required? Thanks -- Thomas