From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0065.outbound.protection.outlook.com [104.47.42.65]) by dpdk.org (Postfix) with ESMTP id D5FDD3772 for ; Mon, 6 Mar 2017 06:30:11 +0100 (CET) Received: from CY1PR03CA0006.namprd03.prod.outlook.com (10.174.128.16) by BN1PR0301MB0724.namprd03.prod.outlook.com (10.160.78.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Mon, 6 Mar 2017 05:30:08 +0000 Received: from BL2FFO11FD030.protection.gbl (2a01:111:f400:7c09::114) by CY1PR03CA0006.outlook.office365.com (2603:10b6:600::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Mon, 6 Mar 2017 05:30:07 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.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 BL2FFO11FD030.mail.protection.outlook.com (10.173.161.40) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.947.7 via Frontend Transport; Mon, 6 Mar 2017 05:30:06 +0000 Received: from [127.0.0.1] ([10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v265U2ku026457; Sun, 5 Mar 2017 22:30:04 -0700 To: Jerin Jacob , References: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> From: Hemant Agrawal Message-ID: <2c0a5f47-3015-cdee-8519-1f602fa0240a@nxp.com> Date: Mon, 6 Mar 2017 11:00:01 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131332518069869716; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(336005)(7916002)(39850400002)(39840400002)(39410400002)(39380400002)(39400400002)(39450400003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(377454003)(24454002)(9170700003)(8676002)(65956001)(626004)(189998001)(47776003)(31686004)(65806001)(305945005)(50466002)(36756003)(38730400002)(229853002)(4001350100001)(5660300001)(2950100002)(120886001)(7126002)(6666003)(77096006)(65826007)(64126003)(83506001)(356003)(23746002)(106466001)(85426001)(54356999)(104016004)(105606002)(230700001)(53936002)(6246003)(7246003)(92566002)(76176999)(53546006)(50986999)(33646002)(2906002)(81166006)(31696002)(8936002)(86362001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0724; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD030; 1:HD7n8eCGRUTXgnwqC2dAjBBrw+ObM1XZsTcyHSlcoCjuEJvlieYttzs+eZpjVme3IjGG5LUD7SiXOhw0PAnQ0vCd29quw3Ev2elxiAG3m0HvJLjyKcDrpKXudNcu7nECdCG5kBp0RNYJx4Ro2SepanG9QS8jln1B3sNmNnNIsIQRBVT5nNIhk4fbogS39IKoa+gYPdNjRuQgLyBAK8OuXlAYGRvKFwUrqUqFUhv+q8KA+hXnW5lrurNlBYmJ0I2j3AKGZuBmuQ3usE/6v9bwpYiy476/rZASd+SSDXGsPwjQHsinG5YBWtTg5RSmWYMfmBFU9/2YTsDhgDy/CxM6jsyBYb9/nUG+O16KFwaJ7CjMnW8vMQNTCAD89WP6HLZc3X60zuxW5OIcXXapuruh2/fMRwDQYe5S/Jgb8m54RStK/W34Q/xJeFkQ1IbRc5YZG/vPRlmRpmLhuNfrxr2+SxP7EO6UJXj4t+vu9SAtgZyLi8gWdeY/4ezAr2ugjuG+8uJ917+DcW4qs7W/dUDwdtOJ8P72gbROsH2LXd2CjyLYoBx4GCNAYr+s1ikT96VT4rYGAVXef6ey5zGICZQqUg== X-MS-Office365-Filtering-Correlation-Id: 2d12b3b7-17da-48e4-b02b-08d46451d964 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0724; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 3:7WxCwQgkHQdQPPEscdMUyncuF4iivuE/3DRyQFcCQlMCg2vskCKF8hAFSJseSHTNSAbva4Aa7woUHKIOTBut1gSoYetRgnq6+ddJekS1zJoYmLHV7CoTGPTo9vePrkOPlVHFuDHcCJi3qDXLihhjnIdY6cqZKOLRaFc5yGlZ05xZjDeB/ohuCgk/NnCjnERvlJBFrW3jOdLpzmttG1/hbTN1Pyu/hcNdGVhDui8xJddQlgjuVEzWnNPwNZnTcZKJDHcf79cmsQHq3FipfoppStyO3GCpZu7aXYO+L/3uHXp6wnVLUf+fngXeubBsOdkTnXyA4QLJaQBLPt5B2Jmb7zO/JbNBA0z1RaPC0dgTTKHlt3CFaqp5ebKMU15vSBIz; 25:sFEsZ9d5bcW9DOkDDJvn4M21RaR2ZGXsYiWWv9zHnZ1CBlfIc+jSFdZonfGJce0rsalKBCPP2F5a2eDA3xglx3dy6jrEbt0idMLMAXEzqw20FAEmhogy8nhol3syZ2NNPQdx9t8loTwOrG7IoNA/3RvzTRzWn/hROOb1u5xhJ9vATpL7JDkcC+9wD0G7EKdeeVl5BRjyMJjYEX+ruHMGylFVnU3+SjhC0hWl4+XVpfOQ3HUt393nJtoWasXvNUywW1qfhBM4v/k9w3F1hMwDgWt2eduESqFHVYSw9u3iu1U1EEhcRurEdwNkLE27+bXmnjOEePFJBRdBB6x/MWJlqDBFFAvV5e6YIL6iSyQ6fEsuggArJN88dFNzJaNPHDbKCXiKZb2ShkNAy+UoOOZqZEEj586uSK/DnxLVHTaWa7gsU3b3aXkStdp/t37NDZDuHsRAaD4UW0if+bIBELx7UA== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 31:reIZ4/Fz1yuPQ/fIODigdE3I3DT/DWPxKvX4d2Kmw0lthX8AcFlxs5ov7yjaSY56te1M5NMbt56d8a0SzH7bYr9LQ5lkJYTJD6az1duAYHlJIqwtML+TG3oeOVGlsZtLKvUeOtthUGtMDkLH9QHHbdq5S3Ya+sP7LvPSacb9xJSdbWGWz0ov4e/+XcTMMvuRhPTvLFefBCGMWCHgG/bRG3YGUlpquMgx9T+Juvirs+JBxD3wuJiLs0xWCHHSE0GhFXYNRx4I7E3VLdl7OHmkG8gUVlJaW2/Qqc9YXPKTYPw= 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)(8121501046)(5005006)(13023025)(13015025)(13017025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123563025)(20161123561025)(20161123559025); SRVR:BN1PR0301MB0724; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0724; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 4:GIHlxffcoRcMTyyOAwjvcLocvuHLM+l+EQVzx1hCMlRYtqwPcwL3NeF/nY88YeU+ePGpvn7FjuOH2pc7xyi3tzVsE4ZsY2oDpc0YVffhgjHTP4PXosdqOa/J51WuRndbFYG/NtZYi221eprvFh5Jufv1Kd4s/x54FS61CmKO2q4BCNK8hzaDdrChhSAaeMA2Kp9Olnbh0EdayaaKSBO+EHSJj4JYnQTuXjeyehQJSMmDRos2t44sIxQURslU+AAjX54DXvRo7Vq6UwSvJ+JzY9TucEsjBZC/ESIPJ3azQUTF+tbxNz9/oPeOGrBA5M8kSQZJ/UDrxg1wLC41HdLIPM7Gjbsl34otWv57J5xhYdqTkEErhN4MA0lwFn9VdGds4pPlBuuYflGvcUbqJRB6qJS2oLyyyr2rgXQGbqgnIFVrZlU6J9NrsloP39N8kYkh0hbVEOZ7IW3UaUl3w5T2LfIartsosFy1gPzKgaK1zD0J4OlUk1e0V2vbiQqQz2W8vsV49u8z+hryJTACdPWJSYfdpxYi1XT9MmGtMot314FWMh6ZN8y0QByOPDFJYtUF7KQf4NYr3lTMzS/he8tFDNVK2hx4CQPoUj2GBpoRt4dUs9AVFcTEob0+DRqbMKLLXrEAGSr/yHan7Wq5XfTsWt+OMvdCEBCC5nw1aoJqic5yJe08tcK496TjhBADQrt1YtPYXhh3Asc/cr11Gdmw6y8T/TgvwMiDcTvha+Kp8ln05U03RumwFc2Q+cvoKM9M X-Forefront-PRVS: 0238AEEDB0 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN1PR0301MB0724; 23:F80Jw4UGCAY+4c2jnCW8dUxHsHFIChP8UpJ?= =?Windows-1252?Q?JtGBjR0Xx2Nnrza4ue/bMRNKdkrJWOkOBajc8XzcYtPCioRlDyVkkw9n?= =?Windows-1252?Q?f3zhyWmwYWXQx+FEUgE9jB+6JHQgq8iikyO1nb8i6uz1dCZXjU/oVxC2?= =?Windows-1252?Q?qYyaEzLi5QjUqrZHj8x65DLJGe1hWbsrCkhSFKMrXb81bmxWjSJHcWvC?= =?Windows-1252?Q?fXZOkPeieXHmO0LiNHZtFpC0BYEbZb1YFTBkpf/gVY0SYJUqchAk6pNR?= =?Windows-1252?Q?p33K5DyYfRTM9PAvyiAM6Uk/J3NRqIXF05i9prCvI2MsPTZt3HMXnUif?= =?Windows-1252?Q?lFr1ZAYNavSx0oK3iF6wCUWtPCOoLvD8UYWmyzA2xA1Zbua4ZKS2rlkN?= =?Windows-1252?Q?A562605szFoCqGZul860MyAUlopkpfUNW/eDkjw+MrJEXU0URDXEeYMv?= =?Windows-1252?Q?+6jCrMy8uPpu9x2cDQAAscw2E/8e/+OQlZnT9oU62qfHc8yuFFfZDeUk?= =?Windows-1252?Q?CEFUKCT19ecU6yxvpm7/7tux2bCpaRrsr5ZPE8JmeNbvQ7HPaEEqtTqc?= =?Windows-1252?Q?eAuIdiPp9iAAk+N+4tg3we+xvo3O3ajek/3TU6s4X+7JULswlKsNUIGE?= =?Windows-1252?Q?XXtaNQOC/wwlIh4fi7k9ZuZndTV+4VIHtz62Zc9XiP5hsoDHzND3U4qN?= =?Windows-1252?Q?/91iGz7m7CYgPsMZtnOp2xXHM4jKMWsboQSy20WftC7Td4AL7qqO8+Rw?= =?Windows-1252?Q?ncMJL9g0nihk4nSxTYHQ+7FHAoEF/zt6dLWBqEQnnNrBHys1DgNQIn+S?= =?Windows-1252?Q?16UbgyVbZ8FwJCqVRCcB56pL3BV7bQv9wsCJUJbSwXqFoLixwcpCHAaZ?= =?Windows-1252?Q?IbPya0He6HimTpaZfdtn12oDCxZ1d0Xyrm3N3oTjgw9LYJjYm10QRY51?= =?Windows-1252?Q?1I2rYA/VJ9FWSxo/HDP0dtJEo4a5QkWY2Z2HvxyYVkk3SqT+Jcp+YuLv?= =?Windows-1252?Q?Z39UiQ+3fasDZsX3dGtUHlfE5XEzLnUdXruPpurZHRF3lapovEd6r93l?= =?Windows-1252?Q?vrpLcZASbl1qhTdB1lxlJAIZP51RUcMa5RoPhczBjM7t66L2UlSBliXS?= =?Windows-1252?Q?4XHgsVfLCHmR+IlpWXxhJ6ontMjb/OxHr+eiWGfkPi7yP6061qQkKM6p?= =?Windows-1252?Q?BNbQU3ooEqnR22oLo1NaTCfsEaL2WKdne36QNhbF0WFDqyCylRFZ8y5D?= =?Windows-1252?Q?KVHMbRYfaOEmYhnVSdWeG3Up2Mma2vrFENhAkaawWKu9R1klWcBJVk5c?= =?Windows-1252?Q?jXvGL3ld6OsfvfYp8p4RE0bYEUlHutRID9tf+cZ0XjKjPiyeGODSW3Yo?= =?Windows-1252?Q?MTJyJLw9pY6xBL6eThu6GSuYerdbpPldlsyMGjUYepAKzKWnFh7fbE8z?= =?Windows-1252?Q?SAoci63tormzf/xUNtFn1zSZUWFrGPOerc7B2nXFMLgF+OdoCeKwvLzW?= =?Windows-1252?Q?pmMbciwPWtoN/XI7dkAr6Dmlu7ZmXYTdges7jpR9fthlB4zxaHfkwF4+?= =?Windows-1252?Q?KWWs0hOxKnEyLnlWDkjVHNNM6Pe3UdaChmYeGsflEFgKANdOBmJRHF+k?= =?Windows-1252?Q?7+I9DUBUSBBz9jAZkUXyO04T85Fvv3dP15pqVR3DvB/bd4W2iirxZgHp?= =?Windows-1252?Q?LQjhxZEjBMp7qeLeNH/ZCwOFT13V82WguKmvCDk3YOGaYkugITAwa?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 6:+u9eZ/qIvTKd7g9Pb8mnlA7R2Gwabs0eG1eeqfFUlBDxgilxo4GKlm3S5SR4KVSuq0YlMedJt/FSy7jhj8Tkxd1Jmr9Y2MXFhgt2rboiy3+1/P4S3EH/YNFItjHHw3EDIqclNWmgDHbBZ3krWYfO+R5dEJn0Sj/WAvsLaaCaX4gGjNB3QXlt3hC6ZcUzldVr7Rl8gkgQvVtEuiPyKED+dj3AfR1AMINVqB4OHeAE5rgGvZ8lrkNB1JT6x50IIisVxPKXj9yu1vEyhcqvBdo0FTwX8x5WuW2AFiePOdaEahPtcR44eq6Hq/qPwVpdsGBn+i21BkcRg2/y707Nzitwy8d1J6rYF7JxtrOKb5dJGbXxEaKSoKhckcOq0DA3tPyac+6so21N/8zPWSfQkB3jvwq5jFmaXzsCZg2nyIfp++0=; 5:iJV+K5heXG6xSf80ZlJWL2E1pQXjgCrWJyrW0PKYqxK0ArYdEGVdVOHzsr9g7R4nSiiu9Y5ZtYzjO4xMpnpMvIcHZuCCfN0X7YnUu8yqlQfshgzfnLS5n6jQuSVDl2b/1SRe1VndapunmJCA/Ul41I/d08ozcuaZXZas/Zqcs0Ek7SyLHi3AhoHEQ78O6R+E; 24:IgAidSj6CjBdfmCXAg9+grviOCBDHAHOuJcAdXp61ZanvgFpAOqdI1YVOzUpe81jMqJDy/buojarN2Vn9bWk6xMONic1MPo5CdmLAMVtxjE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0724; 7:GStwLMDWFgoSFfXban3pCaQ9j2xbVlYfycUIVIytdg0V7uWpclrXp0I5vuj2XfQAWts2lwFyPQufNEBHQEm9vozPy+ikPYkIuT6IgYoJ+SHYjeYcO1oN7nb9X53djuQgFN5MWPkkLD+gitkpGjBrOxQrwypu6SPpJXOfqGWQ1V4i0cS78dTu4NWe1F5MU5B8FIFyV2PUEkS2mnRAA1s+kPfH2/XGqYU+QLyxsNArGooZhHGPZvc49jSXsjGNmeo7gyX7ENVN4vzHze/qzfmCxOHVMzVJ4vJPvwMoSJKBVpvg3fJIgxdIdQCMQbTO+CEOE/jC1rnIxBFyizhI5NIjew== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 05:30:06.6749 (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: BN1PR0301MB0724 Subject: Re: [dpdk-dev] [PATCH] net/thunderx: check data offset alignment requirement 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: Mon, 06 Mar 2017 05:30:12 -0000 On 3/4/2017 6:16 PM, Jerin Jacob wrote: > nicvf HW expects the DMA address of the packet data to be > aligned with cache line size. > > Packet data offset is a function of struct mbuf size, > mbuf private size and headroom. mbuf private size can > be changed from the application in pool creation, this > check detects HW alignment requirement constraint in pmd > start function. > > Signed-off-by: Jerin Jacob > --- > drivers/net/thunderx/nicvf_ethdev.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c > index 1060319..ad7b5d6 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -1410,7 +1410,7 @@ static int > nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz) > { > int ret; > - uint16_t qidx; > + uint16_t qidx, data_off; > uint32_t total_rxq_desc, nb_rbdr_desc, exp_buffs; > uint64_t mbuf_phys_off = 0; > struct nicvf_rxq *rxq; > @@ -1451,10 +1451,17 @@ nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz) > nic->vf_id, qidx, rxq->pool->name); > return -ENOMEM; > } > - rxq->mbuf_phys_off -= nicvf_mbuff_meta_length(mbuf); > - rxq->mbuf_phys_off -= RTE_PKTMBUF_HEADROOM; > + data_off = nicvf_mbuff_meta_length(mbuf); > + data_off += RTE_PKTMBUF_HEADROOM; > rte_pktmbuf_free(mbuf); > > + if (data_off % RTE_CACHE_LINE_SIZE) { > + PMD_INIT_LOG(ERR, "unaligned data_offset=%d delta=%d\n", > + data_off, data_off % RTE_CACHE_LINE_SIZE); Do you also want to log about the particular pool having this issue? rxq->pool->name > + return -EINVAL; > + } > + rxq->mbuf_phys_off -= data_off; > + > if (mbuf_phys_off == 0) > mbuf_phys_off = rxq->mbuf_phys_off; > if (mbuf_phys_off != rxq->mbuf_phys_off) { > otherwise, you may add: Acked-by: Hemant Agrawal