DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
@ 2017-08-07 17:39 David Harton
  2017-08-08  9:02 ` Van Haaren, Harry
  2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
  0 siblings, 2 replies; 18+ messages in thread
From: David Harton @ 2017-08-07 17:39 UTC (permalink / raw)
  To: thomas; +Cc: dev, David Harton

Some devices do not support reset of eth stats.  An application may
need to know not to clear shadow stats if the device cannot.

rte_eth_stats_reset is updated to provide a return code to share
whether the device supports reset or not.

Signed-off-by: David Harton <dharton@cisco.com>
---

v3:
* overcame noob errors and figured out patch challenges
* this release should finally be clean :)

v2:
* fixed soft tab issue inserted while moving changes

 lib/librte_ether/rte_ethdev.c | 8 +++++---
 lib/librte_ether/rte_ethdev.h | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0597641..f72cc5a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1341,17 +1341,19 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
 	return 0;
 }
 
-void
+int
 rte_eth_stats_reset(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
 	(*dev->dev_ops->stats_reset)(dev);
 	dev->data->rx_mbuf_alloc_failed = 0;
+
+	return 0;
 }
 
 static int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0adf327..d8ccd60 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2246,8 +2246,10 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
+ * @return
+ *   Zero if successful. Non-zero otherwise.
  */
-void rte_eth_stats_reset(uint8_t port_id);
+int rte_eth_stats_reset(uint8_t port_id);
 
 /**
  * Retrieve names of extended statistics of an Ethernet device.
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
  2017-08-07 17:39 [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset() David Harton
@ 2017-08-08  9:02 ` Van Haaren, Harry
  2017-08-08 11:01   ` David Harton (dharton)
  2017-08-08 11:03   ` Christian Ehrhardt
  2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
  1 sibling, 2 replies; 18+ messages in thread
From: Van Haaren, Harry @ 2017-08-08  9:02 UTC (permalink / raw)
  To: David Harton, thomas; +Cc: dev

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> Sent: Monday, August 7, 2017 6:39 PM
> To: thomas@monjalon.net
> Cc: dev@dpdk.org; David Harton <dharton@cisco.com>
> Subject: [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
> 
> Some devices do not support reset of eth stats.  An application may
> need to know not to clear shadow stats if the device cannot.
> 
> rte_eth_stats_reset is updated to provide a return code to share
> whether the device supports reset or not.
> 
> Signed-off-by: David Harton <dharton@cisco.com>
> ---

Hi,

As far as I know changing the return type (void to int) of a function does *not* break ABI, but does "break" API as the application code should now check the return value. In theory the application could ignore the return value and current behavior is maintained.

The validate-abi.sh script says "Compatible" with the following item flagged:

Problems with Symbols
High 0
Medium 0
Low	1

Change>> Type of return value has been changed from void to int (4 bytes).
Effect>> Replacement of return type may indicate a change in its semantic meaning.

Perhaps somebody with more ABI expertise than I would double check the return value change?


Some smaller things inline below.

> v3:
> * overcame noob errors and figured out patch challenges
> * this release should finally be clean :)
> 
> v2:
> * fixed soft tab issue inserted while moving changes
> 
>  lib/librte_ether/rte_ethdev.c | 8 +++++---
>  lib/librte_ether/rte_ethdev.h | 4 +++-
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 0597641..f72cc5a 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1341,17 +1341,19 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
>  	return 0;
>  }
> 
> -void
> +int
>  rte_eth_stats_reset(uint8_t port_id)
>  {
>  	struct rte_eth_dev *dev;
> 
> -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
>  	dev = &rte_eth_devices[port_id];
> 
> -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
>  	(*dev->dev_ops->stats_reset)(dev);
>  	dev->data->rx_mbuf_alloc_failed = 0;
> +
> +	return 0;
>  }
> 
>  static int
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 0adf327..d8ccd60 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2246,8 +2246,10 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats
> *stats);
>   *
>   * @param port_id
>   *   The port identifier of the Ethernet device.
> + * @return
> + *   Zero if successful. Non-zero otherwise.

We should document all return values:

@retval 0 Success
@retval -EINVAL Invalid port_id provided
@retval -ENOTSUP Stats reset functionality not supported by PMD

The API change itself should probably be added to release notes, as
applications may wish to be aware this function has changed.

