From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5509EA0565; Sun, 1 Mar 2020 18:54:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6715E1BF8B; Sun, 1 Mar 2020 18:54:13 +0100 (CET) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by dpdk.org (Postfix) with ESMTP id C1F741BE81 for ; Sun, 1 Mar 2020 18:54:12 +0100 (CET) Received: by mail-pf1-f170.google.com with SMTP id l7so4385345pff.6 for ; Sun, 01 Mar 2020 09:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K3Ir3cwv81vT46tap6DCoeZ5f9avUD3SMdoeBpBvafU=; b=HRNi0DRvPzSRwNZRaSdulIMaUcRK94e3+8aTCOLRM/wjV/1nGDznjynhMaHGXJQ194 ql9UpYfaFp080WakQgsi9jpedV+Wgf9YY2H3gkWAm4IvCYHCS5q+SCnS7XUzQ9hZXeW0 Ti/Fmj3xAhlPpcyEC/V4vOKDDbDAusJj6C5WbKa11tfw7cz4TCydDGHAgxllLOCWaAPj IQuMNRvcb3iYiVV1Zqgw5uRoJvF4VArbtrIqWf3vizDt2uQStJcksEhWTHqxidfi73sO GYNALhOPOytEixSeV2aFMuHSa2OF0GPDBmh/bZimxjv+9LZaM3Hx9YHysJ8MOB4x3FKE mqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K3Ir3cwv81vT46tap6DCoeZ5f9avUD3SMdoeBpBvafU=; b=Ahs6ZJfGIdM2Ysu+4SHbDho1PVL/kqw0Za6Slk3a28GZ2vyRcjbCM5oLqTPqrFRsuN CbLU808RfC/wD1w54ho1Eca02Z7OwznoX46U2k/kzuotL73VARu3Hvt9JQX2mxhfALGw oDbkgKeKDPCU5as90samg67z/fHiCnf2cVArw3Onb4IjnQOLYisXO1U2wip/0OWwehvd PcMWtCO+84je0jLenOizy2Ux5SSnuvB8Oids6BA39qYfnOZ+jvHbc/QBsXqUSwbHGmhW ZAadZ5OgyLWsih9GQZ49FUiuqDDFNAc09p2ueAGyJRxafgSjVEH6iC2P/fgE+Gr1kh6R WM1g== X-Gm-Message-State: APjAAAV2Rrggag+VEsPg29MEXmMcKKPDSGrWGeKthVo1lBvsUiaR3W47 0PfwmStMdblsZQOolmgwdKniLQ== X-Google-Smtp-Source: APXvYqwCV63S9lmwIFBBbeUkyebKAi43FP84KmHs801ds0JUXdkmSDM1rHPCJ82db2aVolrBbD2LHQ== X-Received: by 2002:a63:745c:: with SMTP id e28mr14921724pgn.231.1583085251698; Sun, 01 Mar 2020 09:54:11 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b133sm17675306pga.43.2020.03.01.09.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 09:54:11 -0800 (PST) Date: Sun, 1 Mar 2020 09:54:02 -0800 From: Stephen Hemminger To: Min Tang Cc: dev@dpdk.org Message-ID: <20200301095402.6d570e83@hermes.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] net/netvsc: subchannel configuration failed due to unexpected NVS response X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 27 Feb 2020 11:16:01 -0500 Min Tang wrote: > Hi Stephen: > > I saw the following error messages when using DPDK 18.11.2 in Azure: > > hn_nvs_execute(): unexpected NVS resp 0x6b, expect 0x85 > hn_dev_configure(): subchannel configuration failed > > It was not easy to reproduce it and it only occurred with multiple queues > enabled. In hn_nvs_execute it expects the response to match the request. In > the failed case, it was expecting NVS_TYPE_SUBCH_REQ (133 or 0x85) but > got NVS_TYPE_RNDIS(107 or 0x6b). Obviously somewhere the NVS_TYPE_RNDIS > message had been sent before the NVS_TYPE_SUBCH_REQ message was sent. I > looked at the code and found that the NVS_TYPE_RNDIS message needs > completion response but it does not receive the response message anywhere. > The fix would be receiving and discarding the wrong response message(s). > > I put the following patches and it has fixed the problem. > > --- a/drivers/net/netvsc/hn_nvs.c 2020-02-27 11:08:29.755530969 -0500 > +++ b/drivers/net/netvsc/hn_nvs.c 2020-02-27 11:07:21.567371798 -0500 > @@ -92,7 +92,7 @@ > if (hdr->type != type) { > PMD_DRV_LOG(ERR, "unexpected NVS resp %#x, expect %#x", > hdr->type, type); > - goto retry; > + return -EINVAL; > } > > if (len < resplen) { The situation is that NVS_TYPE_RNDIS is a receive packet that is arriving while subchannel is being setup. For first channel this doesn't happen because control operations at that level happen before packets arrive. Needs some more research before coming up with a good fix. Either the processing of responses in nvs_execute needs to use the same receive processing function as normal data. Which means adding logic to wait for condition; or the incoming packets there could be dropped; or the device needs to be stopped before configuring sub channels. Dropping is probably the easiest to implement.