From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0052.outbound.protection.outlook.com [104.47.32.52]) by dpdk.org (Postfix) with ESMTP id 79185FA74 for ; Thu, 19 Jan 2017 14:25:55 +0100 (CET) Received: from CY4PR03CA0011.namprd03.prod.outlook.com (10.168.162.21) by DM2PR0301MB0749.namprd03.prod.outlook.com (10.160.97.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 19 Jan 2017 13:25:52 +0000 Received: from BY2FFO11FD040.protection.gbl (2a01:111:f400:7c0c::185) by CY4PR03CA0011.outlook.office365.com (2603:10b6:903:33::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 19 Jan 2017 13:25:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BY2FFO11FD040.mail.protection.outlook.com (10.1.14.225) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Thu, 19 Jan 2017 13:25:52 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0JDO4f8015351; Thu, 19 Jan 2017 06:25:48 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Thu, 19 Jan 2017 18:53:57 +0530 Message-ID: <1484832240-2048-33-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293059523452111; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39840400002)(39860400002)(39850400002)(39410400002)(39400400002)(39450400003)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(8676002)(81166006)(110136003)(5890100001)(50466002)(4326007)(81156014)(104016004)(97736004)(85426001)(54906002)(8656002)(36756003)(86362001)(38730400001)(6916009)(189998001)(626004)(2950100002)(53936002)(48376002)(33646002)(77096006)(76176999)(2351001)(5660300001)(6666003)(47776003)(106466001)(5003940100001)(305945005)(8936002)(356003)(68736007)(2906002)(92566002)(50226002)(105606002)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0749; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD040; 1:gAoDT2toIMaqMOUovO6bXjgqmo2n1rIOkdaNI0iU1VjB60/9P7pjQT0zai5VmjIMHzRWrFeB5C7NGv2vNFnIhN0FIwTUXdGPInOAD6XsTPDrKczB5LF+OV2ua5as7EsJWAxqdRRcFf9hmGE1gR5SgGdrdefSBoSUPRi4njIXm2gY0vixyfsMg7kCJ/d9PUzraquxo8YQZdvIHfkU/o9P0K7mt3jHNet7iXLwIpd7xg+ItzM4GRyGeunoKWmF0/n4L4BDVEMzpHOhsc8xje8AKDOsVeKEeAq2oEbvk/f5z8XleoNX69AFcpSzmV8NkKlpUgbT1URcU3uA/30bIv0QRyYZL9Y7mVBZzqW9tHkLSNe5wjHrvpnoXtfqzLSDStRPDSVMKCj2D3NqYxJ5JhG1s2MzrH9KIr/E/0PkO5WTdzrCRkaCt/7TlAEa2LZ2LQKAsYFaohJcRwkDkOPxf7xu1tufrvY3MW9mbQylGhMD1OqVr4YD7IVJn6f+P75Uttqu18bxU3Msz2kPPgqqmohg776Mk1GrUnFXw29dpk1LSoZ2dyBR46Ola51G4awsydkS5IobiBPqpaWcD7TvnBO4Vno7/o7YmXO3TFqb7pxpgaxxOPPldeFSLN7Oy3UXsUR/ztlG55l7lVaZ9b967E/HuetS3+oOwxz7qFVZERh1gu9Vb3pviE16DVNwinkgzcN0q9kcac01Auy06HooNfrCb+ByFnESQIiS7vmyaPeTQ0MI+UgyLPnwxmXSQTNc/gu4 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 33258324-e680-4472-3078-08d4406eb0c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 3:vv8SPp7gkNrzcTH1/xN4JS3BPGEwQjz2vnmpn083hk6h95fqWjOdUkFalncFmsF14QF4MmU0f1LI6Ew1r9yDyX44SEFzsRxNIc1qzR/arJ/7hmNI1OGecu8/ot+4l28XujRvlRt3lq6YOH7ZP0yj4GGFBNzSZkxaebZdzQeFaATCgOxzY52Nqn0/yF4hX2whWR3Z7tvM4Io/yex09oSjGxc+w/ZjfmUFIfaxLV0UsGIxoPtAA+AU02GsKU93pmxqtb9vY/UQ5xUIsQL4P4KJgCn57eMqgXd++PUWhhA8WYPatuKX/0inFoUffVcOIZR9T3o45dMqI/FAirms+E84BpHhozihEPTczrKSzjLAF/7tpoF6wkATJE0OW9n3T0jY; 25:7GzHQhz2UtDP48yqD9OfD/TNsDRRs+1w4R4Ke0YaCqXmvmc1uXQbEKmEfrxDFBiObyXFpHAlCwGyH68qb5Q/LuB9/40vXs9mVL9faKNhIOQlkqEQIhnU+LQ9Mdu4bqX+Yb2UGngOuw4phwNTHkc7WHHM0o+tFIJk2URO0iK5oK/NO3J+gDDIfzKUL/JsYYdvGVT8KEbxeeOq6BmSAHjm+J/EmmzCsUG2UCoj9pTV8K2rqNkWpPrPvQ7K1QmBhFZ2oEsjkWeapQSZaMYdNhJQwVLcLrkqKEkxrEWsasiLpkOVgAa3cEKKNZ2Gy4QlbmzuqbQ2f5uhTh+eY0zM4BeuB4ieis01DmKAH+FzbyPnbdCsS1wEnoXa2azWLmu59GZ2hNQV6EV/8xcDju04SyzrNJs6SWPimmUOGT40uAbPxnQLf/x7bhKyJCVUyuLPg8e5CqtOmPss9PKiCzjk4aBhbw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 31:QOI4fJSWpN76lPdh4kmZvD9NkYDc8c2B7Qu+kYTJaEGmAn7cyMEOsKxc28v5Ioy8Y662cQXyLzAyIIhbMqoTf8wP5aXB9pNY3QyNAirSEf1LVOyMNGIkTvy4PWmHpgFXyOYEU4m8w5WiACIBo7LKnybD6BTijKMzpNjHVXmU+vZLwYAEFkUcmRypX3WYe5UIVRTG8aFA2/RqOtMVXQnNrrr6hsBUtgj85SWytIKYk0hxRL+bFr26UifpozAsqUo6s1TBGriQNO03M8FzZNah4FR+aYz6fhnBTJ2zcZNu5fk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13017025)(13015025)(13024025)(13023025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123556025)(20161123563025)(20161123565025)(20161123559025); SRVR:DM2PR0301MB0749; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 4:1ykdCSLH0FijsU5L456fJIDo8CH3NqX4ZrNbs4Z2e1IfXsncnKJuzVZQHDpL0XpwhdAKw6cijszU/EFcdtexdqxi720lEsKPmf+zwsdB3qb7rdM8GDQ/B0gmGoTUDh8f8uSFy681tLIKbvL2RtOmeITJDJzFievPA74kBubTnM8h4EaeQbHdiV/rgQ21YXF1zgSSEc2avd4hKIup8dlgK8hLs5XjkAPk6c6CNrMWebFAUB5hcvVINB52ozu14wWEExzaooPrM9klpOFTkAPlbIwpnTf5+hM7zwUhKyxS/HaNtWtWK63biiIWx8STOIRYg8iZob1qEAUjd6Hg5GopSj1VgbO1WONRKvOKYN0G0IDHy0d5y8h496cEK3NK//oNL/mS0CZUO4g4+8y7YaPp+8ZbejzepfADF1zL0XD3OG1uAqP/5IdDonumc4Lh/GwKLQIZZvbX4kUAdh0WP+Ed04U34vfvvbrGQqtgqEkpvdzcZKM9no3wWO2YjW1sOtQFgYUhbYRbpPJBpq7OI7qv5YWOJ0tX2tpejj5MOS/+ZAtMOUhtedJ5pHg26/OspwFfq+hZCamuNZ8AU2yUpdoRF0RA9QJxfr5EEWBrc7SQfwjTaN9JGlk7UnAFDh59xZAlEypA5R9LzQn2+IwpArtl8UVDIi4bR4aPQLQk/BbWhEftDmbZt9uhwq7k7LOZAZpWja7A4fY20YRcabmKdSFA22rrZwCD4rhYVTjaJXt7hIRYXz627vhMhs4+QotGmzzg X-Forefront-PRVS: 0192E812EC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0749; 23:hmormeKO5NmHhSeNUUT/VWW5AE4u7G+WJHef0Ou?= =?us-ascii?Q?kiAGjF9cHiN88UlTZYEkt1ETI8lBocue9Zo3zB60Xw5NRaV2XIm8KMf5R/Nk?= =?us-ascii?Q?qQZJyYyRyhce7kYHhDVRBKd5zkT92t++JouxfmXKNZYid8sL521JuxONa6gu?= =?us-ascii?Q?X8vBDqRjzAdD6VY0pUKR16g3Jnqk4tzLDspdrs959GqHf7i2Fpka/vGZOSUb?= =?us-ascii?Q?wj7Drinur0vtKD3l92yLl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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 7:DhK322on/6OPD/Wjq4aGr8Nh0D8hlCjBXkVD/2HsS+8sYLPAi0fSG1UiP8EvmMFZZgZBEbD2R5fczOjM+tqYJKa5z3i/Plzafd3YoD8CxhWJzgueJSyl2zYlJh7ltSm4BSvc18wQ5w/UEgAtz5I9yVC8+xvP2eIjWrWuoa2t6uuNTVZdd9B3RAjz2uA0aXGGyFdg1PvZL2ElChyUgfgyxd741UtVJ/+4NB8g606iysvy2eTYW9GQSygW5X9tX7g5XQAIxwn+mXEq/I1cApRgMfJF9MfNKSGtUXdlWSRG9mi/qcmLD+RiWpPu2aXIS69YTT5FbxdbOXdGM4DZCpFrgUgYBR2uOfyjefZZ5p//31MrvEgxcDTwU57TiB27WVlkG+A0FriK1UWQX9HA9++MlR1i6uOzmX5VENAJr/7SqresIfFnRdkCndo+7RJCcfLcU8sIUp6N1SKsfU8k2IkpYg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2017 13:25:52.0020 (UTC) 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: DM2PR0301MB0749 Subject: [dpdk-dev] [PATCHv5 30/33] net/dpaa2: add support for non hw buffer pool packet transmit 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: , X-List-Received-Date: Thu, 19 Jan 2017 13:25:56 -0000 Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_rxtx.c | 74 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 7d73bde..55068e5 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -191,6 +191,54 @@ static void __attribute__ ((noinline)) __attribute__((hot)) DPAA2_GET_FD_BPID(fd), DPAA2_GET_FD_LEN(fd)); } + +static inline int __attribute__((hot)) +eth_copy_mbuf_to_fd(struct rte_mbuf *mbuf, + struct qbman_fd *fd, uint16_t bpid) +{ + struct rte_mbuf *m; + void *mb = NULL; + + if (hw_mbuf_alloc_bulk(bpid_info[bpid].bp_list->buf_pool.mp, &mb, 1)) { + PMD_TX_LOG(WARNING, "Unable to allocated DPAA2 buffer"); + rte_pktmbuf_free(mbuf); + return -1; + } + m = (struct rte_mbuf *)mb; + memcpy((char *)m->buf_addr + mbuf->data_off, + (void *)((char *)mbuf->buf_addr + mbuf->data_off), + mbuf->pkt_len); + + /* Copy required fields */ + m->data_off = mbuf->data_off; + m->ol_flags = mbuf->ol_flags; + m->packet_type = mbuf->packet_type; + m->tx_offload = mbuf->tx_offload; + + /*Resetting the buffer pool id and offset field*/ + fd->simple.bpid_offset = 0; + + DPAA2_SET_FD_ADDR(fd, (m->buf_addr)); + DPAA2_SET_FD_LEN(fd, mbuf->data_len); + DPAA2_SET_FD_BPID(fd, bpid); + DPAA2_SET_FD_OFFSET(fd, mbuf->data_off); + DPAA2_SET_FD_ASAL(fd, DPAA2_ASAL_VAL); + + PMD_TX_LOG(DEBUG, " mbuf %p BMAN buf addr %p", + (void *)mbuf, mbuf->buf_addr); + + PMD_TX_LOG(DEBUG, " fdaddr =%lx bpid =%d meta =%d off =%d, len =%d", + DPAA2_GET_FD_ADDR(fd), + DPAA2_GET_FD_BPID(fd), + bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size, + DPAA2_GET_FD_OFFSET(fd), + DPAA2_GET_FD_LEN(fd)); + /*free the original packet */ + rte_pktmbuf_free(mbuf); + + return 0; +} + uint16_t dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { @@ -331,8 +379,29 @@ static void __attribute__ ((noinline)) __attribute__((hot)) DPAA2_RESET_FD_CTRL((&fd_arr[loop])); DPAA2_SET_FD_FLC((&fd_arr[loop]), NULL); mp = (*bufs)->pool; - bpid = mempool_to_bpid(mp); - eth_mbuf_to_fd(*bufs, &fd_arr[loop], bpid); + /* Not a hw_pkt pool allocated frame */ + if (mp && !(mp->flags & MEMPOOL_F_HW_PKT_POOL)) { + PMD_TX_LOG(ERR, "non hw offload bufffer "); + /* alloc should be from the default buffer pool + * attached to this interface + */ + if (priv->bp_list) { + bpid = priv->bp_list->buf_pool.bpid; + } else { + PMD_TX_LOG(ERR, "errr: why no bpool" + " attached"); + num_tx = 0; + goto skip_tx; + } + if (eth_copy_mbuf_to_fd(*bufs, + &fd_arr[loop], bpid)) { + bufs++; + continue; + } + } else { + bpid = mempool_to_bpid(mp); + eth_mbuf_to_fd(*bufs, &fd_arr[loop], bpid); + } bufs++; } loop = 0; @@ -345,5 +414,6 @@ static void __attribute__ ((noinline)) __attribute__((hot)) dpaa2_q->tx_pkts += frames_to_send; nb_pkts -= frames_to_send; } +skip_tx: return num_tx; } -- 1.9.1