From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wujingji@shecgisg004.sh.intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 44F8AC598
 for <dev@dpdk.org>; Tue, 28 Jul 2015 11:01:09 +0200 (CEST)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by orsmga103.jf.intel.com with ESMTP; 28 Jul 2015 02:01:08 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.15,562,1432623600"; d="scan'208";a="772648606"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by orsmga002.jf.intel.com with ESMTP; 28 Jul 2015 02:01:07 -0700
Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com
 [10.239.29.89])
 by shvmail01.sh.intel.com with ESMTP id t6S915jV000974;
 Tue, 28 Jul 2015 17:01:05 +0800
Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1])
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t6S911Oi013843; Tue, 28 Jul 2015 17:01:03 +0800
Received: (from wujingji@localhost)
 by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t6S910Tj013839;
 Tue, 28 Jul 2015 17:01:00 +0800
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Date: Tue, 28 Jul 2015 17:01:00 +0800
Message-Id: <1438074060-13809-1-git-send-email-jingjing.wu@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1438046019-30149-1-git-send-email-jingjing.wu@intel.com>
References: <1438046019-30149-1-git-send-email-jingjing.wu@intel.com>
Subject: [dpdk-dev] [PATCH V2] i40evf: fix crash when setup tx queues on vf
	port
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Jul 2015 09:01:09 -0000

From: "jingjing.wu" <jingjing.wu@intel.com>

This patch fixes the issue:
Testpmd crashed with Segmentation fault when setup tx queues on vf
Steps for reproduce:
  - create one vf device from i40e driver
  - bind vf device to igb_uio and start testpmd

With debugging tools, we saw the struct i40e_vf is cleared after
memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)) in
rte_eth_dev_configure, which should not happen, and the pointer to
i40e_vf isn't in the range of i40e_adapter.

The root cause is the dev_private_size in i40e virtual function driver struct
rte_i40evf_pmd was set incorrectly.

Signed-off-by: jingjing.wu <jingjing.wu@intel.com>
---
v2 changes:
 rework the patch's title and commit log.

 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index f3470e6..b694400 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1248,7 +1248,7 @@ static struct eth_driver rte_i40evf_pmd = {
 	},
 	.eth_dev_init = i40evf_dev_init,
 	.eth_dev_uninit = i40evf_dev_uninit,
-	.dev_private_size = sizeof(struct i40e_vf),
+	.dev_private_size = sizeof(struct i40e_adapter),
 };
 
 /*
-- 
2.4.0