From patchwork Fri Dec 8 05:21:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121125 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp230052qgn; Thu, 7 Dec 2017 21:24:27 -0800 (PST) X-Google-Smtp-Source: AGs4zMb4mM53BpWtv687+uHdqVQAhSXsUAHvSAd9hDb58Nk28Cmygv1eupnJYhvuBJ4jBuEEKY5L X-Received: by 10.223.181.132 with SMTP id c4mr23824504wre.42.1512710666999; Thu, 07 Dec 2017 21:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512710666; cv=none; d=google.com; s=arc-20160816; b=lbZQ80Q8UJABeHBt0WSiL4pVxCZWa2eAEBzJBs2RIgQDPNpIEITSMjJ+bMkTcGzGEs FbOx9K2iifR14wu84LeOnGeqd48e127T7QYBpE1UJVm/SRwkJVTxwYnFRnFERFIxUBtK 5p0/HyD+KC5z2ZjCASvL9uP2dqP2u5hxPHS0TpntuFb3QstlJHWuIflopGhYFcBWtDFC d2UPatY6/TE/s6me9BlCxZlCa3ScWf3ENPjZmsV4T/GpvDkxmCZzuIpCouBV4RRD5TVJ NTn+LRNm22TEYXIoJ+DJLFeCvxIyC2vO3B0nofu5x2eCA/vzAjE4sto7Gg12PWiYZ5qG BfAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=rQq/OBXIh6GYgKx6G5UkHZOebJNQRhSbzJfkicxVwik=; b=VmEDO5dBKJUCsLF6Ud2WfVbaCTXG6QspiXES6DI++yOKQwI8lns6jey0UJNdqV1i0y HkCQLTj9G5soPyiBI0OcFTfUWNE1xrs2mgGb8e2kSqCQ7cl5Tcy3rX+M+4cBgQEkHzSA wBGS3fgZ4W3ShQ7ufiLrg+Zdzw/7mVQa3npskr7aW6JWTIXTHjbnDwGSAIdHs3woAJy4 uyftGU35dcIu8GyQ+z6sumzjRkpzMw5y1hh/em5G3mo4xpJoMJJyl3JqDrpLRv8W3FCk PnmV0HS8OSfQczKE7ZftPoK2+RG69VAvNAk+Hj4PLBSSbX9fnZ27Vz9wR4xEWirve4of KMjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 26si5186272wry.389.2017.12.07.21.24.26; Thu, 07 Dec 2017 21:24:26 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 297891B1C1; Fri, 8 Dec 2017 06:22:50 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0084.outbound.protection.outlook.com [104.47.38.84]) by dpdk.org (Postfix) with ESMTP id 5F8221B1B9 for ; Fri, 8 Dec 2017 06:22:48 +0100 (CET) Received: from BN3PR03CA0059.namprd03.prod.outlook.com (10.167.1.147) by CY1PR03MB2363.namprd03.prod.outlook.com (10.166.207.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Fri, 8 Dec 2017 05:22:46 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:115) by BN3PR03CA0059.outlook.office365.com (2a01:111:e400:7a4d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Fri, 8 Dec 2017 05:22:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Fri, 8 Dec 2017 05:22:43 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vB85MKGh013022; Thu, 7 Dec 2017 22:22:44 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Dec 2017 10:51:23 +0530 Message-ID: <1512710487-32388-11-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> References: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131571841638956697; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(39380400002)(39860400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(16586007)(54906003)(305945005)(2351001)(6916009)(316002)(33646002)(50466002)(81156014)(8676002)(47776003)(8936002)(81166006)(2906002)(8656006)(104016004)(48376002)(296002)(85426001)(50226002)(36756003)(97736004)(86362001)(4326008)(53936002)(68736007)(2950100002)(77096006)(5660300001)(51416003)(76176011)(6666003)(498600001)(105606002)(106466001)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2363; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:EAxhS5G1p/lsaFHGvX/bRi6A936okRnx8HzcTVlDRy2yYBYfoBdG1QsZSkqohz3/itjUe3w6LwTcQJqfyeKBfFeWcCC1DuhGYWTiaEppW8q8cXR8AKUvh0wk27Jp+0IO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6de5a03-2ca2-4322-7e99-08d53dfbb5cc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2363; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 3:xC89ViBZidSb8IVpLfdlFPf7QUUX9xZNOp2mHEohHQBMCQXDExH2Qj3bTQU2ixDS2k9sQvSpR2LIyUbRnXhm95EDmaUt+waopqRT8wUF5+Sqok5B48vkFkNraOhgS6tFChqkOPQYAuAj6zYWmCMIN0GnGAQOtaSz8XDu0a0jwnpfOXPvyGzjuN30luMrQm4kWJCG5Kmj2wNLBMaGWGF6Q3kNtSU9tkk/yddMDHx4+es5zIBu2cTjePKL62TvJ4oEiocKdKRb5PJrxOLTG+N6hHsa3hNd4onuPZLprQsGWKeo+NchNRaZ6R/T4VvQIG2RtjQ3NxZ8V2Yirq2pnR4JS5ti+Z/nLURX7iL22Dq+69s=; 25:ya3V85IQdRZtWUy9BmEiKP7r99Y+vjPugwC7vtCew538b/ZQDkUzb59zpgZsHai5Kwm8jdGQyqC0n/QcUgytHZoDJG3T1jRo4f/U1EH3VgnBhGBRC18juXPPDKJcHhf9zY3tP4ry+qkEDllMSzCvI3x9Wticsz2pGwcM+27YTTimQfzhqiMBhKcYx/94Gz/7iOp+SUz8sCIWmKwG4EU6D9OoX1U5hmdkzsbBjBVP+T6Qa2xLnZphhJW0UjT1aJvREeH+DYm83zWulfdW8Y2lbRK3Eo8YM3jNf3//P0m4c46i9oau5bdmRsqAGivVKu0Abcj8k6lJk2ClvjaTlvV6/A== X-MS-TrafficTypeDiagnostic: CY1PR03MB2363: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2363; 31:TmMD4DmCDG7aNxw+6BOKZ+BNqm6r5m2kYezqvzj20pct2FICJ2EhzAAZQ+N0NeYRPSO2ipUH7+Yr2CYPn5h0fXIn/NBXQrakvdBqiyy9hoyI7ii4qJiME4H0KQiFCRZclclhXVs9AUwm2kkTQCQMBQ3mpHehz707xZj6sjj+zKQlxjeUqXURHcEhEUzmJ+9bxECh/+zXBZlTjhJ7lufjBVHu3U9MNsi0+M2LPAKhk14=; 4:axqZUQl/IJdwaa4KtCF7ecD05pf+uAGvl/r19Bbg6byA8FN3mLG2azEwzvsLyixQ/OZlKGXgrAMXgkBDuwWFOQpoxFnK7aAHud2WA/dkfyPd25jbWM3Kt5VTbT7QoiP6fs95sCzMKxS9OFMCpiMnuOi7jFD3sykih4shgN4J/fc108QidO4XXWqgsc/FcxhVb/Zr2qKFbYckkLkHTIl558dFg3cxMIEk+a8pSlGtGrD9CnYsUlkEFIOGZkEF1r4VCkl0Qtw//b/5ugOg9oboA0oOWy7mOYhSlU30GhKMlWGAUAn6GNGVhiQB5EcBocMy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231022)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123565025)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123561025)(20161123563025)(20161123559100)(201708071742011); SRVR:CY1PR03MB2363; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2363; X-Forefront-PRVS: 0515208626 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2363; 23:KQ9nCINIAHl52QlLNY9mguNPdAZjLIV1U4NlbK9zz?= JqbH+vY98+odLPrw+8YozajiTODYzR+FCqbzEyhHTGRle4LhS7j2wWTB0j4Ub9JE6xBQ3hYEV1GZC2vL3pPp+fyFZMyroWpAnS0kaE6aYJLHtdq4UHdVneFk/dwObSv+IgAgcaxNMyWT4b7/eQvydLQtyA04Y7SMAeNpDkTFSVlNX+pBCbq6/1BU97yIGy8vMTObjxjGbTpNItKHM2q85bdOA0yETnAgZFc8dH5aDUvuAAiLqoJnNC41r2UluNOkzAahgYBLKQnrbBYEYY2k3UkheQm13IjrG2C8bQ/6JPD5SLl4Wg6PZ67JcpRYd7nt789m7MV2JvBg1Kcgtn1fAsXwoelNEVCUSlkC62YHVsM46qWIfMUSHgvecnEHy2ZiFE7gdKPRMErx6R5mbc2VpIh2xMmhRKxx+x3bWMvrUoXLoE3rq4MEGa5XhkrCQoEKj+G99OZiPzbOPkN1OwNYQXvVm4r6DZXHnjpFI2S64ywwc8inch15gUxOIMQ4Tyn8fX7+SyJG8E8RCwMWO3GfUXfViFesE5JnDgKCisyE5VykHTpssfbT8rOy8fOlwDbHEfLchPVQFIMNIRG5bVrw9uYL8gCB1mzTpNq/m6uroQhOChJHHEVyV+o4ZtHuHKpyPmNImJWodxO0uB9LVwJ4kqQI4t2A+rqXpmhJ1yP3CwFMPznuCHq8RMGN6NNU/3gx3/KW+bcKsUNryXPgJZu/M3utSFY2i/6nefolnxGZWeieqeI6cukR14W1bla+7OMrS4avLNR+Dn2+ndbmyDzQquPemCrKWVSU1kX5GxcImzzOsB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eEiag2ivryuNYEeTGFDqKTcLgPvMkGOzl8qf2VhkGscfn6I+Mhs5g/jdpxBlW0I8E56YzVSxoDAjQKUCJLtbkaiAQDGRh1tZMPafBk+4iE5RXG5pTyay6M25KpizSKC0NyudlL2HcYEXvDi65Q2qedvVKMV9cmS0KfOFHaGtJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 05:22:43.7084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6de5a03-2ca2-4322-7e99-08d53dfbb5cc X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2363 Subject: [dpdk-dev] [PATCH 10/14] net/dpaa2: add VLAN insert 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" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 8ecd238..93c2319 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -242,6 +242,12 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, /* Resetting the buffer pool id and offset field*/ fd->simple.bpid_offset = 0; + if (unlikely(mbuf->ol_flags & PKT_TX_VLAN_PKT)) { + int ret = rte_vlan_insert(&mbuf); + if (ret) + return ret; + } + temp = rte_pktmbuf_alloc(mbuf->pool); if (temp == NULL) { PMD_TX_LOG(ERR, "No memory to allocate S/G table"); @@ -308,6 +314,12 @@ static void __attribute__ ((noinline)) __attribute__((hot)) eth_mbuf_to_fd(struct rte_mbuf *mbuf, struct qbman_fd *fd, uint16_t bpid) { + if (unlikely(mbuf->ol_flags & PKT_TX_VLAN_PKT)) { + if (rte_vlan_insert(&mbuf)) { + rte_pktmbuf_free(mbuf); + return; + } + } /*Resetting the buffer pool id and offset field*/ fd->simple.bpid_offset = 0; @@ -347,6 +359,12 @@ eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, struct rte_mbuf *m; void *mb = NULL; + if (unlikely(mbuf->ol_flags & PKT_TX_VLAN_PKT)) { + int ret = rte_vlan_insert(&mbuf); + if (ret) + return ret; + } + if (rte_dpaa2_mbuf_alloc_bulk( rte_dpaa2_bpid_info[bpid].bp_list->mp, &mb, 1)) { PMD_TX_LOG(WARNING, "Unable to allocated DPAA2 buffer");