DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dai, Wei" <wei.dai@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"Iremonger, Bernard" <bernard.iremonger@intel.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: moved bypass functions to ixgbe pmd
Date: Wed, 31 May 2017 07:41:50 +0000	[thread overview]
Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650A9D156@PGSMSX106.gar.corp.intel.com> (raw)
In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B5C8F21@shsmsx102.ccr.corp.intel.com>

No other NIC has bypass functions except ixgbe, 
so I agree moving them from ethdev to ixgbe pmd.

As these functions are exported to external upper layer application, 
it is necessary to use is_ixgbe_supported() to avoid be called by
other type of NIC.

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lu, Wenzhuo
> Sent: Wednesday, May 31, 2017 11:30 AM
> To: Nicolau, Radu <radu.nicolau@intel.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Nicolau, Radu <radu.nicolau@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] ethdev: moved bypass functions to ixgbe
> pmd
> 
> Hi Radu,
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Radu Nicolau
> > Sent: Monday, May 29, 2017 11:23 PM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh; Iremonger, Bernard; Nicolau, Radu
> > Subject: [dpdk-dev] [PATCH v2] ethdev: moved bypass functions to ixgbe
> > pmd
> >
> > Moved all bypass functions to ixgbe pmd and removed function pointers
> > from the eth_dev_ops struct.
> >
> > Changes in v2:
> > CONFIG_RTE_NIC_BYPASS removed, new option in the IXGBE section added,
> > CONFIG_RTE_LIBRTE_IXGBE_BYPASS.
> > Updated test-pmd to always include the bypass commands.
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> 
> 
> > diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c
> > b/drivers/net/ixgbe/rte_pmd_ixgbe.c
> > index e8fc9a6..efcaf68 100644
> > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
> > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
> > @@ -908,3 +908,109 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port,
> >
> >  	return 0;
> >  }
> > +
> > +#ifdef RTE_LIBRTE_IXGBE_BYPASS
> > +int
> > +rte_pmd_ixgbe_bypass_init(uint8_t port_id) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> Please reference the existing code to check "is_ixgbe_supported" here.
> Because this API may be called by APP directly.
> The same comments for all the other APIs below.
> 
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	ixgbe_bypass_init(dev);
> > +	return 0;
> > +}
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_state_show(dev, state); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_state_store(dev, new_state); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_event_show(uint8_t port_id,
> > +				uint32_t event,
> > +				uint32_t *state)
> > +{
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_event_show(dev, event, state); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_event_store(uint8_t port_id,
> > +				 uint32_t event,
> > +				 uint32_t state)
> > +{
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_event_store(dev, event, state); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t
> > +timeout) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_wd_timeout_store(dev, timeout); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_ver_show(dev, ver); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t
> > +*wd_timeout) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_wd_timeout_show(dev, wd_timeout); }
> > +
> > +int
> > +rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) {
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +	return ixgbe_bypass_wd_reset(dev);
> > +}
> 

  reply	other threads:[~2017-05-31  7:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 14:30 [dpdk-dev] [PATCH] " Radu Nicolau
2017-05-29 10:38 ` Ferruh Yigit
2017-05-29 15:22 ` [dpdk-dev] [PATCH v2] " Radu Nicolau
2017-05-31  3:29   ` Lu, Wenzhuo
2017-05-31  7:41     ` Dai, Wei [this message]
2017-05-31 11:10   ` [dpdk-dev] [PATCH v3] " Radu Nicolau
2017-06-01  0:49     ` Lu, Wenzhuo
2017-06-01 11:26       ` Ferruh Yigit

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=49759EB36A64CF4892C1AFEC9231E8D650A9D156@PGSMSX106.gar.corp.intel.com \
    --to=wei.dai@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=wenzhuo.lu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).