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 AC7C6A034F for ; Tue, 7 Dec 2021 10:47:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85B564114F; Tue, 7 Dec 2021 10:47:09 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id A36184114F for ; Tue, 7 Dec 2021 10:47:08 +0100 (CET) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 623CF3F1B7 for ; Tue, 7 Dec 2021 09:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638870427; bh=25+l/14RtWn8UvKwS63sOV8tu7X5IGfA/U0+HqV7qUE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PDx0EgRo9yx41ZRgZfEj7Qx/zVTUH/UhWQk+4aFIcrK5TjJQFWn6YSfywpkJ++jH8 V9XyhyRAQNcreguQlXvJunq28p25Ekfknt91KOkatOkoeKrgjVz032ZWU/Og1Nmo1v I0Mt5I5Dg1JLO5EZzu1tNaeyUdt74mfJ0Tvm0OLOI37C5qT4DylEJ5zx7EQCG6jY4s XmUE35kOwACVggpri+EraYIjwFE5zfIMGHsvvHGx8VRC0L6jrY5BpYJW+fuRX/TigJ UhHIO1NOS4NUAd+mBhlOjnLrRZjHfp+VVCR90PmkniHHA+rJp7LchhM7XPIqFvb+tv V3FNfR7G0PG8A== Received: by mail-qk1-f197.google.com with SMTP id bk35-20020a05620a1a2300b0046d2a9b93dfso14833713qkb.16 for ; Tue, 07 Dec 2021 01:47:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=25+l/14RtWn8UvKwS63sOV8tu7X5IGfA/U0+HqV7qUE=; b=7TZvc9r84Rg8DhPt6mKv7nuCTYA+xMJMYsN2gZQ5qsceCoJrzLem7l72gFCfTAbKa9 5nsbucWdJlqaItIJY+brEWevIj6yvI/NsfMBU8mD14X/X41EFcW9+IkLr/f5V3Sl2lQC EuE36jr51s6Oh9d2sIDtBhyauq8cvRuign/PPDUBnmzI0Re931cPEo+kHLAgFgxVf2m0 jq2iSCgjGc9Y3QZUdox5BPQgZw2nCObwTlIl3Cmnk8uoB4ibHgckDv8gIPvNSfns4J6T T2ltRoM55BB56yGjhQ19N/K5Ru/bV8IikEPogZ4yQL+3mHyHvKEGnlW7DKtT6E8Go2+L Aj5Q== X-Gm-Message-State: AOAM530dz9Dijz4van7wnPM2aXuQ5z9PjOKPx+19EeK6EIRlvLRd+8fo 46fmMRj8s3gv8/hDMYn0yo3ZqwEae3+s9RnWMDAQEdWbrY62h37weimQeyzcyjKP26JXsDO3+bs vPMsnC89ERjciRB3eOZbpLqJz/Las86hbm5iuyvcE X-Received: by 2002:ac8:5aca:: with SMTP id d10mr48238759qtd.469.1638870425432; Tue, 07 Dec 2021 01:47:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBROsIWSp4o7rZjtGk4IGHC/3EZ7ERdZ6664fA06AnUWfoLCyeGg83dWEQzvGFlRBzjwFshiVmTHsDncUO4pk= X-Received: by 2002:ac8:5aca:: with SMTP id d10mr48238728qtd.469.1638870425216; Tue, 07 Dec 2021 01:47:05 -0800 (PST) MIME-Version: 1.0 References: <20211207165006.66790-1-xuan.ding@intel.com> In-Reply-To: <20211207165006.66790-1-xuan.ding@intel.com> From: Christian Ehrhardt Date: Tue, 7 Dec 2021 10:46:39 +0100 Message-ID: Subject: Re: [PATCH 19.11] net/virtio: fix indirect descriptor reconnection To: xuan.ding@intel.com Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, Dec 7, 2021 at 9:10 AM wrote: > > From: Xuan Ding > > [ upstream commit 04bcc80204db16ca77d1dd11a6ea1773214cc755 ] Thank you, applied > Add initialization for packed ring indirect descriptors > in reconnection path. > > Fixes: 8c1df8846b15 ("net/virtio: fix packed ring indirect descricptors setup") > > Signed-off-by: Xuan Ding > Tested-by: Yinan Wang > Reviewed-by: Maxime Coquelin > --- > 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 02c8b9fc5..8195aaa8c 100644 > --- a/drivers/net/virtio/virtqueue.c > +++ b/drivers/net/virtio/virtqueue.c > @@ -185,6 +185,8 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq) > struct vq_desc_extra *dxp; > struct virtnet_tx *txvq; > uint16_t desc_idx; > + struct virtio_tx_region *txr; > + struct vring_packed_desc *start_dp; > > vq->vq_used_cons_idx = 0; > vq->vq_desc_head_idx = 0; > @@ -197,6 +199,7 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq) > vq->vq_packed.event_flags_shadow = 0; > > txvq = &vq->txq; > + txr = txvq->virtio_net_hdr_mz->addr; > memset(txvq->mz->addr, 0, txvq->mz->len); > memset(txvq->virtio_net_hdr_mz->addr, 0, > txvq->virtio_net_hdr_mz->len); > @@ -207,6 +210,17 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq) > rte_pktmbuf_free(dxp->cookie); > dxp->cookie = NULL; > } > + > + if (vtpci_with_feature(vq->hw, VIRTIO_RING_F_INDIRECT_DESC)) { > + /* first indirect descriptor is always the tx header */ > + 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 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd