[v4] ethdev: fix for compiler warning when vtune profiling is on

Message ID 20200402184516.27033-1-eugeny.parshutin@linux.intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series [v4] ethdev: fix for compiler warning when vtune profiling is on |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

eugeny.parshutin@linux.intel.com April 2, 2020, 6:45 p.m. UTC
  From: Eugeny Parshutin <eugeny.parshutin@linux.intel.com>

Add the previous prototype for the 'profile_hook_rx_burst_cb' function
to fix the compiler warning when the DPDK is built with
'RTE_ETHDEV_PROFILE_WITH_VTUNE' config option enabled:
/home/dpdk/lib/librte_ethdev/ethdev_profile.c:17:1: warning:
no previous prototype for profile_hook_rx_burst_cb [-Wmissing-prototypes]

Fixes: 2c1bbab7f09d ("ethdev: change vtune profiling approach")
Cc: ilia.kurakin@intel.com

Signed-off-by: Eugeny Parshutin <eugeny.parshutin@linux.intel.com>
---
v2: Fix the commit message

v3: Fix the check-git-log.sh warnings:
- make headline shorter
- add 'Fixes' tag

v4: Adapt 'Fixes' section to commit message guidelines
---
 lib/librte_ethdev/ethdev_profile.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Ferruh Yigit April 3, 2020, 5:12 p.m. UTC | #1
On 4/2/2020 7:45 PM, eugeny.parshutin@linux.intel.com wrote:
> From: Eugeny Parshutin <eugeny.parshutin@linux.intel.com>
> 
> Add the previous prototype for the 'profile_hook_rx_burst_cb' function
> to fix the compiler warning when the DPDK is built with
> 'RTE_ETHDEV_PROFILE_WITH_VTUNE' config option enabled:
> /home/dpdk/lib/librte_ethdev/ethdev_profile.c:17:1: warning:
> no previous prototype for profile_hook_rx_burst_cb [-Wmissing-prototypes]
> 
> Fixes: 2c1bbab7f09d ("ethdev: change vtune profiling approach")
> Cc: ilia.kurakin@intel.com

Hi Eugeny,

Thanks for the fix.

Can you please add the "Cc: stable@dpdk.org" tag just below the Fixes line, this
to request backporting the fix to stable trees, which is required for this case
since this is a build fix.

> 
> Signed-off-by: Eugeny Parshutin <eugeny.parshutin@linux.intel.com>
> ---
> v2: Fix the commit message
> 
> v3: Fix the check-git-log.sh warnings:
> - make headline shorter
> - add 'Fixes' tag
> 
> v4: Adapt 'Fixes' section to commit message guidelines
> ---
>  lib/librte_ethdev/ethdev_profile.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/lib/librte_ethdev/ethdev_profile.h b/lib/librte_ethdev/ethdev_profile.h
> index 65031e6f3..b8c3c6848 100644
> --- a/lib/librte_ethdev/ethdev_profile.h
> +++ b/lib/librte_ethdev/ethdev_profile.h
> @@ -24,4 +24,14 @@
>  int
>  __rte_eth_dev_profile_init(uint16_t port_id, struct rte_eth_dev *dev);
>  
> +#ifdef RTE_ETHDEV_PROFILE_WITH_VTUNE
> +
> +uint16_t
> +profile_hook_rx_burst_cb(

minor comment, but can you please don't end the line with open parenthesis, '(',
but continue the param list in above line. (I am aware this is how done while
calling the function, but better to fix here.)

> +	__rte_unused uint16_t port_id, __rte_unused uint16_t queue_id,

'__rte_unused' tag is not required in the function deceleration, can you please
remove them.

> +	__rte_unused struct rte_mbuf *pkts[], uint16_t nb_pkts,
> +	__rte_unused uint16_t max_pkts, __rte_unused void *user_param);
> +
> +#endif /* RTE_ETHDEV_PROFILE_WITH_VTUNE */
> +
>  #endif
>
  

Patch

diff --git a/lib/librte_ethdev/ethdev_profile.h b/lib/librte_ethdev/ethdev_profile.h
index 65031e6f3..b8c3c6848 100644
--- a/lib/librte_ethdev/ethdev_profile.h
+++ b/lib/librte_ethdev/ethdev_profile.h
@@ -24,4 +24,14 @@ 
 int
 __rte_eth_dev_profile_init(uint16_t port_id, struct rte_eth_dev *dev);
 
+#ifdef RTE_ETHDEV_PROFILE_WITH_VTUNE
+
+uint16_t
+profile_hook_rx_burst_cb(
+	__rte_unused uint16_t port_id, __rte_unused uint16_t queue_id,
+	__rte_unused struct rte_mbuf *pkts[], uint16_t nb_pkts,
+	__rte_unused uint16_t max_pkts, __rte_unused void *user_param);
+
+#endif /* RTE_ETHDEV_PROFILE_WITH_VTUNE */
+
 #endif