All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "'David Harton (dharton)'" <dharton@cisco.com>,
	"Wang, Liang-min" <liang-min.wang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH v4 1/4] ethdev: add apis to support access device	info
Date: Tue, 16 Jun 2015 18:15:08 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB97725836A11DCE@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725836A0A9E5@irsmsx105.ger.corp.intel.com>



> > > > > > > > > > +int
> > > > > > > > > > +rte_eth_dev_get_ringparam(uint8_t port_id, struct
> > > > > > > > > > +rte_dev_ring_info
> > > > > > > > > > +*info) {
> > > > > > > > > > +	struct rte_eth_dev *dev;
> > > > > > > > > > +
> > > > > > > > > > +	if (!rte_eth_dev_is_valid_port(port_id)) {
> > > > > > > > > > +		PMD_DEBUG_TRACE("Invalid port_id=%d\n",
> > > > > port_id);
> > > > > > > > > > +		return -ENODEV;
> > > > > > > > > > +	}
> > > > > > > > > > +
> > > > > > > > > > +	if ((dev= &rte_eth_devices[port_id]) == NULL) {
> > > > > > > > > > +		PMD_DEBUG_TRACE("Invalid port device\n");
> > > > > > > > > > +		return -ENODEV;
> > > > > > > > > > +	}
> > > > > > > > > > +
> > > > > > > > > > +	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_ringparam, -
> > > > > > > > > ENOTSUP);
> > > > > > > > > > +	return (*dev->dev_ops->get_ringparam)(dev, info); }
> > > > > > > > >
> > > > > > > > > I think it will be a useful addition to the ethdev API  to
> > > > > > > > > have an ability to retrieve current RX/TX queue parameters.
> > > > > > > > > Though again, it need to be more generic, so it could be
> > > > > > > > > useful for
> > > > > > > > > non- ethtool upper layer too.
> > > > > > > > > So I suggest to modify it a bit.
> > > > > > > > > Something like that:
> > > > > > > > >
> > > > > > > > > struct rte_eth_tx_queue_info {
> > > > > > > > >     struct rte_eth_txconf txconf;
> > > > > > > > >     uint32_t nb_tx_desc;
> > > > > > > > >     uint32_t nb_max_tx_desc; /*max allowable TXDs for that
> > > queue */
> > > > > > > > >     uint32_t nb_tx_free;            /* number of free TXDs at
> > > the moment
> > > > > of
> > > > > > > call.
> > > > > > > > > */
> > > > > > > > >     /* other tx queue data. */ };
> > > > > > > > >
> > > > > > > > > int rte_etdev_get_tx_queue_info(portid, queue_id, struct
> > > > > > > > > rte_eth_tx_queue_info *qinfo)
> > > > > > > > >
> > > > > > > > > Then, your upper layer ethtool wrapper, can implement yours
> > > > > > > > > ethtool_get_ringparam() by:
> > > > > > > > >
> > > > > > > > >  ...
> > > > > > > > >  struct rte_eth_tx_queue_info qinfo;
> > > > > > > > > rte_ethdev_get_tx_queue_info(port, 0, &qinfo);
> > > > > > > > > ring_param->tx_pending = qinfo.nb_tx_desc -
> > > > > > > > > rte_eth_rx_queue_count(port, 0);
> > > > > > > > >
> > > > > > > > > Or probably even:
> > > > > > > > > ring_param->tx_pending = qinfo.nb_tx_desc -
> > > > > > > > > qinfo.nb_tx_free;
> > > > > > > > >
> > > > > > > > > Same for RX.
> > > > > > > > >
> > > > > > > > For now, this descriptor ring information is used by the ethtool
> > > op.
> > > > > > > > To make this interface simple, i.e. caller doesn't need to
> > > > > > > > access other
> > > > > > > queue information.
> > > > > > >
> > > > > > > I just repeat what I said to you in off-line conversation:
> > > > > > > ethdev API is not equal ethtool API.
> > > > > > > It is ok to add  a new function/structure to ethdev if it really
> > > > > > > needed, but we should do mechanical one to one copy.
> > > > > > > It is much better to add  a function/structure that would be
> > > > > > > more generic, and suit other users, not only ethtool.
> > > > > > > There is no point to have dozen functions in rte_ethdev API
> > > > > > > providing similar information.
> > > > > > > BTW, I don't see how API I proposed is much more  complex, then
> > > > > > > yours
> > > > > one.
> > > > > > The ring parameter is a run-time information which is different
> > > > > > than data
> > > > > structure described in this discussion.
> > > > >
> > > > > I don't see how they are different.
> > > > > Looking at ixgbe_get_ringparam(), it returns:
> > > > > rx_max_pending - that's a static IXGBE PMD value (max possible
> > > > > number of RXDs per one queue).
> > > > > rx_pending - number of RXD currently in use by the HW for queue 0
> > > > > (that information can be changed at each call).
> > > > >
> > > > > With the approach I suggesting - you can get same information for
> > > > > each RX queue by calling rte_ethdev_get_rx_queue_info() and
> > > > > rte_eth_rx_queue_count().
> > > > > Plus you are getting other RX queue data.
> > > > >
> > > > > Another thing - what is practical usage of the information you
> > > > > retrieving now by get_ringparam()?
> > > > > Let say it returned to you: rx_max_pending=4096; rx_pending=128; How
> > > > > that information would help to understand what is going on with the
> > > device?
> > > > > Without knowing  value of nb_tx_desc for the queue, you can't say is
> > > > > you queue full or not.
> > > > > Again, it could be that all your traffic going through some other
> > > > > queue (not 0).
> > > > > So from my point rte_eth_dev_get_ringparam()  usage is very limited,
> > > > > and doesn't provide enough information about current queue state.
> > > > >
> > > > > Same thing applies for TX.
> > > > >
> > > >
> > > > After careful review the suggestion in this comment, and review the
> > > existing dpdk source code.
> > > > I came to realize that neither rte_ethdev_get_rx_queue_info,
> > > > rte_ethdev_get_tx_queue_info, struct rte_eth_rx_queue_info and struct
> > > > rte_eth_tx_queue_info are available in the existing dpdk source code. I
> > > could not make a patch based upon a set of non- existent API and data
> > > structure.
> > >
> > > Right now, in dpdk.org source code, struct  rte_eth_dev_ring_info, struct
> > > rte_dev_eeprom_info and struct  rte_dev_reg_info don't exist also.
> > > Same as  all these functions:
> > >
> > > rte_eth_dev_default_mac_addr_set
> > > rte_eth_dev_reg_length
> > > rte_eth_dev_reg_info
> > > rte_eth_dev_eeprom_length
> > > rte_eth_dev_get_eeprom
> > > rte_eth_dev_set_eeprom
> > > rte_eth_dev_get_ringparam
> > >
> > > All this is a new API that's you are trying to add.
> > > But, by some reason you consider it is ok to add 'struct
> > > rte_eth_dev_ring_info', but couldn't add  struct
> > > 'rte_ethdev_get_tx_queue_info'
> > > That just doesn't make any sense to me.
> > > In fact, I think our conversation is going in cycles.
> > > If you are not happy with the suggested approach, please provide some
> > > meaningful reason why.
> > > Konstantin
> >
> > It seems the new API aims at providing users a mechanism to quickly and
> > gracefully migrate from using ethtool/ioctl calls.
> 
> I am fine with that goal in general.
> But it doesn't mean that all ethool API should be pushed into rte_ethdev layer.
> That's why  a shim layer on top of rte_ethdev is created -
> it's goal is to provide for the upper layer an ethool-like API and
> hide actual implementation based on rte_ethdev API inside.
> 
> >  The provided get/set
> > ring param info is very similar to that of ethtool and facilitates the
> > ethtool needs.
> 

