[dpdk-stable] patch 'mbuf: fix type of variables in linearize function' has been queued to stable release 18.02.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed May 23 14:09:40 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.02.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/25/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From a099e527773f7c849edeb165b18f6f4528552178 Mon Sep 17 00:00:00 2001
From: Andy Green <andy at warmcat.com>
Date: Tue, 22 May 2018 09:24:37 +0800
Subject: [PATCH] mbuf: fix type of variables in linearize function

[ upstream commit 50f239c9087df9b1a3c14e77f4279c7d5f523138 ]

GCC 8.1 warned:

In function 'rte_pktmbuf_linearize':
rte_mbuf.h:1873:32: warning: conversion to 'int' from 'uint32_t'
{aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
rte_mbuf.h:2166:13: note: in expansion of macro 'rte_pktmbuf_pkt_len'
   copy_len = rte_pktmbuf_pkt_len(mbuf) - rte_pktmbuf_data_len(mbuf);
rte_mbuf.h:2180:51: warning: conversion to 'size_t'
{aka 'long unsigned int'} from 'int' may change the
sign of the result [-Wsign-conversion]
rte_memcpy(buffer, rte_pktmbuf_mtod(m, char *), seg_len);
                                                ^~~~~~~

The temp is consumed as a size_t.  So let's make it
a size_t in the first place.

Fixes: 1feda4d8fc ("mbuf: add a function to linearize a packet")

Signed-off-by: Andy Green <andy at warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/librte_mbuf/rte_mbuf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 198ba8e22..741204193 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1935,7 +1935,7 @@ rte_validate_tx_offload(const struct rte_mbuf *m)
 static inline int
 rte_pktmbuf_linearize(struct rte_mbuf *mbuf)
 {
-	int seg_len, copy_len;
+	size_t seg_len, copy_len;
 	struct rte_mbuf *m;
 	struct rte_mbuf *m_next;
 	char *buffer;
-- 
2.14.2



More information about the stable mailing list