From patchwork Thu Apr 30 19:08:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69629 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01526A046B; Thu, 30 Apr 2020 21:09:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B06911DAF0; Thu, 30 Apr 2020 21:09:07 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id BD1CB1DACF for ; Thu, 30 Apr 2020 21:09:03 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id d3so3260209pgj.6 for ; Thu, 30 Apr 2020 12:09:03 -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 :mime-version:content-transfer-encoding; bh=VfwwYpSna/GNMjvSAXA07dhn3Q3zxYNTsqsVua6IUGc=; b=VjwrW6dQNEE9FW2FwkbTsKqnsl7ANmxGSX6mfrJBkXCFE4/lAL73XS5OYfet2MWcwJ SyGOmFhqA+Hm2fn487Jvc9kqQdI5zewl/9W4LV5fbT6iZUuTGxS4+TTIsLuQ64d7uyP1 Bd8+dxnS+B9fGEj5pzMfSfj3uVhMfn2Py87rWIV9oyxARwJlI3MOX18YS3/6Irz+ax5F 5mtRY6ncjGrdXSYNzyhO7Wds1z2xty594SxXDoKyG/glreEi7Qd/EEzW2r8zncBRIOfs sw6q7TW/eHiGF/eMK2x5GsucGo2ZR8dEDD+1+OSK0KLqiKLvzN/W66NtimeffV3e3WUm IV+g== 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:mime-version:content-transfer-encoding; bh=VfwwYpSna/GNMjvSAXA07dhn3Q3zxYNTsqsVua6IUGc=; b=e/0wDZ82Ma5cDMXc1sXMYjyDyK9EvHDjvAm1dYbm6d0J++IXV0o91dMa6XYoLqBmOE V8Hd8ync3xQ+BM8pziIJdJ9Uy0vbCjLzjkFxLjV4i/u/Oy554nRF200yJmUcZ0ACBxDl SaG1SMwv/r7L/pPCj5zBa4zB+PdEHJhWNVGOzbtvvRoYGCXM7DxHs5YZ0Spp6juDvDaH 7NZZ64R6OzQOtoGNC/TCDAXJ4EubNzs7LQ26UGGRG27tNkg+sCMTH920qhlUTMmSOVxV ng6I36XlVc5+EG9y6n7QfS+N2jijSy5r6Dje3UHtauLbrj0sjjYYqYQDChaVpmUhlvtg 8HPw== X-Gm-Message-State: AGi0PuaI01qx9mqHSo2599KPaUgY3v80zBAWJm5I7Lv0dTdZ2HexloOz 9CYsjq4wvDIO0U/051ltbdAU5CsHqzoqBg== X-Google-Smtp-Source: APiQypIj5TXtTEgY6XjwYgeAye6R7N+QlV0mIDxLtTbP2Ue6xrbNTvd567oEwi1HOsS/iNbTGq9rrw== X-Received: by 2002:a63:1845:: with SMTP id 5mr409996pgy.69.1588273742532; Thu, 30 Apr 2020 12:09:02 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:47 -0700 Message-Id: <20200430190853.498-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/7] net/netvsc: fix comment spelling errors 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" No code change here. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_nvs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 05f1a25a1abc..46da5a4e8170 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -72,7 +72,7 @@ static const struct hn_xstats_name_off hn_stat_strings[] = { /* The default RSS key. * This value is the same as MLX5 so that flows will be - * received on same path for both VF ans synthetic NIC. + * received on same path for both VF and synthetic NIC. */ static const uint8_t rss_default_key[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x2c, 0xc6, 0x81, 0xd1, 0x5b, 0xdb, 0xf4, 0xf7, diff --git a/drivers/net/netvsc/hn_nvs.h b/drivers/net/netvsc/hn_nvs.h index 2563fd8d8669..015839e3644f 100644 --- a/drivers/net/netvsc/hn_nvs.h +++ b/drivers/net/netvsc/hn_nvs.h @@ -37,7 +37,7 @@ #define NVS_RNDIS_MTYPE_CTRL 1 /* - * NVS message transacion status codes. + * NVS message transaction status codes. */ #define NVS_STATUS_OK 1 #define NVS_STATUS_FAILED 2 From patchwork Thu Apr 30 19:08:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69630 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 066CBA046B; Thu, 30 Apr 2020 21:09:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 164711DBC8; Thu, 30 Apr 2020 21:09:09 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by dpdk.org (Postfix) with ESMTP id 9D8531DAE5 for ; Thu, 30 Apr 2020 21:09:05 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id t9so1178806pjw.0 for ; Thu, 30 Apr 2020 12:09:05 -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 :mime-version:content-transfer-encoding; bh=VK9PGMlg6D4gjz3WtfHzktkv5wTK9WqUysly4pgNt1o=; b=qchb0wp1H02Kqc/Hoas7luHbJ2qbZXy8JrW2aL1+8Of1fBkz31Cj47E06QbJUCUG0U JSPUmJI2zmwxlNr/rvHV0z/N1YVRLY9/X/5Tpi9iX53aAUOsL7srVsac6QOQYqnmBBtm y4ryuoSPhfYSDTGbfdtSdpu/s5gDsOWT+a5mEIwz5zAwUMLZc6FKafvA1D1JPTrqrUb5 TN/mpGbTx0pUo+urIIIpZh83qs1O7ybYJjm4yzaAWb4qJlgtytOva79kkMsHkqNKT/8s MlTKMG3PnCfGOB3k6Nd9CB36ygEkpx5X7g80nBWbPQhpt95d+lLFZBYVnxbtf8CiLNA5 auNg== 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:mime-version:content-transfer-encoding; bh=VK9PGMlg6D4gjz3WtfHzktkv5wTK9WqUysly4pgNt1o=; b=ROfJepIrtYuL7M94bhoqCXul8Y2iKks5l9+VUngyVir8me9JrWlVHKxOahgOZTK6xd 5HmwFEL3HQ9+BG2CCk9M402NTaeAJt95GyentdL9rRSJbzuIHOVPV3JMabbEAYFDPs7T x8q+QNeO1qKOXHnvKeh3T13M8nPe/CfrHFVZ4wjji4sT/WVGLLSlE254uC+NZLS3PliA VCbsYKdWAXwSOKqKW8RIlRETbWba39zFyfU/4iFf1RwzMj1nC7BVO0wA5uN6AdNZwh2n WqNSDuN9948JCrH2klAFmD5P0LGulabubNcV7d3oju4kaVrc1gQrUwrkDBBGtfq/ZLLJ g5iw== X-Gm-Message-State: AGi0PubiD9Je5Yhob4XhFWJvPBXc+LVSVm5JZ7f1qk49Ez2j6amtbMIN Cu43MM+/jM0qjdIfM0KpTANlWBPiOx4ksg== X-Google-Smtp-Source: APiQypKZqyanW8T20SNm3uiZ3BTslPVulTlaGKw64d2D21XtqPM80TDAzHkC9A0fPRyWVHczokixdQ== X-Received: by 2002:a17:902:6114:: with SMTP id t20mr492712plj.324.1588273743931; Thu, 30 Apr 2020 12:09:03 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:48 -0700 Message-Id: <20200430190853.498-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/7] bus/vmbus: fix comment spelling errors 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" No code change here. Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/linux/vmbus_uio.c | 2 +- drivers/bus/vmbus/vmbus_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index 10e50c9b5a10..5451bfd1501d 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -165,7 +165,7 @@ vmbus_uio_map_resource_by_index(struct rte_vmbus_device *dev, int idx, dev->resource[idx].addr = mapaddr; vmbus_map_addr = RTE_PTR_ADD(mapaddr, size); - /* Record result of sucessful mapping for use by secondary */ + /* Record result of successful mapping for use by secondary */ maps[idx].addr = mapaddr; maps[idx].size = size; diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index 48a219f73529..eaf5c292f986 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -131,7 +131,7 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr, } /* - * IF device class GUID mathces, call the probe function of + * If device class GUID matches, call the probe function of * registere drivers for the vmbus device. * Return -1 if initialization failed, * and 1 if no driver found for this device. From patchwork Thu Apr 30 19:08:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69631 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3A0A2A046B; Thu, 30 Apr 2020 21:09:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FB231DBDD; Thu, 30 Apr 2020 21:09:12 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id CCBCA1DAED for ; Thu, 30 Apr 2020 21:09:06 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id v63so283503pfb.10 for ; Thu, 30 Apr 2020 12:09:06 -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 :mime-version:content-transfer-encoding; bh=gM9D22B7a/TuqnZw8T9M6yRj21fpxqioBW632jm56kU=; b=lF5O3H0b/4EHmNskBpMt7fPufvDlV6XQ+NBOfBFBdTZ/u3OPK919tG2fnoOL0pSZi7 pNACZGfzkq7zECRgzVwBXPvNpO8DtaKb6iKLXFP3MIItxsg5sJZhBhUZiV96AWiY701u GfvlCNeJpBbfsR2NMY52cMWsULVfEMZDdeE5BNN5rEusD4XqAhFu1X4hZ9JN3PrLPwnT 45dI4qEUaAkCFldey7Re4le/mSCtRooKVhVPpK/a73VIcnid9fJALfxd+NQcGNWCGL8U fthc3MGJ0WDMaraa9ZH/37VxA8K8BAPUYYDqHb25Emk1CQuYOKkQQ5jBJtfEW20W5QTn 4YEg== 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:mime-version:content-transfer-encoding; bh=gM9D22B7a/TuqnZw8T9M6yRj21fpxqioBW632jm56kU=; b=Zn3SEvOpIqsjRg8IzUva5YzHYI9wsh1X1MuYNop4cDFn6M0rzgFDenwS/lWsc2oSlb t8fuXLeR06QzvaKrEHo5gvWgiQ3tNuArTEoEGjCY8y1lsVynNWLcw6Swb3hKscYKaQ+N 3ndMhWpxmTQwlGHpAaU+R/wHYQAr9rmGehSd16rkIej9guywmUuTIcVZVLuWTJet9cfe zvx2adaNBwcKWY7+9Nr36OtxdFQF8kTpZeFcIkhBCct3woEtanx1I9N6dCXcKzXQ2hce 1gxyKdDV6pZfuOauVfjCiAf3cXnPgDWhaQJd5IfJjKh7zweDjR2y9PC2b74BektCXLuK VgJQ== X-Gm-Message-State: AGi0PuaD7by0ieo43Q9xlfTBeAlKXBUk+fTJVdv3S+H6VAqIMZz6V9qX l5JnT9wdZIsA1Gup4DnUbQ/heoesTEsm2g== X-Google-Smtp-Source: APiQypIR2bSGOb258lGMZKVnmiYi6VxsEeTf47P50n9prbY2gyQDm45WpU2h3LSQjn5BUsauLioARQ== X-Received: by 2002:a63:d16:: with SMTP id c22mr444893pgl.34.1588273745636; Thu, 30 Apr 2020 12:09:05 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:49 -0700 Message-Id: <20200430190853.498-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/7] net/vmbus: add missing barrier 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" The check for event ring being empty needs a barrier to avoid any over agressive optimization. This is same barrier as Linux kernel. Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/vmbus_channel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c index 46b3ba3f9f9e..ff2985c25758 100644 --- a/drivers/bus/vmbus/vmbus_channel.c +++ b/drivers/bus/vmbus/vmbus_channel.c @@ -199,6 +199,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel) { const struct vmbus_br *br = &channel->rxbr; + rte_smp_rmb(); return br->vbr->rindex == br->vbr->windex; } From patchwork Thu Apr 30 19:08:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69632 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CBFD0A046B; Thu, 30 Apr 2020 21:09:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C68E21DBE8; Thu, 30 Apr 2020 21:09:13 +0200 (CEST) Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by dpdk.org (Postfix) with ESMTP id 4553B1DB8D for ; Thu, 30 Apr 2020 21:09:08 +0200 (CEST) Received: by mail-pj1-f65.google.com with SMTP id mq3so1177462pjb.1 for ; Thu, 30 Apr 2020 12:09:08 -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 :mime-version:content-transfer-encoding; bh=p4knk4Jts5mF3s3iSfQeRtFVxJhOazgUvcV4lbo9Q9k=; b=QIm/vsCPzvTWtNPNTiZpaoVZMlakQmPtCNMP988BnQ5Xh75Cx1y4kEo5oKK+D31wHw 61BZehqLMywuK6E3CPqNq42dbSrpZGvuuru58jrU+N+DnLl6hDM9W0lBkqVMO42oGHpY wRH1OC9FPz3+E/WoAwzxXrnAlFppqXsW+z/TtP6b+jyhMsHQG7E+dTadkgj6J6cFZ6RO khywqgcalYpyY5udQeDeds/raR0kG0Zq/FSK4MmGMKqF8SCy0FgLXmxUf+xWZBFzUrXM Pa3MBkZxkL3jVRztQnn1t796jF9e16NUAevYEfXygGOpCqH7KDxbZoMpqcU4eVuCtABu dtAw== 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:mime-version:content-transfer-encoding; bh=p4knk4Jts5mF3s3iSfQeRtFVxJhOazgUvcV4lbo9Q9k=; b=RTsCULFxp84OYQv47y5oxcertrigkaAm+he8TUU5aiN7yfKEcCY1QqSSZ2LzfHODcn d1a/QxIzTVc9BEaNILu11BOCKPZqQVa7zq7sYT5TEw0s5P3ifzLY27d8b4XtQac9sLz2 uHyAgIk37QO8G4kDoo9A+7gOf7LYW0uD2GOKM0QEAOsFgtGcm3LzCLgdBGnalUaHs5tv RmN/PEVXMvLIoZ7C34KaOZUW4K4hw8KgduutoEMUJpD0iNOwDWm/Z//0b+aS5Oj2g/Fu 1RoaHWu69RC+dTTUMQ7zmesKPhSzkpjgKkSBq5c9725N2qif+DZE/vCEae5k6GsbOjuf dbaQ== X-Gm-Message-State: AGi0PubyGBKRaeH3YZb0QDkl9lA7kEcmH1ptcN/+SGuB/H1MaH7Bj2bd 49ZYDQUXt6tVQUgT94IUiOT8RWBcLyCN5g== X-Google-Smtp-Source: APiQypKvJAZtNNm3Y9BoP6n1BGtUb7WJl4ac0I4MVaVvIPTV8ywit9rmVCqekOdjtnP+gT5Z3MMcYg== X-Received: by 2002:a17:902:bd42:: with SMTP id b2mr440814plx.13.1588273746968; Thu, 30 Apr 2020 12:09:06 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:06 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:50 -0700 Message-Id: <20200430190853.498-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 4/7] net/netvsc: check the vmbus ring buffer more often 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" Since VF notfications are handled as VMBUS notifications on the primary channel (and not as hotplug). The channel should be checked before deciding to use VF for Rx or Tx. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_rxtx.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 19f00a05285f..773ba31fcc64 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -1372,25 +1372,29 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) struct hn_data *hv = txq->hv; struct rte_eth_dev *vf_dev; bool need_sig = false; - uint16_t nb_tx, avail; + uint16_t nb_tx, tx_thresh; int ret; if (unlikely(hv->closed)) return 0; + /* + * Always check for events on the primary channel + * because that is where hotplug notifications occur. + */ + tx_thresh = RTE_MAX(txq->free_thresh, nb_pkts); + if (txq->queue_id == 0 || + rte_mempool_avail_count(txq->txdesc_pool) < tx_thresh) + hn_process_events(hv, txq->queue_id, 0); + /* Transmit over VF if present and up */ vf_dev = hn_get_vf_dev(hv); - if (vf_dev && vf_dev->data->dev_started) { void *sub_q = vf_dev->data->tx_queues[queue_id]; return (*vf_dev->tx_pkt_burst)(sub_q, tx_pkts, nb_pkts); } - avail = rte_mempool_avail_count(txq->txdesc_pool); - if (nb_pkts > avail || avail <= txq->free_thresh) - hn_process_events(hv, txq->queue_id, 0); - for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) { struct rte_mbuf *m = tx_pkts[nb_tx]; uint32_t pkt_size = m->pkt_len + HN_RNDIS_PKT_LEN; @@ -1487,10 +1491,7 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (unlikely(hv->closed)) return 0; - /* Receive from VF if present and up */ - vf_dev = hn_get_vf_dev(hv); - - /* Check for new completions */ + /* Check for new completions (and hotplug) */ if (likely(rte_ring_count(rxq->rx_ring) < nb_pkts)) hn_process_events(hv, rxq->queue_id, 0); @@ -1499,6 +1500,7 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) (void **)rx_pkts, nb_pkts, NULL); /* If VF is available, check that as well */ + vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->data->dev_started) nb_rcv += hn_recv_vf(vf_dev->data->port_id, rxq, rx_pkts + nb_rcv, nb_pkts - nb_rcv); From patchwork Thu Apr 30 19:08:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69633 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2211BA046B; Thu, 30 Apr 2020 21:09:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 671F01DBF6; Thu, 30 Apr 2020 21:09:15 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 219EF1DBD2 for ; Thu, 30 Apr 2020 21:09:10 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id d17so3269198pgo.0 for ; Thu, 30 Apr 2020 12:09:10 -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 :mime-version:content-transfer-encoding; bh=pjaGXfgEwVo6tDfGIjiDzBK4OWzG/RrGdL4nTAqS60w=; b=O4Hks7c5d3OkNiTLpzlUZeKcFdQ2tJaWMrB4Eu4KCYLC3N1Hf28eE3fVgSv0cGsf2i thUnqNdxBc7OO6SOinoVzkVnbQl+vRXftTIkQHeh9fy1BqsWJ6KgPn9iB38k7CojhwWw a2KSGeLRJFlYQv8Q2evXSAfG7FuQUKfRVaLnsLoZg/bHlFtWHvpWH0F53uC7N8QCeDTy OONBEQNZCFyTUBEc2NjsygoF80As4eLKxis9/CkcnFkmJVvl7H7JAkCDz8TIXlfukT2V bOEVx67ggm8ph38+RIJ41WFlSD+dD3KS2aIxllFltLquGmUMxB87MW9laphcx3ij5xHc Hejg== 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:mime-version:content-transfer-encoding; bh=pjaGXfgEwVo6tDfGIjiDzBK4OWzG/RrGdL4nTAqS60w=; b=JWryz7EVEXH3CGuIZ9Ad22GthzpByaKUaaJD2+HW7uIFWBA6/y6VHzHf9xDIEHDzXO ySRK1GtxaQWAnD9wNxovAPXgQ9yiej6g7NH2wYhy3m7NvFol73cxVJOgZs8Igk5gAdmz Bm7CUplgyJBy8uu4j7Aom24+WjfXJDLKpve+hEjwFEUF6bFSqfwo7zjTWdsLwoQHRvU6 4CwstM1n+Tr1RyQdEpJVPdBvOEdAc/OwKZc1H1W5oJCaNry5AmWIJU4BDl32XPWGNVIB oQV+Mq+q6PJZ0nsKm9T35r4Gh/BLgfMHfqV7sSHzHxp1dTJ33thFwgnxfVD0Bl/2qB9T hlNQ== X-Gm-Message-State: AGi0PuYqwnj+tqe4kdqp1voLlMIOi8K40TixyaMMIO3AMqITZe/YQQtj Hukbcw54zVveBDRkbWZ3sBrBhtEjs4dtvQ== X-Google-Smtp-Source: APiQypI7r+eYPw0JcZfibLKX09p14eovJ0x+iHVCL/F0xY9+f3e7aDNAM/Hm90ArOw0xTENFuFrQAQ== X-Received: by 2002:aa7:979c:: with SMTP id o28mr179090pfp.265.1588273748343; Thu, 30 Apr 2020 12:09:08 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:07 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:51 -0700 Message-Id: <20200430190853.498-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 5/7] net/netvsc: manage VF port under rwlock 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" With multiple channels, the primary channel may receive notification that VF has been added or removed while secondary channel is in process of doing receive or transmit. Resolve this race by converting existing vf_lock to a reader/writer lock. Users of lock (tx/rx/stats) acquire for read, and actions like add/remove acquire it for write. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 8 ++- drivers/net/netvsc/hn_var.h | 10 ++-- drivers/net/netvsc/hn_vf.c | 104 +++++++++++++++------------------ 4 files changed, 61 insertions(+), 63 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 46da5a4e8170..7bf5465ce5e7 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -957,7 +957,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) hv->port_id = eth_dev->data->port_id; hv->latency = HN_CHAN_LATENCY_NS; hv->max_queues = 1; - rte_spinlock_init(&hv->vf_lock); + rte_rwlock_init(&hv->vf_lock); hv->vf_port = HN_INVALID_PORT; err = hn_parse_args(eth_dev); diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 773ba31fcc64..31fae5597598 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -1388,12 +1388,16 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) hn_process_events(hv, txq->queue_id, 0); /* Transmit over VF if present and up */ + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->data->dev_started) { void *sub_q = vf_dev->data->tx_queues[queue_id]; - return (*vf_dev->tx_pkt_burst)(sub_q, tx_pkts, nb_pkts); + nb_tx = (*vf_dev->tx_pkt_burst)(sub_q, tx_pkts, nb_pkts); + rte_rwlock_read_unlock(&hv->vf_lock); + return nb_tx; } + rte_rwlock_read_unlock(&hv->vf_lock); for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) { struct rte_mbuf *m = tx_pkts[nb_tx]; @@ -1500,11 +1504,13 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) (void **)rx_pkts, nb_pkts, NULL); /* If VF is available, check that as well */ + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->data->dev_started) nb_rcv += hn_recv_vf(vf_dev->data->port_id, rxq, rx_pkts + nb_rcv, nb_pkts - nb_rcv); + rte_rwlock_read_unlock(&hv->vf_lock); return nb_rcv; } diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index b4c61717379f..d1d38b459601 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -98,7 +98,7 @@ struct hn_rx_bufinfo { struct hn_data { struct rte_vmbus_device *vmbus; struct hn_rx_queue *primary; - rte_spinlock_t vf_lock; + rte_rwlock_t vf_lock; uint16_t port_id; uint16_t vf_port; @@ -188,15 +188,15 @@ hn_vf_attached(const struct hn_data *hv) return hv->vf_port != HN_INVALID_PORT; } -/* Get VF device for existing netvsc device */ +/* + * Get VF device for existing netvsc device + * Assumes vf_lock is held. + */ static inline struct rte_eth_dev * hn_get_vf_dev(const struct hn_data *hv) { uint16_t vf_port = hv->vf_port; - /* make sure vf_port is loaded */ - rte_smp_rmb(); - if (vf_port == HN_INVALID_PORT) return NULL; else diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 1261b2e2ef85..b7e3ba46bf63 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -82,8 +82,6 @@ static int hn_vf_attach(struct hn_data *hv, uint16_t port_id) PMD_DRV_LOG(DEBUG, "Attach VF device %u", port_id); hv->vf_port = port_id; - rte_smp_wmb(); - return 0; } @@ -98,9 +96,7 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) return port; } - rte_spinlock_lock(&hv->vf_lock); err = hn_vf_attach(hv, port); - if (err == 0) { dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; hv->vf_intr = (struct rte_intr_handle) { @@ -110,7 +106,6 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) dev->intr_handle = &hv->vf_intr; hn_nvs_set_datapath(hv, NVS_DATAPATH_VF); } - rte_spinlock_unlock(&hv->vf_lock); return err; } @@ -119,8 +114,6 @@ int hn_vf_add(struct rte_eth_dev *dev, struct hn_data *hv) static void hn_vf_remove(struct hn_data *hv) { - rte_spinlock_lock(&hv->vf_lock); - if (!hn_vf_attached(hv)) { PMD_DRV_LOG(ERR, "VF path not active"); } else { @@ -129,12 +122,10 @@ static void hn_vf_remove(struct hn_data *hv) /* Stop transmission over VF */ hv->vf_port = HN_INVALID_PORT; - rte_smp_wmb(); /* Give back ownership */ rte_eth_dev_owner_unset(hv->vf_port, hv->owner.id); } - rte_spinlock_unlock(&hv->vf_lock); } /* Handle VF association message from host */ @@ -156,15 +147,16 @@ hn_nvs_handle_vfassoc(struct rte_eth_dev *dev, vf_assoc->allocated ? "add to" : "remove from", dev->data->port_id); + rte_rwlock_write_lock(&hv->vf_lock); hv->vf_present = vf_assoc->allocated; - if (dev->state != RTE_ETH_DEV_ATTACHED) - return; - - if (vf_assoc->allocated) - hn_vf_add(dev, hv); - else - hn_vf_remove(hv); + if (dev->state == RTE_ETH_DEV_ATTACHED) { + if (vf_assoc->allocated) + hn_vf_add(dev, hv); + else + hn_vf_remove(hv); + } + rte_rwlock_write_unlock(&hv->vf_lock); } static void @@ -223,11 +215,11 @@ int hn_vf_info_get(struct hn_data *hv, struct rte_eth_dev_info *info) struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = hn_vf_info_merge(vf_dev, info); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -238,11 +230,11 @@ int hn_vf_link_update(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->link_update) ret = (*vf_dev->dev_ops->link_update)(vf_dev, wait_to_complete); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -315,10 +307,10 @@ int hn_vf_configure(struct rte_eth_dev *dev, struct hn_data *hv = dev->data->dev_private; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); if (hv->vf_port != HN_INVALID_PORT) ret = _hn_vf_configure(dev, hv->vf_port, dev_conf); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -328,11 +320,11 @@ const uint32_t *hn_vf_supported_ptypes(struct rte_eth_dev *dev) struct rte_eth_dev *vf_dev; const uint32_t *ptypes = NULL; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->dev_supported_ptypes_get) ptypes = (*vf_dev->dev_ops->dev_supported_ptypes_get)(vf_dev); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ptypes; } @@ -343,11 +335,11 @@ int hn_vf_start(struct rte_eth_dev *dev) struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_dev_start(vf_dev->data->port_id); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -356,11 +348,11 @@ void hn_vf_stop(struct rte_eth_dev *dev) struct hn_data *hv = dev->data->dev_private; struct rte_eth_dev *vf_dev; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) rte_eth_dev_stop(vf_dev->data->port_id); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); } /* If VF is present, then cascade configuration down */ @@ -368,11 +360,11 @@ void hn_vf_stop(struct rte_eth_dev *dev) { \ struct hn_data *hv = (dev)->data->dev_private; \ struct rte_eth_dev *vf_dev; \ - rte_spinlock_lock(&hv->vf_lock); \ + rte_rwlock_read_lock(&hv->vf_lock); \ vf_dev = hn_get_vf_dev(hv); \ if (vf_dev) \ func(vf_dev->data->port_id); \ - rte_spinlock_unlock(&hv->vf_lock); \ + rte_rwlock_read_unlock(&hv->vf_lock); \ } /* If VF is present, then cascade configuration down */ @@ -381,11 +373,11 @@ void hn_vf_stop(struct rte_eth_dev *dev) struct hn_data *hv = (dev)->data->dev_private; \ struct rte_eth_dev *vf_dev; \ int ret = 0; \ - rte_spinlock_lock(&hv->vf_lock); \ + rte_rwlock_read_lock(&hv->vf_lock); \ vf_dev = hn_get_vf_dev(hv); \ if (vf_dev) \ ret = func(vf_dev->data->port_id); \ - rte_spinlock_unlock(&hv->vf_lock); \ + rte_rwlock_read_unlock(&hv->vf_lock); \ return ret; \ } @@ -399,13 +391,13 @@ void hn_vf_close(struct rte_eth_dev *dev) struct hn_data *hv = dev->data->dev_private; uint16_t vf_port; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_port = hv->vf_port; if (vf_port != HN_INVALID_PORT) rte_eth_dev_close(vf_port); hv->vf_port = HN_INVALID_PORT; - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); } int hn_vf_stats_reset(struct rte_eth_dev *dev) @@ -441,12 +433,12 @@ int hn_vf_mc_addr_list(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_dev_set_mc_addr_list(vf_dev->data->port_id, mc_addr_set, nb_mc_addr); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -459,13 +451,13 @@ int hn_vf_tx_queue_setup(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_tx_queue_setup(vf_dev->data->port_id, queue_idx, nb_desc, socket_id, tx_conf); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -473,7 +465,7 @@ void hn_vf_tx_queue_release(struct hn_data *hv, uint16_t queue_id) { struct rte_eth_dev *vf_dev; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->tx_queue_release) { void *subq = vf_dev->data->tx_queues[queue_id]; @@ -481,7 +473,7 @@ void hn_vf_tx_queue_release(struct hn_data *hv, uint16_t queue_id) (*vf_dev->dev_ops->tx_queue_release)(subq); } - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); } int hn_vf_rx_queue_setup(struct rte_eth_dev *dev, @@ -494,13 +486,13 @@ int hn_vf_rx_queue_setup(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_rx_queue_setup(vf_dev->data->port_id, queue_idx, nb_desc, socket_id, rx_conf, mp); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -508,14 +500,14 @@ void hn_vf_rx_queue_release(struct hn_data *hv, uint16_t queue_id) { struct rte_eth_dev *vf_dev; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->rx_queue_release) { void *subq = vf_dev->data->rx_queues[queue_id]; (*vf_dev->dev_ops->rx_queue_release)(subq); } - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); } int hn_vf_stats_get(struct rte_eth_dev *dev, @@ -525,11 +517,11 @@ int hn_vf_stats_get(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_stats_get(vf_dev->data->port_id, stats); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -541,12 +533,12 @@ int hn_vf_xstats_get_names(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int i, count = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) count = rte_eth_xstats_get_names(vf_dev->data->port_id, names, n); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); /* add vf_ prefix to xstat names */ if (names) { @@ -570,12 +562,12 @@ int hn_vf_xstats_get(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int i, count = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) count = rte_eth_xstats_get(vf_dev->data->port_id, xstats + offset, n - offset); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); /* Offset id's for VF stats */ if (count > 0) { @@ -592,13 +584,13 @@ int hn_vf_xstats_reset(struct rte_eth_dev *dev) struct rte_eth_dev *vf_dev; int ret; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev) ret = rte_eth_xstats_reset(vf_dev->data->port_id); else ret = -EINVAL; - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -610,11 +602,11 @@ int hn_vf_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->rss_hash_update) ret = vf_dev->dev_ops->rss_hash_update(vf_dev, rss_conf); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } @@ -627,12 +619,12 @@ int hn_vf_reta_hash_update(struct rte_eth_dev *dev, struct rte_eth_dev *vf_dev; int ret = 0; - rte_spinlock_lock(&hv->vf_lock); + rte_rwlock_read_lock(&hv->vf_lock); vf_dev = hn_get_vf_dev(hv); if (vf_dev && vf_dev->dev_ops->reta_update) ret = vf_dev->dev_ops->reta_update(vf_dev, reta_conf, reta_size); - rte_spinlock_unlock(&hv->vf_lock); + rte_rwlock_read_unlock(&hv->vf_lock); return ret; } From patchwork Thu Apr 30 19:08:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69634 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65813A046B; Thu, 30 Apr 2020 21:10:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C12CF1DC05; Thu, 30 Apr 2020 21:09:16 +0200 (CEST) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id CE9221DBD2 for ; Thu, 30 Apr 2020 21:09:10 +0200 (CEST) Received: by mail-pj1-f67.google.com with SMTP id a7so1184073pju.2 for ; Thu, 30 Apr 2020 12:09:10 -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 :mime-version:content-transfer-encoding; bh=SYVPClk50VHw4w/TIB5gWngK2d+zI8GbigTwmXk3QTA=; b=eTck8MvKtY+pcpxBZ4BzdkypA3lzGMKTCpsAbZmJNIxxtZHNuVFFOAcCOzf+jWROem msdpxxb58UITvXOQ4Pll8wZJSGaRIKje1BiWgjR1JaqCCnax/7hpgy1qTjq9MbVy911b 11mom9J+qS6uFoVz9AKAGbj9vSerT1ghKF29KEbXGgDfK0SE5UIVLnwHYL+sbwVU2L5Z KBfEb7vYJsGovYqO8P8VTSvjzTLWmOSG3StZDbPwVH4W7LFj8DC3Ac7FKwj7XLChmFCt 66Szo+M8JAKOlQ4U5yfUxVLIMx3/QK4+H6s4UWbSbthfrFjI6HU2H2zq200PemrwVyyF mQlQ== 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:mime-version:content-transfer-encoding; bh=SYVPClk50VHw4w/TIB5gWngK2d+zI8GbigTwmXk3QTA=; b=L23C7t2osRs2KI5LU+jXjOsFuQCmgJxzYGlLFDzhvxox5z6LD4DtoA54ddZb457ymq 7EVXOOFfIW1grB86BOBlWVSG82U0yb97utXwqN9KCaX5d1PZiUpRq7Nak+rxvmNu6WW7 tTEJwROwf9xanPaPeMKliifQXdrAPAvMr1VJDJZ31g5Mx6iT7OjTyEHjqhGS6bx1zWhx RJA1Ic840J7cPR6zfO5ITOfeDpJJUsIVdlexFxHmz/Dbb4/5sBElV/IDj+TnmyKFz6so FGp4M/SSsbya102Pzv5vcF8DED4aOvOmcwD6XB+93kUEXxko1dqgxGMRUNWM8rEb9jwa 4+fw== X-Gm-Message-State: AGi0PubqE5H7435Hrtchj55yR10suoz9Sbed5CNbbDojwfDCqDFVQSOs UNszdi9pgTxIuKjh/IqzKClyF0lZ67neAA== X-Google-Smtp-Source: APiQypLbvPySPMAkirIbcFX1ug66hTyfiU+/GYj7EgXPK/t4yZ8jf8RJSkymaJaknjlFWld0t/+lkA== X-Received: by 2002:a17:902:a586:: with SMTP id az6mr438796plb.201.1588273749509; Thu, 30 Apr 2020 12:09:09 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:52 -0700 Message-Id: <20200430190853.498-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 6/7] net/netvsc: do RSS across rx queue only 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" If number of tx queues is greater than the number of rx queues; the driver ends up allocating more channels than rx queues. The problem is that the RSS indirection table is programed such that some packets will end up on a channel that would never be polled. The fix is to limit the RSS indirection table by number of rx queues not channels. Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters") Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 7bf5465ce5e7..60102362e124 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -575,7 +575,7 @@ static int hn_dev_configure(struct rte_eth_dev *dev) dev->data->nb_tx_queues); for (i = 0; i < NDIS_HASH_INDCNT; i++) - hv->rss_ind[i] = i % hv->num_queues; + hv->rss_ind[i] = i % dev->data->nb_rx_queues; hn_rss_hash_init(hv, rss_conf); From patchwork Thu Apr 30 19:08:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 69635 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EAB79A046B; Thu, 30 Apr 2020 21:10:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B46DF1DC0A; Thu, 30 Apr 2020 21:09:21 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 459091DBD9 for ; Thu, 30 Apr 2020 21:09:12 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id 145so275845pfw.13 for ; Thu, 30 Apr 2020 12:09:12 -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 :mime-version:content-transfer-encoding; bh=M/AtJFQOHA13YLupaTRevoU1bj/pruCWydpA7Uao0XY=; b=H/rBOXjn5cBIyYof0DoNzw0nr7dKA+7XdyomCagp6eLOgjrTeMBsemCP96GPfIDzul 6H9PS7veBmxgWyde1wjZIXoT7Wvwdc1ct2pJjMINytKegs/dBZBE1t0MPFoVGkub9v7y USoTDQKFTed7YpO6SYbzI3WjP7NoPtwo5YJDE/Ghvgei6fc5l/nAu/VjVrVkNs3fynLl WU4fTJrvzuN+FiC01HscnNjNjWxi1fGRLlKz9hKZcrV8A2/XY5pcAKW8x4k5rGUZKzhI YeKmxS5x3qhk6QHUpGEMkNfmuNe34IPbtyZWB93udKYOvwjx2URDAc+sjJBtc55SSyAj 2aUQ== 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:mime-version:content-transfer-encoding; bh=M/AtJFQOHA13YLupaTRevoU1bj/pruCWydpA7Uao0XY=; b=Nhi3rAW9PiIrxvbhQoyQrSGkOlEQ/jXlWhCEgDCNzxRR+o9wes86iewhrpJO2ic0yt knziv7MvRhyF/FpXwAoihY9dgMC55kOuzD9hJxG81mtVxUJm6cxY/OgiQzcvqybe2yGy LEhSsPTvOxKHzSCnekI5nSZuYfJ4RPpZfItmWTrStlTcB9Bsb4WT8WfNuUS2LgGvGEsC UdPlav2gmHqu4Vmb5RPG9TxKuTJ/dTkR4TUpAMN9BVY25qHhy5nKGcl6+yhJLM1ARWEF yTV52PoTUduPzbaTc4duyyevyTOntKvivxiLmnR9n1T+j+xLO80YVfdqROESR8JSMVji 2omw== X-Gm-Message-State: AGi0Puad9orhkfb7nRGaKBtWyY6Dk1kvzS4T3AY4AB+3GxxisuqaQO4Y Ik5IC3e3htAFJ9VyE3YuWM/NAy45q5vhWg== X-Google-Smtp-Source: APiQypKCqJVMmc4qVe8ZCRE8/PqOVeOy6w0kqOWTFqpnk/VpBaIbBHclLe5MtkrIwSaKeIoGpcbUyQ== X-Received: by 2002:aa7:81cf:: with SMTP id c15mr190190pfn.211.1588273751082; Thu, 30 Apr 2020 12:09:11 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fy21sm452075pjb.25.2020.04.30.12.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 12:09:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Apr 2020 12:08:53 -0700 Message-Id: <20200430190853.498-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430190853.498-1-stephen@networkplumber.org> References: <20200430190853.498-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 7/7] net/netvsc: don't configure RSS if disabled 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" This fixes the problem where driver would not start if only have a single Rx queue and multiple Txq. In that case, RSS should stay disabled. Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters") Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 60102362e124..55b8a63804a9 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -376,14 +376,15 @@ static int hn_rss_hash_update(struct rte_eth_dev *dev, hn_rss_hash_init(hv, rss_conf); - err = hn_rndis_conf_rss(hv, 0); - if (err) { - PMD_DRV_LOG(NOTICE, - "rss reconfig failed (RSS disabled)"); - return err; + if (rss_conf->rss_hf != 0) { + err = hn_rndis_conf_rss(hv, 0); + if (err) { + PMD_DRV_LOG(NOTICE, + "rss reconfig failed (RSS disabled)"); + return err; + } } - return hn_vf_rss_hash_update(dev, rss_conf); } @@ -595,11 +596,13 @@ static int hn_dev_configure(struct rte_eth_dev *dev) return err; } - err = hn_rndis_conf_rss(hv, 0); - if (err) { - PMD_DRV_LOG(NOTICE, - "initial RSS config failed"); - return err; + if (rss_conf->rss_hf != 0) { + err = hn_rndis_conf_rss(hv, 0); + if (err) { + PMD_DRV_LOG(NOTICE, + "initial RSS config failed"); + return err; + } } }