From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9BD1CA0508; Wed, 13 Apr 2022 10:13:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D56AE42858; Wed, 13 Apr 2022 10:11:50 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 779EF4285A for ; Wed, 13 Apr 2022 10:11:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649837509; x=1681373509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vx3KvaMnEFzaeQ20Xa1BkP9Xre0h7AyMATPkcVMuFNY=; b=C6RWu+HFl9qh+KJvRAjve3cb7FcYjXB/mFnvuqsfw53yi/MmXwxG+fhN Tld8AqWrWXkxv4TquyVDHFpcZqvn+WWd5Rwmnf7hwG7u6vwTjPtP0CYS0 r6q2K3ZYrIvQ/1eoEwQ46Cvo87Y97LmLuEDp02ZwDz/ADcLoI73fHfqfm o2rcSmS3nkwbWoCttK2u5t5dRF0EvlVXbGvTbcN43yplZqC9v6ewDDyEB I/1wUmVfgLCgcc64OO+7sms/IRbGGLq3DLkMb+G9/AnFYuXKU/4XpjzR/ Wlbk7pas6p8hiM+g3KAQHAJZ9mS5BXGkeVy/AvisQYJt25OunaHLfIVhd A==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="287630101" X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="287630101" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 01:11:48 -0700 X-IronPort-AV: E=Sophos;i="5.90,256,1643702400"; d="scan'208";a="526847862" Received: from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 01:11:46 -0700 From: Kevin Liu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Kevin Liu Subject: [PATCH v2 25/33] net/ice: handle virtchnl event message without interrupt Date: Wed, 13 Apr 2022 16:09:24 +0000 Message-Id: <20220413160932.2074781-26-kevinx.liu@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220413160932.2074781-1-kevinx.liu@intel.com> References: <20220407105706.18889-1-kevinx.liu@intel.com> <20220413160932.2074781-1-kevinx.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Steve Yang Currently, VF can only handle virtchnl event message by calling interrupt. It is not available in two cases: 1. If the event message comes during VF initialization before interrupt is enabled, this message will not be handled correctly. 2. Some virtchnl commands need to receive the event message and handle it with interrupt disabled. To solve this issue, we add the virtchnl event message handling in the process of reading vitchnl messages in adminq from PF. Signed-off-by: Steve Yang Signed-off-by: Kevin Liu --- drivers/net/ice/ice_dcf.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 9c2f13cf72..1415f26ac3 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -63,11 +63,32 @@ ice_dcf_recv_cmd_rsp_no_irq(struct ice_dcf_hw *hw, enum virtchnl_ops op, goto again; v_op = rte_le_to_cpu_32(event.desc.cookie_high); - if (v_op != op) - goto again; + + if (v_op == VIRTCHNL_OP_EVENT) { + struct virtchnl_pf_event *vpe = + (struct virtchnl_pf_event *)event.msg_buf; + switch (vpe->event) { + case VIRTCHNL_EVENT_RESET_IMPENDING: + hw->resetting = true; + if (rsp_msglen) + *rsp_msglen = 0; + return IAVF_SUCCESS; + default: + goto again; + } + } else { + /* async reply msg on command issued by vf previously */ + if (v_op != op) { + PMD_DRV_LOG(WARNING, + "command mismatch, expect %u, get %u", + op, v_op); + goto again; + } + } if (rsp_msglen != NULL) *rsp_msglen = event.msg_len; + return rte_le_to_cpu_32(event.desc.cookie_low); again: -- 2.33.1