From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id E391C276C for ; Sat, 15 Jul 2017 13:18:13 +0200 (CEST) Received: by mail-pf0-f194.google.com with SMTP id e199so13910378pfh.0 for ; Sat, 15 Jul 2017 04:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OEjroFli7yvqMEAqwgE3o0Yw9FWcBn5NCTcGwmECpL8=; b=HRWdxQuLoyfhDZXsuNpnK7PJ5fMOIvM2swTjwerP92sudSx4O3gyXKLPz33XwXnube lZO/34nwyPRNBt3EGlfII6Vfjp9Ns/RFJ8uE+srkujVMqTDCXsKb3gsP97JUr+BgGsB6 ug7UZ3G7hpn16Chsf+hy/QJlwI9PPz1L9C3wNpy1EC3ntjXKrga8cYK7zL55Dnv+ELdK mYFzKRReikEFo/VG1p11hQ67CcjI5CSYyC2/N/UmhoKx6Dvjxupg48S5kVUTsxme3Wj/ d+ID9P3aU2NK9j24TmJVWmn/HhygLjsdjuMEpzF92mhUENIF+3CT9Ec17z5yzasA7ypA eNNA== 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; bh=OEjroFli7yvqMEAqwgE3o0Yw9FWcBn5NCTcGwmECpL8=; b=kQsJBS8YDeyOHlavXmYyN4kBVn+GA53lIjHhGbunTLZjd5WDutnFNWpADnnIwdeceV RMTXmRVlEHuS/z1QgZyQKRjCtHJeheKRfvxrLlLPXuKfRLSLVaGu304TEK8lNDArmdwk yKoEw9TarWZsIzc/iOpVGyRofvKBgJqb56f53b2BAVda2hST93eOVSLJKG3MEYsyYzpT sir/BKEs2ehlfmnN7G1xR+1e3mwsqSBjbobXS2S/dzZCvptE1C0BonmbV9ywabV53vrS igx9oyPmCp/7Cz5/h8tNpzQ47hIISmQTRUoaYeONosszqPRNUGK3znzGCuYbudqtzjxJ azGg== X-Gm-Message-State: AIVw110C7gygSiRJnLMsrYInH9lwoMl23iCgM3VuV4xsXiwCEoFI4pQ+ Ejp56fIUBa9P9MlT X-Received: by 10.98.106.6 with SMTP id f6mr9838646pfc.53.1500117493256; Sat, 15 Jul 2017 04:18:13 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id k194sm19000874pgc.31.2017.07.15.04.18.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Jul 2017 04:18:12 -0700 (PDT) From: Yuanhan Liu To: Jianfeng Tan Cc: Maxime Coquelin , dpdk stable Date: Sat, 15 Jul 2017 19:17:11 +0800 Message-Id: <1500117433-28932-5-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500117433-28932-1-git-send-email-yliu@fridaylinux.org> References: <1500117433-28932-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'vhost: fix IP checksum' has been queued to LTS release 16.11.3 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: , X-List-Received-Date: Sat, 15 Jul 2017 11:18:14 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/19/17. So please shout if anyone has objections. Thanks. --yliu --- >>From a492f24ce1507c56a6ad9a605571a0ac7390c39e Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Wed, 7 Jun 2017 06:41:37 +0000 Subject: [PATCH] vhost: fix IP checksum [ upstream commit b08b8cfeb2aea2a703d201ad8c4b258e8a0bde12 ] There is no way to bypass IP checksum verification in Linux kernel, no matter skb->ip_summed is assigned as CHECKSUM_UNNECESSARY or CHECKSUM_PARTIAL. So any packets with bad IP checksum will be dropped at VM IP layer. To correct, we check this flag PKT_TX_IP_CKSUM to calculate IP csum. Fixes: 859b480d5afd ("vhost: add guest offload setting") Signed-off-by: Jianfeng Tan Reviewed-by: Maxime Coquelin Acked-by: Yuanhan Liu --- lib/librte_vhost/virtio_net.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5d793de..7d5b04c 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -169,6 +169,15 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) } } + /* IP cksum verification cannot be bypassed, then calculate here */ + if (m_buf->ol_flags & PKT_TX_IP_CKSUM) { + struct ipv4_hdr *ipv4_hdr; + + ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct ipv4_hdr *, + m_buf->l2_len); + ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); + } + if (m_buf->ol_flags & PKT_TX_TCP_SEG) { if (m_buf->ol_flags & PKT_TX_IPV4) net_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; -- 2.7.4