From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m15-50.126.com (m15-50.126.com [220.181.15.50]) by dpdk.org (Postfix) with ESMTP id 5E7D6B3D6 for ; Mon, 25 May 2015 12:15:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=lA0GQ fjsMolnkhl5c6lCTjAYq3Gmr2dmYXcTVBEb18w=; b=PQdPsCmE/euIR3oXpA7j0 vObS0hnMJ//3TNSNp8gh8zLomqiy3gt/Vy4fLLrFLIH9PkLc3YP5NeIpj1M2tl5Q 0P3rp0dNM9gWPp6aPAF2AXHNf6CEQFUSWgHrsfO78cnsKciC5hEzB02VJZJINO8j 6XFfE0YQTPIKGbv+mUKFok= Received: from dpdkdev$126.com ( [60.10.97.110] ) by ajax-webmail-wmsvr50 (Coremail) ; Mon, 25 May 2015 18:15:23 +0800 (CST) X-Originating-IP: [60.10.97.110] Date: Mon, 25 May 2015 18:15:23 +0800 (CST) From: "Tim Deng" To: "dev@dpdk.org" X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20150119(59087.7062) Copyright (c) 2002-2015 www.mailtech.cn 126com X-CM-CTRLDATA: yeEZ3mZvb3Rlcl9odG09ODE0Ojgx MIME-Version: 1.0 Message-ID: <7b3bcfdc.ee97.14d8a91d9e4.Coremail.dpdkdev@126.com> X-CM-TRANSID: MsqowAD3_xs89mJVpxbrAA--.3697W X-CM-SenderInfo: pgsgyvlhy6ij2wof0z/1tbi5RwFolUw0FEl4gAAs9 X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] ixgbe tcp cksum offload X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 10:15:28 -0000 SGksCgoKSSBhbSB0cnlpbmcgdG8gdXNlIGl4Z2JlIHRjcCBja3N1bSBoL3cgb2ZmbG9hZCBieSBm b2xsb3dpbmcgc3RlcHM6Ci0gcG9wdWxhdGUgcHNldWRvIGNrc3VtCi0gc2V0IGwyX2xlbiwgbDNf bGVuLCBsNF9sZW4KLSBzZXQgb2xfZmxhZ3MKCgpCdXQgSSBmb3VuZCB0aGUgcGt0IGRvZXNuJ3Qg Z2V0IHJpZ2h0IGgvdyBjaGVja3N1bSBieSBzbmlmZmluZyBvbiByZWN2IHNpZGUsIGFuZCBUQ1Ag Y2tzdW0gc3RpbGwgbGVhdmUgd2l0aCB0aGUgb3JpZ2luYWwgcHNldWRvIGNrc3VtLiAKQW5kIEkg dmVyaWZpZWQgdGhvc2UgbWV0YSBhcmUgY29ycmVjdGx5IHNldCwgZS5nLiBhIFRDUCBzeW4gcGt0 OgpsMl9sZW4gPSAxNCwgbDNfbGVuID0gMjAsIGw0X2xlbiA9IDQwICh3aXRoIHNvbWUgdGNwIG9w dGlvbnMpLAphbmQgb2xfZmxhZ3MgPSAweDkwMDAwMDAwMDAwMDAwIHdoaWNoIG1lYW5zIFBLVF9U WF9JUFY0IHwgUEtUX1RYX1RDUF9DS1NVTQoKCkRpZCBJIG1pc3MgYW55IHN0ZXA/CgoKVGhhbmtz IGluIGFkdmFuY2UsClRpbQoK >From damarion@cisco.com Mon May 25 12:20:55 2015 Return-Path: Received: from aer-iport-1.cisco.com (aer-iport-1.cisco.com [173.38.203.51]) by dpdk.org (Postfix) with ESMTP id 4C959E62 for ; Mon, 25 May 2015 12:20:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1062; q=dns/txt; s=iport; t=1432549255; x=1433758855; h=from:to:cc:subject:date:message-id; bh=mRLiMMn00TcQjMfGS9osjWc4DjyKkIl4QUTmO0LsR6I=; b=mBRhifh76c3b68VLB3gW1pYORmNWmmJHF3OkuKOgFIzbRmB4hUSC9epG SzDsm7t846x6hvtFRtVOGyhdOkZUxW9TTSc5H/h+dx+LJMKEZnhNaL16L 94zlMgtCqIEKquUbjX/SrftC+UOE8296NWqi1ao4GGGLYq9baHikMLugi M=; X-IronPort-AV: E=Sophos;i="5.13,491,1427760000"; d="scan'208";a="513606433" Received: from aer-iport-nat.cisco.com (HELO aer-core-2.cisco.com) ([173.38.203.22]) by aer-iport-1.cisco.com with ESMTP; 25 May 2015 10:20:54 +0000 Received: from proteus.cisco.com (proteus.cisco.com [10.55.15.254]) by aer-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id t4PAKsPg028126; Mon, 25 May 2015 10:20:54 GMT From: Damjan Marion To: dev@dpdk.org Date: Mon, 25 May 2015 12:20:52 +0200 Message-Id: <1432549252-8630-1-git-send-email-damarion@cisco.com> X-Mailer: git-send-email 2.1.4 Cc: Damjan Marion Subject: [dpdk-dev] [PATCH] virtio: fix crash if CQ is not negotiated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 10:20:55 -0000 Fix NULL dereference if virtio control queue is not negotiated. Signed-off-by: Damjan Marion --- drivers/net/virtio/virtio_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index f74e413..3633fce 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -114,19 +114,20 @@ static int virtio_send_command(struct virtqueue *vq, struct virtio_pmd_ctrl *ctrl, int *dlen, int pkt_num) { - uint16_t head = vq->vq_desc_head_idx, i; + uint32_t head, i; int k, sum = 0; virtio_net_ctrl_ack status = ~0; struct virtio_pmd_ctrl result; ctrl->status = status; - if (!vq->hw->cvq) { + if (!(vq && vq->hw->cvq)) { PMD_INIT_LOG(ERR, "%s(): Control queue is not supported.", __func__); return -1; } + head = vq->vq_desc_head_idx; PMD_INIT_LOG(DEBUG, "vq->vq_desc_head_idx = %d, status = %d, " "vq->hw->cvq = %p vq = %p", -- 2.1.4