From patchwork Tue Nov 1 01:57:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Di Proietto X-Patchwork-Id: 689734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3t7Drk6dnzz9t25 for ; Tue, 1 Nov 2016 12:57:42 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 96EAD1029D; Mon, 31 Oct 2016 18:57:40 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id BE778101C3 for ; Mon, 31 Oct 2016 18:57:38 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 0D1F51E00AE for ; Mon, 31 Oct 2016 19:57:38 -0600 (MDT) X-ASG-Debug-ID: 1477965457-09eadd0f984470b0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar5.cudamail.com with ESMTP id moGmnPa1wF8XB2pl (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 31 Oct 2016 19:57:37 -0600 (MDT) X-Barracuda-Envelope-From: diproiettod@vmware.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO EX13-EDG-OU-001.vmware.com) (208.91.0.189) by mx3-pf2.cudamail.com with ESMTPS (AES256-SHA encrypted); 1 Nov 2016 01:57:37 -0000 Received-SPF: error (mx3-pf2.cudamail.com: error in processing during lookup of vmware.com: DNS problem) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Mon, 31 Oct 2016 18:57:21 -0700 Received: from sc9-mailhost1.vmware.com (htb-1n-eng-dhcp102.eng.vmware.com [10.33.74.102]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 8E0A940151; Mon, 31 Oct 2016 18:57:33 -0700 (PDT) X-CudaMail-Envelope-Sender: diproiettod@vmware.com From: Daniele Di Proietto To: X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1030056506 X-CudaMail-DTE: 103116 X-CudaMail-Originating-IP: 208.91.0.189 Date: Mon, 31 Oct 2016 18:57:14 -0700 X-ASG-Orig-Subj: [##CM-V2-1030056506##][PATCH] netdev-dpdk: Fix crash in QoS. Message-ID: <20161101015714.24368-1-diproiettod@vmware.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-001.vmware.com: diproiettod@vmware.com does not designate permitted sender hosts) X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1477965457 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] netdev-dpdk: Fix crash in QoS. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" qos_conf can be NULL. This can be easily reproduced by setting egress QoS on a port: ``` ovs-vsctl set port dpdk2 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=46000000 other-config:cbs=2048 ``` Reported-by: Ian Stokes Fixes: 78bd47cf44a5 ("netdev-dpdk: Use RCU for egress QoS.") Signed-off-by: Daniele Di Proietto Tested-by: Ian Stokes Acked-by: Ian Stokes --- lib/netdev-dpdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 7c1523e..49750c3 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2803,7 +2803,7 @@ netdev_dpdk_set_qos(struct netdev *netdev, const char *type, if (type && type[0]) { error = EOPNOTSUPP; } - } else if (qos_conf->ops == new_ops + } else if (qos_conf && qos_conf->ops == new_ops && qos_conf->ops->qos_is_equal(qos_conf, details)) { new_qos_conf = qos_conf; } else {