From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 140D6A04F0 for ; Thu, 19 Dec 2019 15:40:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDEB71BF7B; Thu, 19 Dec 2019 15:40:13 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id D0F391BF7B for ; Thu, 19 Dec 2019 15:40:12 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id q10so6208273wrm.11 for ; Thu, 19 Dec 2019 06:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m896e0DpwB4LWpuJEKy1Z0vNkLlqlPrOGb+XoLjXZ6c=; b=b9dLkyPLqFHZYLnb5o+7QebrGI6X4JpD2mx7cT9o8hVeo2ADkWVYcl6DTKcociMOoa fmMa1z1UR5dsoXjgRCRPYTVOs8gEy72I59Im1hIucWvaF/VwDFVXdpA/elhrMMLATJyM 1Gp5+K+I57SS5UDulQYIdSJUImDrC3rt3O7MDMbvuIj8L11a0UrUjWqIh/jOz5cyFRoz K8p6/K76hiQkLZu5R3ekf7z3HmZaMy3ODavYS9AV/rqiaoIUSXkZxJThFPXYqJlhv7X0 b08Hh77U6E2O9SPNgNKP9P13yRW6kPSvEP02A0w4LtgvMixnEtk5HZeWMrhLxBqBcJtj mK1Q== 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=m896e0DpwB4LWpuJEKy1Z0vNkLlqlPrOGb+XoLjXZ6c=; b=dFy9E1sr55jzh8srUId2n/ydfjBEl+JnQlGfW67J0bwe3gqLfLPXYqWmF/B1dnITP8 M2X9Z1H6kwi8vRLqB371ScPYpO8fenWDFggoFQiOi6wGsanVWi4mGH8yv69MF+NTUVX2 eZuPDp2rS2czD784vlwYVnxFR7ivKhfiCYC5D5e8maPT+NnF3JkH8xLZCBiHFKObQB7w qIwmhH7U38A/5KmKLQ3iu1Ko3/u0rnpHfi/JZKRL147MmSAu8MvLYrUuCIsWC3UY2lTu Urmqm3kXmUFldqPP8pkvfwJLc4spqaFLk19cEd8G2Bx5gm3WWbhQHuCLTPmVOfhcwc6+ O95Q== X-Gm-Message-State: APjAAAV89NgGMUouYEn9sGk7n7yJ2AOecMEzHRBYbCshQ5x+3ddxed7G kITe4uym2PTS8iuTDdcGQiw= X-Google-Smtp-Source: APXvYqyl4IDXb+JdiqBgVRPU9J+izuuNWqlMG9eW1urvKwdWi8vNoxLogsck6kObtb8DN1lS7lkAjw== X-Received: by 2002:adf:f508:: with SMTP id q8mr9824824wro.334.1576766412396; Thu, 19 Dec 2019 06:40:12 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:7a8e:ed70:5c52:ea3]) by smtp.gmail.com with ESMTPSA id q68sm7467106wme.14.2019.12.19.06.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:40:11 -0800 (PST) From: luca.boccassi@gmail.com To: Andrew Rybchenko Cc: Tiwei Bie , Maxime Coquelin , dpdk stable Date: Thu, 19 Dec 2019 14:33:58 +0000 Message-Id: <20191219143447.21506-91-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/virtio: fix Tx checksum offloads' has been queued to LTS release 17.11.10 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 204911c5871177ab7f8148dcd26557af0450a41b Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 24 Oct 2019 18:46:09 +0100 Subject: [PATCH] net/virtio: fix Tx checksum offloads [ upstream commit 1526dd05328a97ebe77cf86cbf05edfa5ff17963 ] Missing parenthesis around expression before type cast to struct virtio_net_hdr pointer makes the arithmetic to be in sizeof(struct virtio_net_hdr) units. Use rte_pktmbuf_mtod_offset() to fix the problem. Type of head_size is changed to signed since some compilers bark on unary minus applied to unsigned. Fixes: 1ae55ad38e5e ("net/virtio: fix mbuf data and packet length mismatch") Signed-off-by: Andrew Rybchenko Reviewed-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 2d00a9444e..cea097a9db 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -283,7 +283,7 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, struct vring_desc *start_dp; uint16_t seg_num = cookie->nb_segs; uint16_t head_idx, idx; - uint16_t head_size = vq->hw->vtnet_hdr_size; + int16_t head_size = vq->hw->vtnet_hdr_size; struct virtio_net_hdr *hdr; int offload; bool prepend_header = false; @@ -299,8 +299,8 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, if (can_push) { /* prepend cannot fail, checked by caller */ - hdr = (struct virtio_net_hdr *)(char *)cookie->buf_addr + - cookie->data_off - head_size; + hdr = rte_pktmbuf_mtod_offset(cookie, struct virtio_net_hdr *, + -head_size); prepend_header = true; /* if offload disabled, it is not zeroed below, do it now */ if (offload == 0) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:29.966229385 +0000 +++ 0091-net-virtio-fix-Tx-checksum-offloads.patch 2019-12-19 14:32:26.217300046 +0000 @@ -1,8 +1,10 @@ -From 1526dd05328a97ebe77cf86cbf05edfa5ff17963 Mon Sep 17 00:00:00 2001 +From 204911c5871177ab7f8148dcd26557af0450a41b Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 24 Oct 2019 18:46:09 +0100 Subject: [PATCH] net/virtio: fix Tx checksum offloads +[ upstream commit 1526dd05328a97ebe77cf86cbf05edfa5ff17963 ] + Missing parenthesis around expression before type cast to struct virtio_net_hdr pointer makes the arithmetic to be in sizeof(struct virtio_net_hdr) units. @@ -13,99 +15,38 @@ on unary minus applied to unsigned. Fixes: 1ae55ad38e5e ("net/virtio: fix mbuf data and packet length mismatch") -Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko Reviewed-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- - drivers/net/virtio/virtio_rxtx.c | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) + drivers/net/virtio/virtio_rxtx.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c -index 0959250a33..752faa0f6e 100644 +index 2d00a9444e..cea097a9db 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c -@@ -635,7 +635,7 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq, - struct vring_desc *start_dp; - struct virtio_net_hdr *hdr; - uint16_t idx; -- uint16_t head_size = vq->hw->vtnet_hdr_size; -+ int16_t head_size = vq->hw->vtnet_hdr_size; - uint16_t i = 0; - - idx = vq->vq_desc_head_idx; -@@ -648,8 +648,8 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq, - dxp->ndescs = 1; - virtio_update_packet_stats(&txvq->stats, cookies[i]); - -- hdr = (struct virtio_net_hdr *)(char *)cookies[i]->buf_addr + -- cookies[i]->data_off - head_size; -+ hdr = rte_pktmbuf_mtod_offset(cookies[i], -+ struct virtio_net_hdr *, -head_size); - - /* if offload disabled, hdr is not zeroed yet, do it now */ - if (!vq->hw->has_tx_offload) -@@ -682,7 +682,7 @@ virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq, - struct vring_packed_desc *dp; - struct vq_desc_extra *dxp; - uint16_t idx, id, flags; -- uint16_t head_size = vq->hw->vtnet_hdr_size; -+ int16_t head_size = vq->hw->vtnet_hdr_size; - struct virtio_net_hdr *hdr; - - id = in_order ? vq->vq_avail_idx : vq->vq_desc_head_idx; -@@ -696,8 +696,8 @@ virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq, - flags = vq->vq_packed.cached_flags; - - /* prepend cannot fail, checked by caller */ -- hdr = (struct virtio_net_hdr *)(char *)cookie->buf_addr + -- cookie->data_off - head_size; -+ hdr = rte_pktmbuf_mtod_offset(cookie, struct virtio_net_hdr *, -+ -head_size); - - /* if offload disabled, hdr is not zeroed yet, do it now */ - if (!vq->hw->has_tx_offload) -@@ -734,7 +734,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie, - struct virtqueue *vq = txvq->vq; - struct vring_packed_desc *start_dp, *head_dp; - uint16_t idx, id, head_idx, head_flags; -- uint16_t head_size = vq->hw->vtnet_hdr_size; -+ int16_t head_size = vq->hw->vtnet_hdr_size; - struct virtio_net_hdr *hdr; - uint16_t prev; - bool prepend_header = false; -@@ -756,8 +756,8 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie, - - if (can_push) { - /* prepend cannot fail, checked by caller */ -- hdr = (struct virtio_net_hdr *)(char *)cookie->buf_addr + -- cookie->data_off - head_size; -+ hdr = rte_pktmbuf_mtod_offset(cookie, struct virtio_net_hdr *, -+ -head_size); - prepend_header = true; - - /* if offload disabled, it is not zeroed below, do it now */ -@@ -832,7 +832,7 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, +@@ -283,7 +283,7 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, struct vring_desc *start_dp; uint16_t seg_num = cookie->nb_segs; uint16_t head_idx, idx; - uint16_t head_size = vq->hw->vtnet_hdr_size; + int16_t head_size = vq->hw->vtnet_hdr_size; - bool prepend_header = false; struct virtio_net_hdr *hdr; - -@@ -849,8 +849,8 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, + int offload; + bool prepend_header = false; +@@ -299,8 +299,8 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie, if (can_push) { /* prepend cannot fail, checked by caller */ - hdr = (struct virtio_net_hdr *)(char *)cookie->buf_addr + - cookie->data_off - head_size; + hdr = rte_pktmbuf_mtod_offset(cookie, struct virtio_net_hdr *, -+ -head_size); ++ -head_size); prepend_header = true; - /* if offload disabled, it is not zeroed below, do it now */ + if (offload == 0) { -- 2.20.1