[1/2] app/testpmd: fix wrong pointer reference in macswap

Message ID 20190114100022.14867-1-yskoh@mellanox.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • [1/2] app/testpmd: fix wrong pointer reference in macswap
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Yongseok Koh Jan. 14, 2019, 10 a.m.
The pointer is misused and could set wrong MAC address. As a result, some
of packets can be dropped in receiver side due to MAC address mismatch.
This can be shown as performance degradation.

Bugzilla ID: 188

Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")
Cc: qi.z.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/macswap_sse.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bernard Iremonger Jan. 14, 2019, 1:39 p.m. | #1
> -----Original Message-----
> From: Yongseok Koh [mailto:yskoh@mellanox.com]
> Sent: Monday, January 14, 2019 10:00 AM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH 1/2] app/testpmd: fix wrong pointer reference in macswap
> 
> The pointer is misused and could set wrong MAC address. As a result, some of
> packets can be dropped in receiver side due to MAC address mismatch.
> This can be shown as performance degradation.
> 
> Bugzilla ID: 188
> 
> Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")
> Cc: qi.z.zhang@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Ferruh Yigit Jan. 14, 2019, 2:35 p.m. | #2
On 1/14/2019 1:39 PM, Iremonger, Bernard wrote:
>> -----Original Message-----
>> From: Yongseok Koh [mailto:yskoh@mellanox.com]
>> Sent: Monday, January 14, 2019 10:00 AM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
>> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
>> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
>> Subject: [PATCH 1/2] app/testpmd: fix wrong pointer reference in macswap
>>
>> The pointer is misused and could set wrong MAC address. As a result, some of
>> packets can be dropped in receiver side due to MAC address mismatch.
>> This can be shown as performance degradation.
>>
>> Bugzilla ID: 188
>>
>> Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")
>> Cc: qi.z.zhang@intel.com
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Series applied to dpdk-next-net/master, thanks.

Patch

diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h
index 7d268bfbb0..662fe79cf9 100644
--- a/app/test-pmd/macswap_sse.h
+++ b/app/test-pmd/macswap_sse.h
@@ -76,7 +76,7 @@  do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
 		eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *);
 
 		/* Swap dest and src mac addresses. */
-		addr0 = _mm_loadu_si128((__m128i *)eth_hdr);
+		addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]);
 		addr0 = _mm_shuffle_epi8(addr0, shfl_msk);
 		_mm_storeu_si128((__m128i *)eth_hdr[0], addr0);