From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id B845D2BCD for ; Thu, 9 Aug 2018 19:50:19 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id u24-v6so3173697pfn.13 for ; Thu, 09 Aug 2018 10:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l61fyM8PLyqh8SU4d7kOPxifs82/3wDwcM7mGyqQ9Sk=; b=DgF5rsnef04YjqEi3ViSG35aj4Ua9V1I/yNswZ+0Mno+qaUwW7QfA25pG7CE/MsAB+ AxGXc/S7pmoifpyGeADZa4rZPCOOVHrCanMKvv5uGbdvh/9WEZnRBIMEx0NP/P5ihlBX JUSYAwlvBvTvgtG50lB7xRwUyB1eWGre2x5iRWgS4P8oXqhbDxL2aDJG7aTFk5FLJqfa nBunBPhBZmxLoLVdeesmZtcyOGPpUlxygPgWMvxYdYdbwmj0YFdgsn7BVfmeyDlMN2In 2/xJb1ETCYR7xAytf7ByVCQg+CzTjK9oo8iluuQ7H0pFUvUdXaYNGR/L3GvWtDs7eJcn g3gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l61fyM8PLyqh8SU4d7kOPxifs82/3wDwcM7mGyqQ9Sk=; b=o4E20iLuwtmWNPp7G9VrxSpJGS3VE5+uUpjHJctAHrXOZSuaxVmigEF1tkKCA85GCn iaVbalAlYWMRNTg5o6UXM5rRtMU+obpGX2/8Mn3Ri8ito16EcmpVitMFaRCTXq42CyHm X1d7CAdg1IUGaHuBY7vIzzjhYx2K0SdssOInSNSY/xwFXhwgPWNbiasnhA2JA3lVYuju cd8+QjPvXC7jRM+asT+oF0K1x7MmhGCW0F2yw2xJOd5nSeZ7PEJriqTY93Qx5jiCkTEn BqbHe5Ry0yC1gAXhbXapmpcdAcFvABmNwIAv9Ipb2JgJ7YgFIV9qO75o/ccgtmAs3b7T 18fQ== X-Gm-Message-State: AOUpUlHM5WezTn6MgJs0Y8FlE6FMIg0iilEiJLzm2MiPOP/5/Ey/umuu dIXY0kOfECZYM9iXTRwlye83YgO5xvM= X-Google-Smtp-Source: AA+uWPzbPXk0EmwLwZDj6VGx6sz7Ud9KvlNtObXIFBrxLfj0Fi3DrMKTyLjBdXlPdvw3lj+cyJSSVw== X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr3359110pfd.152.1533837018658; Thu, 09 Aug 2018 10:50:18 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n22-v6sm14993873pfj.68.2018.08.09.10.50.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 10:50:17 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Thu, 9 Aug 2018 10:50:05 -0700 Message-Id: <20180809175008.5787-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809175008.5787-1-stephen@networkplumber.org> References: <20180809175008.5787-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 1/4] netvsc: chimney buffer size error handling 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: , X-List-Received-Date: Thu, 09 Aug 2018 17:50:20 -0000 Fix the error handling in setting up transmit buffer. If setting up chimney buffer fails, then it is not connected so no need to send disconnect. Allow for some unused area if full area is not used. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_nvs.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/netvsc/hn_nvs.c b/drivers/net/netvsc/hn_nvs.c index 77d3b839fd45..a458bb720f82 100644 --- a/drivers/net/netvsc/hn_nvs.c +++ b/drivers/net/netvsc/hn_nvs.c @@ -279,14 +279,13 @@ hn_nvs_conn_chim(struct hn_data *hv) NVS_TYPE_CHIM_CONNRESP); if (error) { PMD_DRV_LOG(ERR, "exec nvs chim conn failed"); - goto cleanup; + return error; } if (resp.status != NVS_STATUS_OK) { PMD_DRV_LOG(ERR, "nvs chim conn failed: %x", resp.status); - error = -EIO; - goto cleanup; + return -EIO; } sectsz = resp.sectsz; @@ -295,7 +294,8 @@ hn_nvs_conn_chim(struct hn_data *hv) PMD_DRV_LOG(NOTICE, "invalid chimney sending buffer section size: %u", sectsz); - return 0; + error = -EINVAL; + goto cleanup; } hv->chim_szmax = sectsz; @@ -304,11 +304,6 @@ hn_nvs_conn_chim(struct hn_data *hv) PMD_DRV_LOG(INFO, "send buffer %lu section size:%u, count:%u", len, hv->chim_szmax, hv->chim_cnt); - if (len % hv->chim_szmax != 0) { - PMD_DRV_LOG(NOTICE, - "chimney sending sections are not properly aligned"); - } - /* Done! */ return 0; -- 2.18.0