eventdev: fix signed comparison

Message ID 20210413221613.2062-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series eventdev: fix signed comparison |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula April 13, 2021, 10:16 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since queue identifier is passed as signed integer, a compilation error
is generated:
rte_event_eth_rx_adapter.c:1810:57: error: signed and unsigned type
in conditional expression [-Werror=sign-compare]
Make queue identifier as unsigned when adding it to vector data.

Fixes: d7c428e557ba ("eventdev: support Rx adapter event vector")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/librte_eventdev/rte_event_eth_rx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand April 14, 2021, 6:26 a.m. UTC | #1
On Wed, Apr 14, 2021 at 12:16 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Since queue identifier is passed as signed integer, a compilation error
> is generated:
> rte_event_eth_rx_adapter.c:1810:57: error: signed and unsigned type
> in conditional expression [-Werror=sign-compare]
> Make queue identifier as unsigned when adding it to vector data.
>

Bugzilla ID: 672

> Fixes: d7c428e557ba ("eventdev: support Rx adapter event vector")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

LGTM and fixes compilation for RHEL7.

Acked-by: David Marchand <david.marchand@redhat.com>

Jerin, do you mind if I take it directly in main?
  
Jerin Jacob April 14, 2021, 6:52 a.m. UTC | #2
On Wed, Apr 14, 2021 at 11:56 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Apr 14, 2021 at 12:16 AM <pbhagavatula@marvell.com> wrote:
> >
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Since queue identifier is passed as signed integer, a compilation error
> > is generated:
> > rte_event_eth_rx_adapter.c:1810:57: error: signed and unsigned type
> > in conditional expression [-Werror=sign-compare]
> > Make queue identifier as unsigned when adding it to vector data.
> >
>
> Bugzilla ID: 672
>
> > Fixes: d7c428e557ba ("eventdev: support Rx adapter event vector")
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> LGTM and fixes compilation for RHEL7.
>
> Acked-by: David Marchand <david.marchand@redhat.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


>
> Jerin, do you mind if I take it directly in main?

Yes . Please

>
>
> --
> David Marchand
>
  
David Marchand April 14, 2021, 8:06 a.m. UTC | #3
On Wed, Apr 14, 2021 at 8:52 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Wed, Apr 14, 2021 at 11:56 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Wed, Apr 14, 2021 at 12:16 AM <pbhagavatula@marvell.com> wrote:
> > >
> > > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > >
> > > Since queue identifier is passed as signed integer, a compilation error
> > > is generated:
> > > rte_event_eth_rx_adapter.c:1810:57: error: signed and unsigned type
> > > in conditional expression [-Werror=sign-compare]
> > > Make queue identifier as unsigned when adding it to vector data.
> > >
> >
> > Bugzilla ID: 672
> > > Fixes: d7c428e557ba ("eventdev: support Rx adapter event vector")
> > >
> > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > Acked-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks.
  

Patch

diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index e273b3acf..ca166a65f 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -1790,7 +1790,7 @@  rxa_update_queue(struct rte_event_eth_rx_adapter *rx_adapter,
 
 static void
 rxa_set_vector_data(struct eth_rx_queue_info *queue_info, uint16_t vector_count,
-		    uint64_t vector_ns, struct rte_mempool *mp, int32_t qid,
+		    uint64_t vector_ns, struct rte_mempool *mp, uint32_t qid,
 		    uint16_t port_id)
 {
 #define NSEC2TICK(__ns, __freq) (((__ns) * (__freq)) / 1E9)