From patchwork Thu May 16 11:24:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Kori X-Patchwork-Id: 53471 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 955385F2B; Thu, 16 May 2019 13:25:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 292EA5B1E for ; Thu, 16 May 2019 13:25:02 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4GBKl4Q019733 for ; Thu, 16 May 2019 04:25:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=zV5W99VCufS00l2dcPJe1luUJyz6pfbRY5qOe3dLje0=; b=aoZVVMP1PmPrZW11SrFghj+B6Pjs4cQGLle6LZY+D4lkzaa8Zb6w2fmb5jN7zLKawL5U m6HOH6JovX97+KyIL2JapjS40Mx4bC4BBIwnMCbo2ERyDt/BxHn/rrZ6vDYzjtxzatFC Of79nlXIcxoLkY0VwnSNl/gyiSLkclmwEv2EFWW1T5+5Q3ZrH/xAJb0EpCf3B8a0MJ6W Xq/ua/uOOlWz4dVOoAN3HHNIuzcmGgdUV4F2b9Ti4nEpRj4g/wS8o52HlSQAFg7Tbsvv muT1CYRAe269iJvOw/ARliHjkL8TxaAVzhGVQZH4J1n9zoLNLOAtnqgi/YbsZDovThyF cw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2sh2rh12n2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 May 2019 04:25:01 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 16 May 2019 04:25:00 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 16 May 2019 04:25:00 -0700 Received: from dc7-eodlnx05.marvell.com (dc7-eodlnx05.marvell.com [10.28.113.55]) by maili.marvell.com (Postfix) with ESMTP id E14003F703F; Thu, 16 May 2019 04:24:59 -0700 (PDT) From: Sunil Kumar Kori To: CC: Date: Thu, 16 May 2019 16:54:53 +0530 Message-ID: <1558005895-30340-2-git-send-email-skori@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1558005895-30340-1-git-send-email-skori@marvell.com> References: <1558005895-30340-1-git-send-email-skori@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-16_09:, , signatures=0 Subject: [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not. Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload. Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid. So removing mentioned flag from the library. Signed-off-by: Sunil Kumar Kori --- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 3 files changed, 7 deletions(-) diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c index a96fb03..13e60fb 100644 --- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c +++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c @@ -173,7 +173,6 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num) fragment_offset = (uint16_t)(fragment_offset + out_pkt->pkt_len - sizeof(struct ipv4_hdr)); - out_pkt->ol_flags |= PKT_TX_IP_CKSUM; out_pkt->l3_len = sizeof(struct ipv4_hdr); /* Write the fragment to the output list */ diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c index 1029b7a..4e20431 100644 --- a/lib/librte_ip_frag/rte_ipv4_reassembly.c +++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c @@ -66,9 +66,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX].mb; fp->frags[IP_FIRST_FRAG_IDX].mb = NULL; - /* update mbuf fields for reassembled packet. */ - m->ol_flags |= PKT_TX_IP_CKSUM; - /* update ipv4 header for the reassembled packet */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len); diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c index 855e3f7..eb8b849 100644 --- a/lib/librte_ip_frag/rte_ipv6_reassembly.c +++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c @@ -89,9 +89,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX].mb; fp->frags[IP_FIRST_FRAG_IDX].mb = NULL; - /* update mbuf fields for reassembled packet. */ - m->ol_flags |= PKT_TX_IP_CKSUM; - /* update ipv6 header for the reassembled datagram */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, m->l2_len); From patchwork Thu May 16 11:24:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Kori X-Patchwork-Id: 53472 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B985B5F21; Thu, 16 May 2019 13:25:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 761FC5F21 for ; Thu, 16 May 2019 13:25:04 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4GBL3oR020271 for ; Thu, 16 May 2019 04:25:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=D62QKNXezTiSXvVjpBqj7Yd5YkPmDLeTUwmOMuOEIPo=; b=N8ChOt+KlhYO4aPig0a7WusaF3BbYwZcuHGuvW0g+TGhVtl/tXvXgc87wCT4KCtU3bEb kPPXVHLpWWt4Z31I95IwWchVCg/yU4w787e9Ovet1I7ONxz+YEQg6G40nK2mNypjHLu3 bXEy4LySB3aG6PqnfZ/snb7w842nL2de+bpkMn/L4RMBlVrje8M0AAYX6zPOutwq0AC/ hn2nfWA30I5TFaQGqHwcYDJ75MhI53jKk3eDiheY7ePOeTGl9brF7dSNoa5Nvm2dax2/ TCUUK6YxHoKN5AR4xr4kHBthmbzAooc0whcPU/GFRIHqwnz38/1NAh/bpVVqcxuj/Ji1 mg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2sh2rh12n8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 May 2019 04:25:03 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 16 May 2019 04:25:02 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 16 May 2019 04:25:02 -0700 Received: from dc7-eodlnx05.marvell.com (dc7-eodlnx05.marvell.com [10.28.113.55]) by maili.marvell.com (Postfix) with ESMTP id E427F3F703F; Thu, 16 May 2019 04:25:01 -0700 (PDT) From: Sunil Kumar Kori To: CC: Date: Thu, 16 May 2019 16:54:54 +0530 Message-ID: <1558005895-30340-3-git-send-email-skori@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1558005895-30340-1-git-send-email-skori@marvell.com> References: <1558005895-30340-1-git-send-email-skori@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-16_09:, , signatures=0 Subject: [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Signed-off-by: Sunil Kumar Kori --- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index e90a61e..d821967 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = { /* src addr */ ether_addr_copy(&ports_eth_addr[port_out], ð_hdr->s_addr); - if (ipv6) + if (ipv6) { eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv6); - else + m->ol_flags |= PKT_TX_IPV6; + } else { eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM); + } } len += len2; From patchwork Thu May 16 11:24:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Kori X-Patchwork-Id: 53473 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AFEB5F44; Thu, 16 May 2019 13:25:08 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 314F35F21 for ; Thu, 16 May 2019 13:25:06 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4GBKhk3019721 for ; Thu, 16 May 2019 04:25:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=eccn4h1kyJsiQ9YzH4pt3CIBXMXqdMduFa1KK9w0Mek=; b=cJt+99Gq0oPxczHT3uPslclzl5Vd6VZDxeh/7j7cEGsus1HEpvl9l9c7jD5453nuUOfW qiyw1BnRIv5nFTPVjtD/+5lpB6gE/pcSdCRiYKsZsGi6GERL13+xaq7gJXoj4Y+1OVh7 jHXqna94g1e9v5EHB9e3yoFIeqqX4Yg1huZn1neJ49gusyr4MQLKyvTg+22WuY/U5NpD N/o5c41L/qtYLvI/5IGWwvKzqkB+R3iO4xNjMTzEPZERwbTApad+MdjaKRqkRDp4j3at 4z9f7YdbbZE54EJa3ViEQft87omWQTKxgxpHYcQJaURr/Gw0OfUHvcgPwDBupRRaCpzS 0Q== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2sh2rh12nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 May 2019 04:25:05 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 16 May 2019 04:25:04 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 16 May 2019 04:25:04 -0700 Received: from dc7-eodlnx05.marvell.com (dc7-eodlnx05.marvell.com [10.28.113.55]) by maili.marvell.com (Postfix) with ESMTP id D69673F7048; Thu, 16 May 2019 04:25:03 -0700 (PDT) From: Sunil Kumar Kori To: CC: Date: Thu, 16 May 2019 16:54:55 +0530 Message-ID: <1558005895-30340-4-git-send-email-skori@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1558005895-30340-1-git-send-email-skori@marvell.com> References: <1558005895-30340-1-git-send-email-skori@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-16_09:, , signatures=0 Subject: [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Signed-off-by: Sunil Kumar Kori --- examples/ip_reassembly/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 17b55d4..686e364 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = { struct ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1); } + + /* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM); } ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr); @@ -391,6 +394,9 @@ struct rte_lpm6_config lpm6_config = { eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1); } + + /* update offloading flags */ + m->ol_flags |= PKT_TX_IPV6; } /* Find destination port */