From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nelio Laranjeiro Subject: [PATCH V2 3/8] net/mlx5: fix removing VLAN filter Date: Wed, 14 Sep 2016 13:53:50 +0200 Message-ID: <6e526cd21d8e4ce963dba08519c7a81a4e9b1679.1473851528.git.nelio.laranjeiro@6wind.com> References: Cc: Raslan Darawsheh To: dev@dpdk.org Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 7435D8E58 for ; Wed, 14 Sep 2016 13:54:31 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id i130so44280030wmf.0 for ; Wed, 14 Sep 2016 04:54:31 -0700 (PDT) In-Reply-To: In-Reply-To: References: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Raslan Darawsheh memmove was moving bytes as the number of elements next to i, while it should move the number of elements multiplied by the size of each element. Fixes: e9086978 ("mlx5: support VLAN filtering") Signed-off-by: Raslan Darawsheh --- drivers/net/mlx5/mlx5_vlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c index 4719e69..fb730e5 100644 --- a/drivers/net/mlx5/mlx5_vlan.c +++ b/drivers/net/mlx5/mlx5_vlan.c @@ -87,7 +87,8 @@ vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) --priv->vlan_filter_n; memmove(&priv->vlan_filter[i], &priv->vlan_filter[i + 1], - priv->vlan_filter_n - i); + sizeof(priv->vlan_filter[i]) * + (priv->vlan_filter_n - i)); priv->vlan_filter[priv->vlan_filter_n] = 0; } else { assert(i == priv->vlan_filter_n); -- 2.1.4