DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yang, Qiming" <qiming.yang@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Zhao1, Wei" <wei.zhao1@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6 1/3] lib/librte_ether: add support for port	reset
Date: Fri, 7 Apr 2017 06:58:48 +0000	[thread overview]
Message-ID: <F5DF4F0E3AFEF648ADC1C3C33AD4DBF16EE00004@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1491461483-39861-2-git-send-email-wei.zhao1@intel.com>

Hi, Wei

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao
> Sent: Thursday, April 6, 2017 2:51 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH v6 1/3] lib/librte_ether: add support for port
> reset
> 
> Add support for port reset in rte layer.This reset feature can not only used in
> vf port reset in later code develop, but alsopf port.But in this patch set, we
> only limit the discussion scope to vf reset.
> This patch Add an API to restart the device.

' alsopf' should add space. 'Add' should be lowercase.

> It's for VF device in this scenario, kernel PF + DPDK VF.
> When the PF port down->up, APP should call this API to restart VF port. Most
> likely, APP should call it in its management thread and guarantee the thread
> safe. It means APP should stop the rx/tx and the device, then restart the
> device, then recover the device and rx/tx.This API can also do some restore
> work for the port.

Please check the grammar problems in this paragraph.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  lib/librte_ether/rte_ethdev.c          | 17 +++++++++++++++++
>  lib/librte_ether/rte_ethdev.h          | 28 ++++++++++++++++++++++++++++
>  lib/librte_ether/rte_ether_version.map |  6 ++++++
>  3 files changed, 51 insertions(+)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index eb0a94a..2e06dca 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -3273,3 +3273,20 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t
> port_id,
>  				-ENOTSUP);
>  	return (*dev->dev_ops->l2_tunnel_offload_set)(dev, l2_tunnel,
> mask, en);  }
> +
> +int
> +rte_eth_dev_reset(uint8_t port_id)
> +{
> +	struct rte_eth_dev *dev;
> +	int diag;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	dev = &rte_eth_devices[port_id];
> +
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_reset, -
> ENOTSUP);
> +
> +	diag = (*dev->dev_ops->dev_reset)(dev);
> +
> +	return diag;
> +}
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 4be217c..8287c50 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1367,6 +1367,9 @@ typedef int (*eth_l2_tunnel_offload_set_t)
>  	 uint8_t en);
>  /**< @internal enable/disable the l2 tunnel offload functions */
> 
> +typedef int  (*eth_dev_reset_t)(struct rte_eth_dev *dev); /**<
> +@internal Function used to reset a configured Ethernet device. */
> +
>  #ifdef RTE_NIC_BYPASS
> 
>  enum {
> @@ -1509,6 +1512,9 @@ struct eth_dev_ops {
>  	eth_l2_tunnel_offload_set_t   l2_tunnel_offload_set;
>  	/** Enable/disable l2 tunnel offload functions. */
> 
> +	/** Reset device. */
> +	eth_dev_reset_t dev_reset;
> +
>  	eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue
> rate limit. */
> 
>  	rss_hash_update_t          rss_hash_update; /** Configure RSS hash
> protocols. */
> @@ -4413,6 +4419,28 @@ int
>  rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
> 
>  /**
> + * Reset an ethernet device when it's not working. One scenario is,
> +after PF
> + * port is down and up, the related VF port should be reset.

Is there have other scenario? I don't know what is 'down and up' means? Can you put it another way? 

> + * The API will stop the port, clear the rx/tx queues, re-setup the
> +rx/tx
> + * queues, restart the port.
> + * Before calling this API, APP should stop the rx/tx. When tx is being
> +stopped,
> + * APP can drop the packets and release the buffer instead of sending them.
> + * This function can also do some restore work for the port, for
> +example, it can
> + * restore the added parameters of vlan,  mac_addrs,
> +promisc_unicast_enabled
> + * flag and promisc_multicast_enabled flag.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + *
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if port identifier is invalid.
> + *   - (-ENOTSUP) if hardware doesn't support this function.
> + */
> +int
> +rte_eth_dev_reset(uint8_t port_id);
> +
> +/**
>   * @internal
>   * Wrapper for use by pci drivers as a .probe function to attach to a ethdev
>   * interface.
> diff --git a/lib/librte_ether/rte_ether_version.map
> b/lib/librte_ether/rte_ether_version.map
> index c6c9d0d..529b27f 100644
> --- a/lib/librte_ether/rte_ether_version.map
> +++ b/lib/librte_ether/rte_ether_version.map
> @@ -154,3 +154,9 @@ DPDK_17.02 {
>  	rte_flow_validate;
> 
>  } DPDK_16.11;
> +
> +DPDK_17.05 {
> +	global:
> +
> +	rte_eth_dev_reset;
> +} DPDK_17.02;
> \ No newline at end of file
> --
> 2.9.3

  reply	other threads:[~2017-04-07  6:58 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  9:34 [dpdk-dev] [PATCH v4 0/3] net/i40e: vf " Wei Zhao
2017-03-30  9:34 ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for " Wei Zhao
2017-03-30 19:55   ` Thomas Monjalon
2017-04-06  2:57     ` Zhao1, Wei
2017-04-06  7:11       ` Thomas Monjalon
2017-04-06  8:53         ` Zhao1, Wei
2017-04-06  9:02           ` Ananyev, Konstantin
2017-04-10 20:58             ` Thomas Monjalon
2017-04-13  8:55             ` Zhao1, Wei
2017-04-13 10:06               ` Thomas Monjalon
2017-04-14  1:29                 ` Zhao1, Wei
2017-04-14  6:31                   ` Thomas Monjalon
2017-04-14  8:03                     ` Zhao1, Wei
2017-04-17  2:08                       ` Zhao1, Wei
2017-04-17  5:02                         ` Zhao1, Wei
2017-04-20  6:07       ` Yuanhan Liu
2017-04-20  9:17         ` Zhao1, Wei
2017-04-21  2:27           ` Yuanhan Liu
2017-04-21  8:27             ` Thomas Monjalon
2017-04-21  8:59               ` Zhao1, Wei
2017-04-21  9:28                 ` Thomas Monjalon
2017-04-24  2:01                   ` Yuanhan Liu
2017-04-24  3:15                     ` Zhao1, Wei
2017-04-24  3:39                     ` Zhao1, Wei
2017-04-24  8:04                       ` Thomas Monjalon
2017-04-25  3:14                         ` Zhao1, Wei
2017-04-21  8:55             ` Zhao1, Wei
2017-03-30  9:34 ` [dpdk-dev] [PATCH v4 2/3] net/i40e: implement device reset on port Wei Zhao
2017-03-30  9:34 ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: add port reset command into testpmd Wei Zhao
2017-03-30 12:32 ` [dpdk-dev] [PATCH v4 0/3] net/i40e: vf port reset Wu, Jingjing
2017-04-05  5:42   ` Zhao1, Wei
2017-04-06  6:33 ` [dpdk-dev] [PATCH v5 " Wei Zhao
2017-04-06  6:33   ` [dpdk-dev] [PATCH v5 1/3] lib/librte_ether: add support for " Wei Zhao
2017-04-06  6:33   ` [dpdk-dev] [PATCH v5 2/3] net/i40e: implement device reset on port Wei Zhao
2017-04-06  6:33   ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: add port reset command into testpmd Wei Zhao
2017-04-06  6:51   ` [dpdk-dev] [PATCH v6 0/3] net/i40e: vf port reset Wei Zhao
2017-04-06  6:51     ` [dpdk-dev] [PATCH v6 1/3] lib/librte_ether: add support for " Wei Zhao
2017-04-07  6:58       ` Yang, Qiming [this message]
2017-04-10  2:21         ` Zhao1, Wei
2017-04-06  6:51     ` [dpdk-dev] [PATCH v6 2/3] net/i40e: implement device reset on port Wei Zhao
2017-04-06  6:51     ` [dpdk-dev] [PATCH v6 3/3] app/testpmd: add port reset command into testpmd Wei Zhao
2017-04-10  3:02     ` [dpdk-dev] [PATCH v7 0/3] net/i40e: vf port reset Wei Zhao
2017-04-10  3:02       ` [dpdk-dev] [PATCH v7 1/3] lib/librte_ether: add support for " Wei Zhao
2017-04-20 20:49         ` Thomas Monjalon
2017-04-21  3:20           ` Zhao1, Wei
2017-04-20 20:52         ` Thomas Monjalon
2017-04-10  3:02       ` [dpdk-dev] [PATCH v7 2/3] net/i40e: implement device reset on port Wei Zhao
2017-04-20 21:12         ` Thomas Monjalon
2017-04-21  3:39           ` Zhao1, Wei
2017-04-20 21:20         ` Thomas Monjalon
2017-04-10  3:02       ` [dpdk-dev] [PATCH v7 3/3] app/testpmd: add port reset command into testpmd Wei Zhao
2017-04-20 21:37       ` [dpdk-dev] [PATCH v7 0/3] net/i40e: vf port reset Thomas Monjalon

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=F5DF4F0E3AFEF648ADC1C3C33AD4DBF16EE00004@SHSMSX101.ccr.corp.intel.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=wei.zhao1@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).