Actually a quick questions to you guys:
Looking at linux struct ethtool_ringparam description, I am seeing:
http://lxr.free-electrons.com/source/include/uapi/linux/ethtool.h:
@rx_pending: Current maximum number of pending entries per RX ring

And all linux driver I looked at (ixgbe,i40e,virtio,vmxbet3) returns number
of configured RX descriptors for queue 0.
In DPDK terms: nb_desc for the queue.

While in Larry's patch,  ixgbe_get_ringparam() for rx_pending returns
number of RX descriptors that are in HW use (for queue 0).
So, did you intentionally change linux ethool get_ringparam() behaviour here,
or is it just a mistake?

Konstantin
 

  reply	other threads:[~2015-06-16 18:15 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-30  0:37 [PATCH 0/2] User-space Ethtool Liang-Min Larry Wang
2015-05-30  0:37 ` [PATCH 1/2] ethdev: add api to set default mac address Liang-Min Larry Wang
2015-05-30  1:57   ` Andrew Harvey (agh)
2015-05-30  0:37 ` [PATCH 2/2] ethtool: add new library to provide ethtool-alike APIs Liang-Min Larry Wang
2015-05-30 15:48   ` Stephen Hemminger
2015-05-30 16:16     ` Wang, Liang-min
2015-05-30 19:26       ` Stephen Hemminger
2015-05-30 19:40         ` Wang, Liang-min
2015-05-31 16:48           ` Stephen Hemminger
2015-05-31 17:30             ` Wang, Liang-min
2015-05-31 18:31             ` Wang, Liang-min
2015-06-01 12:42   ` David Harton (dharton)
2015-06-10 15:09 ` [PATCH v4 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-10 15:09   ` [PATCH v4 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-10 15:21     ` David Harton (dharton)
2015-06-11 12:26     ` Ananyev, Konstantin
2015-06-11 12:57       ` Wang, Liang-min
2015-06-11 13:07         ` Ananyev, Konstantin
2015-06-11 21:51           ` Wang, Liang-min
2015-06-12 12:30             ` Ananyev, Konstantin
2015-06-15 13:26               ` Wang, Liang-min
2015-06-15 13:45                 ` Ananyev, Konstantin
2015-06-15 14:47                   ` Wang, Liang-min
2015-06-15 18:10                     ` Ananyev, Konstantin
2015-06-17 17:25                       ` Ananyev, Konstantin
2015-06-15 16:05                   ` David Harton (dharton)
2015-06-15 18:23                     ` Ananyev, Konstantin
2015-06-16 18:15                       ` Ananyev, Konstantin [this message]
2015-06-11 13:14         ` Ananyev, Konstantin
2015-06-11 13:25           ` Wang, Liang-min
2015-06-10 15:09   ` [PATCH v4 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-10 15:09   ` [PATCH v4 3/4] igb: " Liang-Min Larry Wang
2015-06-10 15:09   ` [PATCH v4 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-11 21:43 ` [PATCH v5 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-11 21:43   ` [PATCH v5 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-11 21:43   ` [PATCH v5 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-11 21:43   ` [PATCH v5 3/4] igb: " Liang-Min Larry Wang
2015-06-11 21:43   ` [PATCH v5 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-12 22:03 ` [PATCH v6 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-12 22:03   ` [PATCH v6 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-13 23:25     ` David Harton (dharton)
2015-06-12 22:03   ` [PATCH v6 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-12 22:03   ` [PATCH v6 3/4] igb: " Liang-Min Larry Wang
2015-06-12 22:03   ` [PATCH v6 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-13  0:21   ` [PATCH v6 0/4] User-space Ethtool Andrew Harvey (agh)
2015-06-17 22:22 ` [PATCH v7 " Liang-Min Larry Wang
2015-06-17 22:22   ` [PATCH v7 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-25 13:39     ` Stephen Hemminger
2015-06-25 20:58       ` Wang, Liang-min
2015-06-25 13:44     ` Stephen Hemminger
2015-06-25 21:05       ` Wang, Liang-min
2015-06-17 22:22   ` [PATCH v7 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-25 13:45     ` Stephen Hemminger
2015-06-26  6:26       ` Andrew Harvey (agh)
2015-06-17 22:22   ` [PATCH v7 3/4] igb: " Liang-Min Larry Wang
2015-06-17 22:22   ` [PATCH v7 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-18  2:04   ` [PATCH v7 0/4] User-space Ethtool Stephen Hemminger
2015-06-18 12:47     ` Wang, Liang-min
2015-06-23 15:19       ` Wang, Liang-min
2015-06-24 13:55   ` Andrew Harvey (agh)
2015-06-24 17:16   ` David Harton (dharton)
2015-06-26 14:26 ` [PATCH v8 0/5] " Liang-Min Larry Wang
2015-06-26 14:26   ` [PATCH v8 1/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-26 16:51     ` Stephen Hemminger
2015-06-26 17:05       ` Wang, Liang-min
2015-06-27  1:21       ` Wang, Liang-min
2015-06-26 14:26   ` [PATCH v8 2/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-26 14:26   ` [PATCH v8 3/5] igb: " Liang-Min Larry Wang
2015-06-26 14:26   ` [PATCH v8 4/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-26 14:26   ` [PATCH v8 5/5] Changed register tables to const Liang-Min Larry Wang
2015-06-26 19:15   ` [PATCH v8 0/5] User-space Ethtool Ananyev, Konstantin
2015-06-27  1:19 ` [PATCH v9 " Liang-Min Larry Wang
2015-06-27  1:19   ` [PATCH v9 1/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27  1:19   ` [PATCH v9 2/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27  1:32     ` Stephen Hemminger
2015-06-27  2:37       ` Wang, Liang-min
2015-06-27  1:34     ` Stephen Hemminger
2015-06-27  2:39       ` Wang, Liang-min
2015-06-27  1:34     ` Stephen Hemminger
2015-06-27  1:19   ` [PATCH v9 3/5] igb: " Liang-Min Larry Wang
2015-06-27  1:35     ` Stephen Hemminger
2015-06-27  1:19   ` [PATCH v9 4/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-27  1:19   ` [PATCH v9 5/5] ixgbe/igb: changed register tables to const Liang-Min Larry Wang
2015-06-27  1:36     ` Stephen Hemminger
2015-06-27  1:50       ` Wang, Liang-min
2015-06-27  2:40       ` Wang, Liang-min
2015-07-10 12:55       ` Wang, Liang-min
2015-06-27  2:36 ` [PATCH v10 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-27  2:36   ` [PATCH v10 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27  2:36   ` [PATCH v10 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27  2:36   ` [PATCH v10 3/4] igb: " Liang-Min Larry Wang
2015-06-27  2:36   ` [PATCH v10 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-06-27 12:25 ` [PATCH v11 0/4] User-space Ethtool Liang-Min Larry Wang
2015-06-27 12:25   ` [PATCH v11 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-06-27 12:25   ` [PATCH v11 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-06-27 12:25   ` [PATCH v11 3/4] igb: " Liang-Min Larry Wang
2015-06-27 12:25   ` [PATCH v11 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-07 17:39 ` [PATCH v12 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-07 17:39   ` [PATCH v12 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-07 17:39   ` [PATCH v12 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-07 17:39   ` [PATCH v12 3/4] igb: " Liang-Min Larry Wang
2015-07-07 17:39   ` [PATCH v12 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-10 12:48 ` [PATCH v13 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-10 12:48   ` [PATCH v13 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-10 12:48   ` [PATCH v13 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-10 12:48   ` [PATCH v13 3/4] igb: " Liang-Min Larry Wang
2015-07-10 12:48   ` [PATCH v13 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-12 21:22 ` [PATCH v14 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-12 21:22   ` [PATCH v14 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-13 22:26     ` Thomas Monjalon
2015-07-12 21:22   ` [PATCH v14 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-12 21:22   ` [PATCH v14 3/4] igb: " Liang-Min Larry Wang
2015-07-12 21:22   ` [PATCH v14 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14  2:18 ` [PATCH v15 0/4] User-space Ethtool Liang-Min Larry Wang
2015-07-14  2:18   ` [PATCH v15 1/4] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-15  6:16     ` Thomas Monjalon
2015-07-15 10:07       ` Wang, Liang-min
2015-07-15 10:27         ` Thomas Monjalon
2015-07-15 10:48           ` Wang, Liang-min
2015-07-15 11:20             ` Thomas Monjalon
2015-07-15 11:36               ` Wang, Liang-min
2015-07-15 12:06                 ` Thomas Monjalon
2015-07-14  2:18   ` [PATCH v15 2/4] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-14  2:18   ` [PATCH v15 3/4] igb: " Liang-Min Larry Wang
2015-07-14  2:18   ` [PATCH v15 4/4] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14 13:11 ` [PATCH v16 0/6] User-space Ethtool Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 1/6] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 2/6] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 3/6] igb: " Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 4/6] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 5/6] ethdev: change api name, version information and fix macro Liang-Min Larry Wang
2015-07-14 13:11   ` [PATCH v16 6/6] examples/l2fwd-ethtool: replace lib with new API name Liang-Min Larry Wang
2015-07-14 20:13   ` [PATCH v16 0/6] User-space Ethtool Thomas Monjalon
2015-07-14 20:56     ` Wang, Liang-min
2015-07-15  5:53       ` Thomas Monjalon
2015-07-15 10:15         ` Wang, Liang-min
2015-07-15 10:30           ` Thomas Monjalon
2015-07-16 13:25 ` [PATCH v17 0/5] " Liang-Min Larry Wang
2015-07-16 13:25   ` [PATCH v17 1/5] ethdev: add api to support setting default mac addr Liang-Min Larry Wang
2015-07-16 13:25   ` [PATCH v17 2/5] ethdev: add apis to support access device info Liang-Min Larry Wang
2015-07-16 13:25   ` [PATCH v17 3/5] ixgbe: add ops to support ethtool ops Liang-Min Larry Wang
2015-07-16 13:25   ` [PATCH v17 4/5] igb: " Liang-Min Larry Wang
2015-07-16 13:25   ` [PATCH v17 5/5] examples: new example: l2fwd-ethtool Liang-Min Larry Wang
2015-07-16 21:25     ` Thomas Monjalon
2015-07-16 21:48   ` [PATCH v17 0/5] User-space Ethtool Thomas Monjalon
2015-07-16 21:55     ` Wang, Liang-min
2015-07-16 22:09       ` Thomas Monjalon
2015-07-16 22:15         ` Wang, Liang-min

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2601191342CEEE43887BDE71AB97725836A11DCE@irsmsx105.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    --cc=dharton@cisco.com \
    --cc=liang-min.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.