From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 5A51B239 for ; Mon, 15 Oct 2018 13:52:20 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id y16so20976887wrw.3 for ; Mon, 15 Oct 2018 04:52:20 -0700 (PDT) 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=P9kHt78doDWKBTOV4vf5JqpW6tof4NnSaq6nNvCq8mw=; b=qrUJ29lv1gxfzgdx5DhvCZEzxSesyww9hElFNFPnTVplpQx/JbdG9sCh+0OYMifZqa S3E8FsqgGd9t1EHBrtkwjRrYKljAKeMexwgjZX7+UfXPQ2ctFqHtA04IT3T5jl5NAMq2 HxXy9NCrPheySVIGF59AAHT3/JvLFGVoP+a/Aog99tq4lC7Y5H9N182d9bt+FfdUEbJG wqIyqYQp9b0fRwC5kIR+XRcitWV9bBHfHntcPn0CpDTjC/F7XYqE8BGp5jnpXoLtN8Di EzmxzmTLKqv2sl9ZGQy1GxfZHvCOhwxclPwP2orF42cuv/KQZtFGZdJ4SKxKg1qwOxE9 REOQ== X-Gm-Message-State: ABuFfoj2dVZe1exg8KGsLV+pMqgUOSutP/lSeFdPB7Jon3lmc6JnjlGG NCGYm8ftZqVNJfqAUshXmI3xhSi5 X-Google-Smtp-Source: ACcGV60BHaNctaNxEcQbO83TydwcQl4f19sbSprPJHOiuZFUoHAIICDTTi3OM5lNqhvGjVcMGnZaEQ== X-Received: by 2002:a5d:438e:: with SMTP id i14-v6mr15253871wrq.156.1539604340004; Mon, 15 Oct 2018 04:52:20 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id b8-v6sm6953461wme.1.2018.10.15.04.52.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 04:52:19 -0700 (PDT) From: Luca Boccassi To: Ajit Khaparde Cc: dpdk stable Date: Mon, 15 Oct 2018 12:51:36 +0100 Message-Id: <20181015115144.27626-16-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181015115144.27626-1-bluca@debian.org> References: <20181003162121.16364-1-bluca@debian.org> <20181015115144.27626-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: set a VNIC as default only once' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 11:52:20 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/17/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 83b150cc0296971f1fb8e1e93165771891f8dca1 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Fri, 28 Sep 2018 19:00:03 -0700 Subject: [PATCH] net/bnxt: set a VNIC as default only once [ upstream commit 5bf10cdb67db5ee7308cc752b51f0f12dcdcb0e8 ] If a vnic is configured as default and the setting has not changed, there is no need to issue this setting again to the FW. Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_hwrm.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index b934605efa..dc867b12e8 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -132,6 +132,7 @@ struct bnxt { uint32_t flags; #define BNXT_FLAG_REGISTERED (1 << 0) #define BNXT_FLAG_VF (1 << 1) +#define BNXT_FLAG_DFLT_VNIC_SET (1 << 12) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) #define BNXT_NPAR_ENABLED(bp) ((bp)->port_partition_type) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index f4e4e23fcd..b86a7e227f 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -900,8 +900,11 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic) req.lb_rule = rte_cpu_to_le_16(0xffff); req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE); - if (vnic->func_default) + /* Configure default VNIC only once. */ + if (vnic->func_default && !(bp->flags & BNXT_FLAG_DFLT_VNIC_SET)) { req.flags = 1; + bp->flags |= BNXT_FLAG_DFLT_VNIC_SET; + } if (vnic->vlan_strip) req.flags |= rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE); @@ -978,6 +981,10 @@ int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic) HWRM_CHECK_RESULT; vnic->fw_vnic_id = INVALID_HW_RING_ID; + /* Configure default VNIC again if necessary. */ + if (vnic->func_default && (bp->flags & BNXT_FLAG_DFLT_VNIC_SET)) + bp->flags &= ~BNXT_FLAG_DFLT_VNIC_SET; + return rc; } -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-15 12:48:35.019644089 +0100 +++ 0016-net-bnxt-set-a-VNIC-as-default-only-once.patch 2018-10-15 12:48:34.577096017 +0100 @@ -1,13 +1,14 @@ -From 5bf10cdb67db5ee7308cc752b51f0f12dcdcb0e8 Mon Sep 17 00:00:00 2001 +From 83b150cc0296971f1fb8e1e93165771891f8dca1 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Fri, 28 Sep 2018 19:00:03 -0700 Subject: [PATCH] net/bnxt: set a VNIC as default only once +[ upstream commit 5bf10cdb67db5ee7308cc752b51f0f12dcdcb0e8 ] + If a vnic is configured as default and the setting has not changed, there is no need to issue this setting again to the FW. Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure") -Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- @@ -16,37 +17,36 @@ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h -index 75b7215ce4..f75b0ad3c5 100644 +index b934605efa..dc867b12e8 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h -@@ -261,6 +261,7 @@ struct bnxt { - #define BNXT_FLAG_EXT_TX_PORT_STATS (1 << 9) - #define BNXT_FLAG_KONG_MB_EN (1 << 10) - #define BNXT_FLAG_TRUSTED_VF_EN (1 << 11) +@@ -132,6 +132,7 @@ struct bnxt { + uint32_t flags; + #define BNXT_FLAG_REGISTERED (1 << 0) + #define BNXT_FLAG_VF (1 << 1) +#define BNXT_FLAG_DFLT_VNIC_SET (1 << 12) - #define BNXT_FLAG_NEW_RM (1 << 30) - #define BNXT_FLAG_INIT_DONE (1 << 31) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) + #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) + #define BNXT_NPAR_ENABLED(bp) ((bp)->port_partition_type) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index b605659edb..38698e214c 100644 +index f4e4e23fcd..b86a7e227f 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c -@@ -1460,9 +1460,12 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic) - req.cos_rule = rte_cpu_to_le_16(vnic->cos_rule); - req.lb_rule = rte_cpu_to_le_16(vnic->lb_rule); - req.mru = rte_cpu_to_le_16(vnic->mru); +@@ -900,8 +900,11 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic) + req.lb_rule = rte_cpu_to_le_16(0xffff); + req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + + ETHER_CRC_LEN + VLAN_TAG_SIZE); - if (vnic->func_default) + /* Configure default VNIC only once. */ + if (vnic->func_default && !(bp->flags & BNXT_FLAG_DFLT_VNIC_SET)) { - req.flags |= - rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT); + req.flags = 1; + bp->flags |= BNXT_FLAG_DFLT_VNIC_SET; + } if (vnic->vlan_strip) req.flags |= rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE); -@@ -1600,6 +1603,10 @@ int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic) - HWRM_UNLOCK(); +@@ -978,6 +981,10 @@ int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic) + HWRM_CHECK_RESULT; vnic->fw_vnic_id = INVALID_HW_RING_ID; + /* Configure default VNIC again if necessary. */