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 EC1C0A0C47; Thu, 19 Aug 2021 07:45:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DDE74115E; Thu, 19 Aug 2021 07:45:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B63A040141; Thu, 19 Aug 2021 07:45:25 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10080"; a="216485296" X-IronPort-AV: E=Sophos;i="5.84,333,1620716400"; d="scan'208";a="216485296" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 22:45:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,333,1620716400"; d="scan'208";a="678998555" Received: from dpdk-xuanding-dev2.sh.intel.com ([10.67.119.115]) by fmsmga006.fm.intel.com with ESMTP; 18 Aug 2021 22:45:21 -0700 From: Xuan Ding To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com, Xuan Ding , stable@dpdk.org, yong.liu@intel.com Date: Thu, 19 Aug 2021 05:35:18 +0000 Message-Id: <20210819053518.106296-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/virtio: fix indirect descriptors reconnection 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 Sender: "dev" Since packed indirect descriptors are added and initialized when initializing vring, the reconnection path also needs to be considered. Fixes: 381f39ebb78a ("net/virtio: fix packed ring indirect descricptors setup") Cc: stable@dpdk.org Cc: yong.liu@intel.com Signed-off-by: Xuan Ding --- drivers/net/virtio/virtqueue.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c index 1f9af3c31b..47229f35c4 100644 --- a/drivers/net/virtio/virtqueue.c +++ b/drivers/net/virtio/virtqueue.c @@ -208,6 +208,20 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq) rte_pktmbuf_free(dxp->cookie); dxp->cookie = NULL; } + + struct virtio_tx_region *txr; + txr = txvq->virtio_net_hdr_mz->addr; + /* first indirect descriptor is always the tx header */ + struct vring_packed_desc *start_dp = + txr[desc_idx].tx_packed_indir; + vring_desc_init_indirect_packed(start_dp, + RTE_DIM(txr[desc_idx].tx_packed_indir)); + start_dp->addr = txvq->virtio_net_hdr_mem + + desc_idx * sizeof(*txr) + + offsetof(struct virtio_tx_region, + tx_hdr); + start_dp->len = vq->hw->vtnet_hdr_size; + } vring_desc_init_packed(vq, size); -- 2.17.1