From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shahaf Shuler Subject: [PATCH 4/6] net/mlx5: fix VLAN configuration after port stop Date: Thu, 23 Nov 2017 14:02:50 +0200 Message-ID: <20171123120252.143695-5-shahafs@mellanox.com> References: <20171123120252.143695-1-shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, stable@dpdk.org To: nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Return-path: In-Reply-To: <20171123120252.143695-1-shahafs@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Ethdev layer has an API to configure vlan setting on the flight, i.e. when the port state is start. calling such API when the port is stopped may cause segmentation fault as the related Verbs contexts has not been created yet. Fixes: 09cb5b581762 ("net/mlx5: separate DPDK from verbs Rx queue objects") Cc: nelio.laranjeiro@6wind.com Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_vlan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c index dc82643fc..128c2b6b6 100644 --- a/drivers/net/mlx5/mlx5_vlan.c +++ b/drivers/net/mlx5/mlx5_vlan.c @@ -127,6 +127,11 @@ priv_vlan_strip_queue_set(struct priv *priv, uint16_t idx, int on) DEBUG("set VLAN offloads 0x%x for port %d queue %d", vlan_offloads, rxq->port_id, idx); + if (!rxq_ctrl->ibv) { + /* Update related bits in RX queue. */ + rxq->vlan_strip = !!on; + return; + } mod = (struct ibv_wq_attr){ .attr_mask = IBV_WQ_ATTR_FLAGS, .flags_mask = IBV_WQ_FLAGS_CVLAN_STRIPPING, -- 2.12.0