From patchwork Mon Jul 8 04:32:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 56201 X-Patchwork-Delegate: thomas@monjalon.net 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 4E64F1B952; Mon, 8 Jul 2019 06:32:54 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 11E145905 for ; Mon, 8 Jul 2019 06:32:52 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x684UdnR003216; Sun, 7 Jul 2019 21:32:51 -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-transfer-encoding : content-type; s=pfpt0818; bh=KWhbDc0zepXr35Tm/0gpz1MrGGda1ICYWVUPnwxMWNk=; b=mPBscd5Wp8oaN9lSFHuTXhQNNuz+uwhdjkXF8jtK258/wBYpmr/6Azyp+FQ9AhYnDSNA 2YcXvSFlE4ascg5dGmix0Ss+eKmIavsAtFC3HSnkS3wRUHJofS8FlfSVN3w1pvSmn01K pzyTg2EpP+ge9PSnWH9taeDgMy8FNVrN3nXsI5qhXQsc0TSk/OJo8BfGybugL2tcZ2A1 RfsR2WU7bWMZ/1jlZvDAZjvupxgWhTWtfDhLmO0avj7sVBA3OMyK/8U8CbGMbBr4NXA6 e6QbCTJKSe5XywGTUGnUVzjw5+fUtypn7qWgz5m/E8FxLYq+epsvEa/oItRrzDUPnFDm mA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2tju5j5j6e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 07 Jul 2019 21:32:50 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 7 Jul 2019 21:32:49 -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; Sun, 7 Jul 2019 21:32:48 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id B294C3F703F; Sun, 7 Jul 2019 21:32:47 -0700 (PDT) From: To: , Konstantin Ananyev CC: , Sunil Kumar Kori Date: Mon, 8 Jul 2019 10:02:59 +0530 Message-ID: <20190708043300.44295-2-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708043300.44295-1-jerinj@marvell.com> References: <1558349992-12237-1-git-send-email-skori@marvell.com> <20190708043300.44295-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-08_01:, , signatures=0 Subject: [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload 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" From: Sunil Kumar Kori As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags. Signed-off-by: Sunil Kumar Kori Acked-by: Konstantin Ananyev --- v4: - Rebased to top of tree - Fix check-gitlog.sh issues --- examples/ip_fragmentation/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 85c0100f7..ccaf23ff0 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -357,12 +357,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, /* src addr */ rte_ether_addr_copy(&ports_eth_addr[port_out], ð_hdr->s_addr); - if (ipv6) + if (ipv6) { eth_hdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV6); - else + } else { eth_hdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4); + m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM); + } } len += len2; From patchwork Mon Jul 8 04:33:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 56203 X-Patchwork-Delegate: thomas@monjalon.net 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 80B081B957; Mon, 8 Jul 2019 06:32:56 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id DFC9C5905 for ; Mon, 8 Jul 2019 06:32:53 +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 x684WMiD007927; Sun, 7 Jul 2019 21:32:53 -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-transfer-encoding : content-type; s=pfpt0818; bh=q43k9hI9eDO2P87pobHsy+LtUC8sP4tsyHQxLqbv1ac=; b=I5G8JXZil+OAb4e4rFe27Sl40Yc0h/jLmebKv7QDZY5edooo2XdbK8kZPYbFnzqNrfWb 59DTq39Cfjf3KDfD5SUB0CJsAKTT/bRf0I5PuiXQ1+jHvWUdSIXtwxA5QDnVxgeL2POq zWQTJcsQ0MN2lDZiIPDfZI15/02aa64meLw93hWhTFeoci3WvrxaoysmSxe33l/50zuY mE4y2eUHuOTWUcsHqi6xwo2xttlUYvmDMJcdtozP7nkOrfUzms5NzG3zkiTgdA499wKd GFGMezgI0zC3NpLvu5GHMeagTSjZDTeEaMrPy2+vxmeG9WG84N+foXfONMvykOCb/+hy pA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2tjs0nx4pm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 07 Jul 2019 21:32:53 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 7 Jul 2019 21:32:51 -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; Sun, 7 Jul 2019 21:32:51 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id AC6743F703F; Sun, 7 Jul 2019 21:32:50 -0700 (PDT) From: To: , Konstantin Ananyev CC: , Sunil Kumar Kori Date: Mon, 8 Jul 2019 10:03:00 +0530 Message-ID: <20190708043300.44295-3-jerinj@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708043300.44295-1-jerinj@marvell.com> References: <1558349992-12237-1-git-send-email-skori@marvell.com> <20190708043300.44295-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-08_01:, , signatures=0 Subject: [dpdk-dev] [PATCH v4 3/3] examples/ip_reassembly: enable IP checksum offload 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" From: Sunil Kumar Kori As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags. Signed-off-by: Sunil Kumar Kori Acked-by: Konstantin Ananyev --- v4: - Rebased to top of tree - Fix check-gitlog.sh issues --- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index fbd09341f..38b39be6b 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -353,6 +353,9 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct rte_ether_hdr *); ip_hdr = (struct rte_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);