>   */
> -void rte_eth_stats_reset(uint8_t port_id);
> +int rte_eth_stats_reset(uint8_t port_id);
> 
>  /**
>   * Retrieve names of extended statistics of an Ethernet device.
> --
> 2.10.3.dirty


I'm happy to Ack the code/release-notes with above suggestions, but I'd like a second opinion to Ack ABI.

-Harry

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
  2017-08-08  9:02 ` Van Haaren, Harry
@ 2017-08-08 11:01   ` David Harton (dharton)
  2017-08-08 11:03   ` Christian Ehrhardt
  1 sibling, 0 replies; 18+ messages in thread
From: David Harton (dharton) @ 2017-08-08 11:01 UTC (permalink / raw)
  To: Van Haaren, Harry, thomas; +Cc: dev

> -----Original Message-----
> From: Van Haaren, Harry [mailto:harry.van.haaren@intel.com]
> Sent: Tuesday, August 08, 2017 5:03 AM
> To: David Harton (dharton) <dharton@cisco.com>; thomas@monjalon.net
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3] ethdev: add return code to
> rte_eth_stats_reset()
> 
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Monday, August 7, 2017 6:39 PM
> > To: thomas@monjalon.net
> > Cc: dev@dpdk.org; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH v3] ethdev: add return code to
> > rte_eth_stats_reset()
> >
> > Some devices do not support reset of eth stats.  An application may
> > need to know not to clear shadow stats if the device cannot.
> >
> > rte_eth_stats_reset is updated to provide a return code to share
> > whether the device supports reset or not.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> 
> Hi,
> 
> As far as I know changing the return type (void to int) of a function does
> *not* break ABI, but does "break" API as the application code should now
> check the return value. In theory the application could ignore the return
> value and current behavior is maintained.
> 
> The validate-abi.sh script says "Compatible" with the following item
> flagged:
> 
> Problems with Symbols
> High 0
> Medium 0
> Low	1
> 
> Change>> Type of return value has been changed from void to int (4 bytes).
> Effect>> Replacement of return type may indicate a change in its semantic
> meaning.
> 
> Perhaps somebody with more ABI expertise than I would double check the
> return value change?
> 
> 
> Some smaller things inline below.
> 
> > v3:
> > * overcame noob errors and figured out patch challenges
> > * this release should finally be clean :)
> >
> > v2:
> > * fixed soft tab issue inserted while moving changes
> >
> >  lib/librte_ether/rte_ethdev.c | 8 +++++---
> > lib/librte_ether/rte_ethdev.h | 4 +++-
> >  2 files changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/librte_ether/rte_ethdev.c
> > b/lib/librte_ether/rte_ethdev.c index 0597641..f72cc5a 100644
> > --- a/lib/librte_ether/rte_ethdev.c
> > +++ b/lib/librte_ether/rte_ethdev.c
> > @@ -1341,17 +1341,19 @@ rte_eth_stats_get(uint8_t port_id, struct
> rte_eth_stats *stats)
> >  	return 0;
> >  }
> >
> > -void
> > +int
> >  rte_eth_stats_reset(uint8_t port_id)
> >  {
> >  	struct rte_eth_dev *dev;
> >
> > -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
> >  	dev = &rte_eth_devices[port_id];
> >
> > -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
> > +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
> >  	(*dev->dev_ops->stats_reset)(dev);
> >  	dev->data->rx_mbuf_alloc_failed = 0;
> > +
> > +	return 0;
> >  }
> >
> >  static int
> > diff --git a/lib/librte_ether/rte_ethdev.h
> > b/lib/librte_ether/rte_ethdev.h index 0adf327..d8ccd60 100644
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> > @@ -2246,8 +2246,10 @@ int rte_eth_stats_get(uint8_t port_id, struct
> > rte_eth_stats *stats);
> >   *
> >   * @param port_id
> >   *   The port identifier of the Ethernet device.
> > + * @return
> > + *   Zero if successful. Non-zero otherwise.
> 
> We should document all return values:
> 
> @retval 0 Success
> @retval -EINVAL Invalid port_id provided @retval -ENOTSUP Stats reset
> functionality not supported by PMD

Sure.  I was following the convention of function above it
rte_eth_stats_get() but I agree better to advertise externally.
I'll also modify the port number check errval to -ENODEV.

> 
> The API change itself should probably be added to release notes, as
> applications may wish to be aware this function has changed.

Sounds good.

> 
> >   */
> > -void rte_eth_stats_reset(uint8_t port_id);
> > +int rte_eth_stats_reset(uint8_t port_id);
> >
> >  /**
> >   * Retrieve names of extended statistics of an Ethernet device.
> > --
> > 2.10.3.dirty
> 
> 
> I'm happy to Ack the code/release-notes with above suggestions, but I'd
> like a second opinion to Ack ABI.

Thanks for the review,
Dave

> 
> -Harry

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
  2017-08-08  9:02 ` Van Haaren, Harry
  2017-08-08 11:01   ` David Harton (dharton)
@ 2017-08-08 11:03   ` Christian Ehrhardt
  2017-08-08 13:13     ` Thomas Monjalon
  1 sibling, 1 reply; 18+ messages in thread
From: Christian Ehrhardt @ 2017-08-08 11:03 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: David Harton, thomas, dev

On Tue, Aug 8, 2017 at 11:02 AM, Van Haaren, Harry <
harry.van.haaren@intel.com> wrote:

> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Monday, August 7, 2017 6:39 PM
> > To: thomas@monjalon.net
> > Cc: dev@dpdk.org; David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH v3] ethdev: add return code to
> rte_eth_stats_reset()
> >
> > Some devices do not support reset of eth stats.  An application may
> > need to know not to clear shadow stats if the device cannot.
> >
> > rte_eth_stats_reset is updated to provide a return code to share
> > whether the device supports reset or not.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
>
> Hi,
>
> As far as I know changing the return type (void to int) of a function does
> *not* break ABI, but does "break" API as the application code should now
> check the return value. In theory the application could ignore the return
> value and current behavior is maintained.
>

After discussing with Harry on IRC it turns out we both ended up checking
the same online sources
to verify our thoughts, like [1].

Given this and several other sources it seems to be as outlined above an
API but not ABI break.
I'm not an expert and this is mostly opinion, but my personal rule mostly
is: "if in doubt bump it".
Running similar issues I was the one providing [2] for a reason, with this
here being a case that
appears safe but there eventually always seems to come up an architecture
or alternative compiler
which does some arcane register juggling differently and makes those "safe"
changes breaking people after the fact.

[1]:
https://stackoverflow.com/questions/15626579/c-abi-is-it-safe-to-change-void-function-to-return-int
[2]:
http://dpdk.org/doc/guides/contributing/versioning.html#setting-a-major-abi-version

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset()
  2017-08-08 11:03   ` Christian Ehrhardt
@ 2017-08-08 13:13     ` Thomas Monjalon
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Monjalon @ 2017-08-08 13:13 UTC (permalink / raw)
  To: Christian Ehrhardt, David Harton; +Cc: Van Haaren, Harry, dev

08/08/2017 13:03, Christian Ehrhardt:
> On Tue, Aug 8, 2017 at 11:02 AM, Van Haaren, Harry <
> harry.van.haaren@intel.com> wrote:
> > >
> > > Some devices do not support reset of eth stats.  An application may
> > > need to know not to clear shadow stats if the device cannot.
> > >
> > > rte_eth_stats_reset is updated to provide a return code to share
> > > whether the device supports reset or not.
> > >
> > > Signed-off-by: David Harton <dharton@cisco.com>
> > > ---
> >
> > Hi,
> >
> > As far as I know changing the return type (void to int) of a function does
> > *not* break ABI, but does "break" API as the application code should now
> > check the return value. In theory the application could ignore the return
> > value and current behavior is maintained.
> >
> 
> After discussing with Harry on IRC it turns out we both ended up checking
> the same online sources
> to verify our thoughts, like [1].
> 
> Given this and several other sources it seems to be as outlined above an
> API but not ABI break.
> I'm not an expert and this is mostly opinion, but my personal rule mostly
> is: "if in doubt bump it".

Anyway, the ABI will be broken (and bumped) again in 17.11.
This patch will be accepted in 17.11.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 1/2] ethdev: add return code to rte_eth_stats_reset()
  2017-08-07 17:39 [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset() David Harton
  2017-08-08  9:02 ` Van Haaren, Harry
@ 2017-08-10 13:29 ` David Harton
  2017-08-10 13:29   ` [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset David Harton
                     ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: David Harton @ 2017-08-10 13:29 UTC (permalink / raw)
  To: thomas; +Cc: dev, harry.van.haaren, christian.ehrhardt, David Harton

Some devices do not support reset of eth stats.  An application may
need to know not to clear shadow stats if the device cannot.

rte_eth_stats_reset is updated to provide a return code to share
whether the device supports reset or not.

Signed-off-by: David Harton <dharton@cisco.com>
---

v4:
* commented return values

v3:
* overcame noob errors and figured out patch challenged

v2:
* fixed soft tab issue inserted while moving changes

 lib/librte_ether/rte_ethdev.c | 8 +++++---
 lib/librte_ether/rte_ethdev.h | 6 +++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0597641..b420391 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1341,17 +1341,19 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
 	return 0;
 }
 
-void
+int
 rte_eth_stats_reset(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
 	(*dev->dev_ops->stats_reset)(dev);
 	dev->data->rx_mbuf_alloc_failed = 0;
+
+	return 0;
 }
 
 static int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0adf327..b14a2b5 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2246,8 +2246,12 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
+ * @return
+ *   - (0) if device notified to reset stats.
+ *   - (-ENOTSUP) if hardware doesn't support.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_stats_reset(uint8_t port_id);
+int rte_eth_stats_reset(uint8_t port_id);
 
 /**
  * Retrieve names of extended statistics of an Ethernet device.
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset
  2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
@ 2017-08-10 13:29   ` David Harton
  2017-08-31 22:10     ` Thomas Monjalon
  2017-08-31 22:16   ` [dpdk-dev] [PATCH v4 1/2] ethdev: add return code to rte_eth_stats_reset() Thomas Monjalon
  2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
  2 siblings, 1 reply; 18+ messages in thread
From: David Harton @ 2017-08-10 13:29 UTC (permalink / raw)
  To: thomas; +Cc: dev, harry.van.haaren, christian.ehrhardt, David Harton

Signed-off-by: David Harton <dharton@cisco.com>
---

v4:
* Added requested release note about ABI change.

 doc/guides/rel_notes/release_17_11.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 170f4f9..e329f8a 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -124,6 +124,7 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``.
 
 
 Shared Library Versions
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset
  2017-08-10 13:29   ` [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset David Harton
@ 2017-08-31 22:10     ` Thomas Monjalon
  2017-08-31 22:10       ` Thomas Monjalon
  0 siblings, 1 reply; 18+ messages in thread
From: Thomas Monjalon @ 2017-08-31 22:10 UTC (permalink / raw)
  To: David Harton; +Cc: dev, harry.van.haaren, christian.ehrhardt

10/08/2017 15:29, David Harton:
> --- a/doc/guides/rel_notes/release_17_11.rst
> +++ b/doc/guides/rel_notes/release_17_11.rst
> @@ -124,6 +124,7 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =========================================================
>  
> +* Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``.

It should be documented in API changes section (not ABI).

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset
  2017-08-31 22:10     ` Thomas Monjalon
@ 2017-08-31 22:10       ` Thomas Monjalon
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Monjalon @ 2017-08-31 22:10 UTC (permalink / raw)
  To: David Harton; +Cc: dev, harry.van.haaren, christian.ehrhardt

01/09/2017 00:10, Thomas Monjalon:
> 10/08/2017 15:29, David Harton:
> > --- a/doc/guides/rel_notes/release_17_11.rst
> > +++ b/doc/guides/rel_notes/release_17_11.rst
> > @@ -124,6 +124,7 @@ ABI Changes
> >     Also, make sure to start the actual text at the margin.
> >     =========================================================
> >  
> > +* Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``.
> 
> It should be documented in API changes section (not ABI).

And it can be squashed with the first patch :)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add return code to rte_eth_stats_reset()
  2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
  2017-08-10 13:29   ` [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset David Harton
@ 2017-08-31 22:16   ` Thomas Monjalon
  2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
  2 siblings, 0 replies; 18+ messages in thread
From: Thomas Monjalon @ 2017-08-31 22:16 UTC (permalink / raw)
  To: David Harton; +Cc: dev, harry.van.haaren, christian.ehrhardt

10/08/2017 15:29, David Harton:
> Some devices do not support reset of eth stats.  An application may
> need to know not to clear shadow stats if the device cannot.

Yes, thanks for improving this old API.

> rte_eth_stats_reset is updated to provide a return code to share
> whether the device supports reset or not.

You need to change also this line:
typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);

And while at it, you could apply the same change to stats_get.
A device can be in a state where it is impossible to read stats.

The same kind of update could be needed for promiscuous and allmulticast
functions but they are out of the scope of this patch.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset()
  2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
  2017-08-10 13:29   ` [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset David Harton
  2017-08-31 22:16   ` [dpdk-dev] [PATCH v4 1/2] ethdev: add return code to rte_eth_stats_reset() Thomas Monjalon
@ 2017-09-01  2:26   ` David Harton
  2017-09-01  7:47     ` Hemant Agrawal
                       ` (2 more replies)
  2 siblings, 3 replies; 18+ messages in thread
From: David Harton @ 2017-09-01  2:26 UTC (permalink / raw)
  To: thomas; +Cc: dev, David Harton

Some devices do not support reset of eth stats.  An application may
need to know not to clear shadow stats if the device cannot.

rte_eth_stats_reset is updated to provide a return code to share
whether the device supports reset or not.

Signed-off-by: David Harton <dharton@cisco.com>
---

v5:
* squashed doc patch
* moved rel_note change from ABI to API section

v4:
* commented return values

v3:
* overcame noob errors and figured out patch challenged

v2:
* fixed soft tab issue inserted while moving changes

 doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++
 lib/librte_ether/rte_ethdev.c          |  8 +++++---
 lib/librte_ether/rte_ethdev.h          |  6 +++++-
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 22df4fd..6282667 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -110,6 +110,19 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* **Modified the return type of rte_eth_stats_reset.**
+
+  Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``
+  so the caller may know whether a device supports the operation or not
+  and if the operation was carried out.
+
+* **Modified the vlan_offload_set_t function prototype in the ethdev library.**
+
+  Changed the function prototype of ``vlan_offload_set_t``.  The return value
+  has been changed from ``void`` to ``int`` so the caller to knows whether
+  the backing device supports the operation or if the operation was
+  successfully performed.
+
 * **Modified the vlan_offload_set_t function prototype in the ethdev library.**
 
   Changed the function prototype of ``vlan_offload_set_t``.  The return value
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 05e52b8..f0f1775 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1341,17 +1341,19 @@ struct rte_eth_dev *
 	return 0;
 }
 
-void
+int
 rte_eth_stats_reset(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
 	(*dev->dev_ops->stats_reset)(dev);
 	dev->data->rx_mbuf_alloc_failed = 0;
+
+	return 0;
 }
 
 static int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 7254fd0..9110725 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
+ * @return
+ *   - (0) if device notified to reset stats.
+ *   - (-ENOTSUP) if hardware doesn't support.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_stats_reset(uint8_t port_id);
+int rte_eth_stats_reset(uint8_t port_id);
 
 /**
  * Retrieve names of extended statistics of an Ethernet device.
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset()
  2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
@ 2017-09-01  7:47     ` Hemant Agrawal
  2017-09-19 17:14     ` Ferruh Yigit
  2017-09-20 14:11     ` [dpdk-dev] [PATCH v6] " David C Harton
  2 siblings, 0 replies; 18+ messages in thread
From: Hemant Agrawal @ 2017-09-01  7:47 UTC (permalink / raw)
  To: David Harton, thomas; +Cc: dev

On 9/1/2017 7:56 AM, David Harton wrote:
> Some devices do not support reset of eth stats.  An application may
> need to know not to clear shadow stats if the device cannot.
>
> rte_eth_stats_reset is updated to provide a return code to share
> whether the device supports reset or not.
>
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
>
> v5:
> * squashed doc patch
> * moved rel_note change from ABI to API section
>
> v4:
> * commented return values
>
> v3:
> * overcame noob errors and figured out patch challenged
>
> v2:
> * fixed soft tab issue inserted while moving changes
>
>  doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++
>  lib/librte_ether/rte_ethdev.c          |  8 +++++---
>  lib/librte_ether/rte_ethdev.h          |  6 +++++-
>  3 files changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
> index 22df4fd..6282667 100644
> --- a/doc/guides/rel_notes/release_17_11.rst
> +++ b/doc/guides/rel_notes/release_17_11.rst
> @@ -110,6 +110,19 @@ API Changes
>     Also, make sure to start the actual text at the margin.
>     =========================================================
>
> +* **Modified the return type of rte_eth_stats_reset.**
> +
> +  Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``
> +  so the caller may know whether a device supports the operation or not
> +  and if the operation was carried out.
> +
> +* **Modified the vlan_offload_set_t function prototype in the ethdev library.**
> +
> +  Changed the function prototype of ``vlan_offload_set_t``.  The return value
> +  has been changed from ``void`` to ``int`` so the caller to knows whether
> +  the backing device supports the operation or if the operation was
> +  successfully performed.
> +
>  * **Modified the vlan_offload_set_t function prototype in the ethdev library.**
>
>    Changed the function prototype of ``vlan_offload_set_t``.  The return value
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 05e52b8..f0f1775 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1341,17 +1341,19 @@ struct rte_eth_dev *
>  	return 0;
>  }
>
> -void
> +int
>  rte_eth_stats_reset(uint8_t port_id)
>  {
>  	struct rte_eth_dev *dev;
>
> -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>  	dev = &rte_eth_devices[port_id];
>
> -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
>  	(*dev->dev_ops->stats_reset)(dev);
>  	dev->data->rx_mbuf_alloc_failed = 0;
> +
> +	return 0;
>  }
>
>  static int
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 7254fd0..9110725 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
>   *
>   * @param port_id
>   *   The port identifier of the Ethernet device.
> + * @return
> + *   - (0) if device notified to reset stats.
> + *   - (-ENOTSUP) if hardware doesn't support.
> + *   - (-ENODEV) if *port_id* invalid.
>   */
> -void rte_eth_stats_reset(uint8_t port_id);
> +int rte_eth_stats_reset(uint8_t port_id);
>
>  /**
>   * Retrieve names of extended statistics of an Ethernet device.
>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset()
  2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
  2017-09-01  7:47     ` Hemant Agrawal
@ 2017-09-19 17:14     ` Ferruh Yigit
  2017-09-20 14:01       ` David Harton (dharton)
  2017-09-20 14:11     ` [dpdk-dev] [PATCH v6] " David C Harton
  2 siblings, 1 reply; 18+ messages in thread
From: Ferruh Yigit @ 2017-09-19 17:14 UTC (permalink / raw)
  To: David Harton, thomas; +Cc: dev

On 9/1/2017 3:26 AM, David Harton wrote:
> Some devices do not support reset of eth stats.  An application may
> need to know not to clear shadow stats if the device cannot.
> 
> rte_eth_stats_reset is updated to provide a return code to share
> whether the device supports reset or not.
> 
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
> 
> v5:
> * squashed doc patch
> * moved rel_note change from ABI to API section
> 
> v4:
> * commented return values
> 
> v3:
> * overcame noob errors and figured out patch challenged
> 
> v2:
> * fixed soft tab issue inserted while moving changes
> 
>  doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++
>  lib/librte_ether/rte_ethdev.c          |  8 +++++---
>  lib/librte_ether/rte_ethdev.h          |  6 +++++-
>  3 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
> index 22df4fd..6282667 100644
> --- a/doc/guides/rel_notes/release_17_11.rst
> +++ b/doc/guides/rel_notes/release_17_11.rst
> @@ -110,6 +110,19 @@ API Changes
>     Also, make sure to start the actual text at the margin.
>     =========================================================
>  
> +* **Modified the return type of rte_eth_stats_reset.**
> +
> +  Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``
> +  so the caller may know whether a device supports the operation or not
> +  and if the operation was carried out.
> +

> +* **Modified the vlan_offload_set_t function prototype in the ethdev library.**
> +
> +  Changed the function prototype of ``vlan_offload_set_t``.  The return value
> +  has been changed from ``void`` to ``int`` so the caller to knows whether
> +  the backing device supports the operation or if the operation was
> +  successfully performed.
> +

Is this addition to the document related to this patch?

>  * **Modified the vlan_offload_set_t function prototype in the ethdev library.**
>  
>    Changed the function prototype of ``vlan_offload_set_t``.  The return value
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 05e52b8..f0f1775 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -1341,17 +1341,19 @@ struct rte_eth_dev *
>  	return 0;
>  }
>  
> -void
> +int
>  rte_eth_stats_reset(uint8_t port_id)
>  {
>  	struct rte_eth_dev *dev;
>  
> -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>  	dev = &rte_eth_devices[port_id];
>  
> -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
>  	(*dev->dev_ops->stats_reset)(dev);
>  	dev->data->rx_mbuf_alloc_failed = 0;
> +
> +	return 0;
>  }
>  
>  static int
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 7254fd0..9110725 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
>   *
>   * @param port_id
>   *   The port identifier of the Ethernet device.
> + * @return
> + *   - (0) if device notified to reset stats.
> + *   - (-ENOTSUP) if hardware doesn't support.
> + *   - (-ENODEV) if *port_id* invalid.
>   */
> -void rte_eth_stats_reset(uint8_t port_id);
> +int rte_eth_stats_reset(uint8_t port_id);
>  
>  /**
>   * Retrieve names of extended statistics of an Ethernet device.
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset()
  2017-09-19 17:14     ` Ferruh Yigit
@ 2017-09-20 14:01       ` David Harton (dharton)
  2017-09-20 16:55         ` Ferruh Yigit
  0 siblings, 1 reply; 18+ messages in thread
From: David Harton (dharton) @ 2017-09-20 14:01 UTC (permalink / raw)
  To: Ferruh Yigit, thomas; +Cc: dev



> -----Original Message-----
> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
> 
> On 9/1/2017 3:26 AM, David Harton wrote:
> > Some devices do not support reset of eth stats.  An application may
> > need to know not to clear shadow stats if the device cannot.
> >
> > rte_eth_stats_reset is updated to provide a return code to share
> > whether the device supports reset or not.
> >
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> >
> > v5:
> > * squashed doc patch
> > * moved rel_note change from ABI to API section
> >
> > v4:
> > * commented return values
> >
> > v3:
> > * overcame noob errors and figured out patch challenged
> >
> > v2:
> > * fixed soft tab issue inserted while moving changes
> >
> >  doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++
> >  lib/librte_ether/rte_ethdev.c          |  8 +++++---
> >  lib/librte_ether/rte_ethdev.h          |  6 +++++-
> >  3 files changed, 23 insertions(+), 4 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_17_11.rst
> > b/doc/guides/rel_notes/release_17_11.rst
> > index 22df4fd..6282667 100644
> > --- a/doc/guides/rel_notes/release_17_11.rst
> > +++ b/doc/guides/rel_notes/release_17_11.rst
> > @@ -110,6 +110,19 @@ API Changes
> >     Also, make sure to start the actual text at the margin.
> >     =========================================================
> >
> > +* **Modified the return type of rte_eth_stats_reset.**
> > +
> > +  Changed return type of ``rte_eth_stats_reset`` from ``void`` to
> > + ``int``  so the caller may know whether a device supports the
> > + operation or not  and if the operation was carried out.
> > +
> 
> > +* **Modified the vlan_offload_set_t function prototype in the ethdev
> > +library.**
> > +
> > +  Changed the function prototype of ``vlan_offload_set_t``.  The
> > + return value  has been changed from ``void`` to ``int`` so the
> > + caller to knows whether  the backing device supports the operation
> > + or if the operation was  successfully performed.
> > +
> 
> Is this addition to the document related to this patch?

Good catch.  No. :(

I must have mishandled the rebase I did to update this patch.  V6 coming.  
Would be great if you could re-ACK afterwards so this one can move.

Thanks,
Dave

> 
> >  * **Modified the vlan_offload_set_t function prototype in the ethdev
> > library.**
> >
> >    Changed the function prototype of ``vlan_offload_set_t``.  The
> > return value diff --git a/lib/librte_ether/rte_ethdev.c
> > b/lib/librte_ether/rte_ethdev.c index 05e52b8..f0f1775 100644
> > --- a/lib/librte_ether/rte_ethdev.c
> > +++ b/lib/librte_ether/rte_ethdev.c
> > @@ -1341,17 +1341,19 @@ struct rte_eth_dev *
> >  	return 0;
> >  }
> >
> > -void
> > +int
> >  rte_eth_stats_reset(uint8_t port_id)
> >  {
> >  	struct rte_eth_dev *dev;
> >
> > -	RTE_ETH_VALID_PORTID_OR_RET(port_id);
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> >  	dev = &rte_eth_devices[port_id];
> >
> > -	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
> > +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
> >  	(*dev->dev_ops->stats_reset)(dev);
> >  	dev->data->rx_mbuf_alloc_failed = 0;
> > +
> > +	return 0;
> >  }
> >
> >  static int
> > diff --git a/lib/librte_ether/rte_ethdev.h
> > b/lib/librte_ether/rte_ethdev.h index 7254fd0..9110725 100644
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> > @@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id,
> uint16_t tx_queue_id,
> >   *
> >   * @param port_id
> >   *   The port identifier of the Ethernet device.
> > + * @return
> > + *   - (0) if device notified to reset stats.
> > + *   - (-ENOTSUP) if hardware doesn't support.
> > + *   - (-ENODEV) if *port_id* invalid.
> >   */
> > -void rte_eth_stats_reset(uint8_t port_id);
> > +int rte_eth_stats_reset(uint8_t port_id);
> >
> >  /**
> >   * Retrieve names of extended statistics of an Ethernet device.
> >


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v6] ethdev: add return code to rte_eth_stats_reset()
  2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
  2017-09-01  7:47     ` Hemant Agrawal
  2017-09-19 17:14     ` Ferruh Yigit
@ 2017-09-20 14:11     ` David C Harton
  2017-09-20 16:56       ` Ferruh Yigit
  2 siblings, 1 reply; 18+ messages in thread
From: David C Harton @ 2017-09-20 14:11 UTC (permalink / raw)
  To: thomas, ferruh.yigit; +Cc: dev, David Harton

From: David Harton <dharton@cisco.com>

Some devices do not support reset of eth stats.  An application may
need to know not to clear shadow stats if the device cannot.

rte_eth_stats_reset is updated to provide a return code to share
whether the device supports reset or not.

Signed-off-by: David Harton <dharton@cisco.com>
---

v6:
* removed duplicated entry on rel_notes

v5:
* squashed doc patch
* moved rel_note change from ABI to API section

v4:
* commented return values

v3:
* overcame noob errors and figured out patch challenged

v2:
* fixed soft tab issue inserted while moving changes

 doc/guides/rel_notes/release_17_11.rst | 6 ++++++
 lib/librte_ether/rte_ethdev.c          | 8 +++++---
 lib/librte_ether/rte_ethdev.h          | 6 +++++-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 22df4fd..9b77c31 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -110,6 +110,12 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* **Modified the return type of rte_eth_stats_reset.**
+
+  Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int``
+  so the caller may know whether a device supports the operation or not
+  and if the operation was carried out.
+
 * **Modified the vlan_offload_set_t function prototype in the ethdev library.**
 
   Changed the function prototype of ``vlan_offload_set_t``.  The return value
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 05e52b8..f0f1775 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1341,17 +1341,19 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
 	return 0;
 }
 
-void
+int
 rte_eth_stats_reset(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	dev = &rte_eth_devices[port_id];
 
-	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP);
 	(*dev->dev_ops->stats_reset)(dev);
 	dev->data->rx_mbuf_alloc_failed = 0;
+
+	return 0;
 }
 
 static int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 7254fd0..9110725 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2246,8 +2246,12 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
+ * @return
+ *   - (0) if device notified to reset stats.
+ *   - (-ENOTSUP) if hardware doesn't support.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_stats_reset(uint8_t port_id);
+int rte_eth_stats_reset(uint8_t port_id);
 
 /**
  * Retrieve names of extended statistics of an Ethernet device.
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset()
  2017-09-20 14:01       ` David Harton (dharton)
@ 2017-09-20 16:55         ` Ferruh Yigit
  0 siblings, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2017-09-20 16:55 UTC (permalink / raw)
  To: David Harton (dharton), thomas; +Cc: dev

On 9/20/2017 3:01 PM, David Harton (dharton) wrote:
> 
> 
>> -----Original Message-----
>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
>>
>> On 9/1/2017 3:26 AM, David Harton wrote:
>>> Some devices do not support reset of eth stats.  An application may
>>> need to know not to clear shadow stats if the device cannot.
>>>
>>> rte_eth_stats_reset is updated to provide a return code to share
>>> whether the device supports reset or not.
>>>
>>> Signed-off-by: David Harton <dharton@cisco.com>
>>> ---
>>>
>>> v5:
>>> * squashed doc patch
>>> * moved rel_note change from ABI to API section
>>>
>>> v4:
>>> * commented return values
>>>
>>> v3:
>>> * overcame noob errors and figured out patch challenged
>>>
>>> v2:
>>> * fixed soft tab issue inserted while moving changes
>>>
>>>  doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++
>>>  lib/librte_ether/rte_ethdev.c          |  8 +++++---
>>>  lib/librte_ether/rte_ethdev.h          |  6 +++++-
>>>  3 files changed, 23 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/doc/guides/rel_notes/release_17_11.rst
>>> b/doc/guides/rel_notes/release_17_11.rst
>>> index 22df4fd..6282667 100644
>>> --- a/doc/guides/rel_notes/release_17_11.rst
>>> +++ b/doc/guides/rel_notes/release_17_11.rst
>>> @@ -110,6 +110,19 @@ API Changes
>>>     Also, make sure to start the actual text at the margin.
>>>     =========================================================
>>>
>>> +* **Modified the return type of rte_eth_stats_reset.**
>>> +
>>> +  Changed return type of ``rte_eth_stats_reset`` from ``void`` to
>>> + ``int``  so the caller may know whether a device supports the
>>> + operation or not  and if the operation was carried out.
>>> +
>>
>>> +* **Modified the vlan_offload_set_t function prototype in the ethdev
>>> +library.**
>>> +
>>> +  Changed the function prototype of ``vlan_offload_set_t``.  The
>>> + return value  has been changed from ``void`` to ``int`` so the
>>> + caller to knows whether  the backing device supports the operation
>>> + or if the operation was  successfully performed.
>>> +
>>
>> Is this addition to the document related to this patch?
> 
> Good catch.  No. :(
> 
> I must have mishandled the rebase I did to update this patch.  V6 coming.  
> Would be great if you could re-ACK afterwards so this one can move.

I think you can carry the previous Ack for this case. Since main part of
the patch that acked will not be changed...

> 
> Thanks,
> Dave

<...>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v6] ethdev: add return code to rte_eth_stats_reset()
  2017-09-20 14:11     ` [dpdk-dev] [PATCH v6] " David C Harton
@ 2017-09-20 16:56       ` Ferruh Yigit
  2017-10-09 23:02         ` Ferruh Yigit
  0 siblings, 1 reply; 18+ messages in thread
From: Ferruh Yigit @ 2017-09-20 16:56 UTC (permalink / raw)
  To: David C Harton, thomas; +Cc: dev

On 9/20/2017 3:11 PM, David C Harton wrote:
> From: David Harton <dharton@cisco.com>
> 
> Some devices do not support reset of eth stats.  An application may
> need to know not to clear shadow stats if the device cannot.
> 
> rte_eth_stats_reset is updated to provide a return code to share
> whether the device supports reset or not.
> 
> Signed-off-by: David Harton <dharton@cisco.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v6] ethdev: add return code to rte_eth_stats_reset()
  2017-09-20 16:56       ` Ferruh Yigit
@ 2017-10-09 23:02         ` Ferruh Yigit
  0 siblings, 0 replies; 18+ messages in thread
From: Ferruh Yigit @ 2017-10-09 23:02 UTC (permalink / raw)
  To: David C Harton, thomas; +Cc: dev

On 9/20/2017 5:56 PM, Ferruh Yigit wrote:
> On 9/20/2017 3:11 PM, David C Harton wrote:
>> From: David Harton <dharton@cisco.com>
>>
>> Some devices do not support reset of eth stats.  An application may
>> need to know not to clear shadow stats if the device cannot.
>>
>> rte_eth_stats_reset is updated to provide a return code to share
>> whether the device supports reset or not.
>>
>> Signed-off-by: David Harton <dharton@cisco.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-10-09 23:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 17:39 [dpdk-dev] [PATCH v3] ethdev: add return code to rte_eth_stats_reset() David Harton
2017-08-08  9:02 ` Van Haaren, Harry
2017-08-08 11:01   ` David Harton (dharton)
2017-08-08 11:03   ` Christian Ehrhardt
2017-08-08 13:13     ` Thomas Monjalon
2017-08-10 13:29 ` [dpdk-dev] [PATCH v4 1/2] " David Harton
2017-08-10 13:29   ` [dpdk-dev] [PATCH v4 2/2] doc: Update ABI Change for rte_eth_stats_reset David Harton
2017-08-31 22:10     ` Thomas Monjalon
2017-08-31 22:10       ` Thomas Monjalon
2017-08-31 22:16   ` [dpdk-dev] [PATCH v4 1/2] ethdev: add return code to rte_eth_stats_reset() Thomas Monjalon
2017-09-01  2:26   ` [dpdk-dev] [PATCH v5] " David Harton
2017-09-01  7:47     ` Hemant Agrawal
2017-09-19 17:14     ` Ferruh Yigit
2017-09-20 14:01       ` David Harton (dharton)
2017-09-20 16:55         ` Ferruh Yigit
2017-09-20 14:11     ` [dpdk-dev] [PATCH v6] " David C Harton
2017-09-20 16:56       ` Ferruh Yigit
2017-10-09 23:02         ` Ferruh Yigit

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).