[dpdk-stable] patch 'net/qede/base: fix for VF malicious indication' has been queued to LTS release 16.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 30 16:34:51 CET 2017


Hi,

FYI, your patch has been queued to LTS release 16.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/01/17. So please
shout if anyone has objections.

Thanks.

Kind regards,
Luca Boccassi

---
>From 8bb1056d29df9a6e1a85149da3924e9c8f024b4a Mon Sep 17 00:00:00 2001
From: Rasesh Mody <rasesh.mody at cavium.com>
Date: Fri, 6 Oct 2017 23:31:10 -0700
Subject: [PATCH] net/qede/base: fix for VF malicious indication

[ upstream commit eb35c732fe7c82dbf4b1115030e75a7d212350b8 ]

IOV regression testing led to discovery of a minor issue + possibly race
in IOV flows:
 a. Malicious indications in VF-database on PF-side get cleared during
    FLR flows - but not when disabling SRIOV. At least in Linux if you
    disable IOV while having a malicious VF you wouldn't be able to
    clear the indication as driver would prevent from initializing it.
 b. Possible race during PF response to VF - the channel is made ready
    only after sending the rc via dmae to VF. It's possible due to
    context switch at end of DMAE [when releasing Mutex] that VF would
    start running and send another message prior to PF clearing the
    channel, making the FW consider that VF to be malicious.

This patch fixes that by
 - clearing the indication even if we're only going to disable VF
 - resetting the channel to ready before PF copies the rc to the VF, PF
   can then continue and send an additional message

Fixes: 47b302d64624 ("net/qede/base: add handling of malicious VF")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")

Signed-off-by: Rasesh Mody <rasesh.mody at cavium.com>
---
 drivers/net/qede/base/ecore_sriov.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index b28d72810..1e706654b 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -1214,13 +1214,17 @@ static void ecore_iov_send_response(struct ecore_hwfn *p_hwfn,
 			     (sizeof(union pfvf_tlvs) - sizeof(u64)) / 4,
 			     &params);
 
-	ecore_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys,
-			     mbx->req_virt->first_tlv.reply_address,
-			     sizeof(u64) / 4, &params);
-
+	/* Once PF copies the rc to the VF, the latter can continue and
+	 * and send an additional message. So we have to make sure the
+	 * channel would be re-set to ready prior to that.
+	 */
 	REG_WR(p_hwfn,
 	       GTT_BAR0_MAP_REG_USDM_RAM +
 	       USTORM_VF_PF_CHANNEL_READY_OFFSET(eng_vf_id), 1);
+
+	ecore_dmae_host2host(p_hwfn, p_ptt, mbx->reply_phys,
+			     mbx->req_virt->first_tlv.reply_address,
+			     sizeof(u64) / 4, &params);
 }
 
 static u16 ecore_iov_vport_to_tlv(struct ecore_hwfn *p_hwfn,
-- 
2.11.0



More information about the stable mailing list