From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0084.outbound.protection.outlook.com [104.47.34.84]) by dpdk.org (Postfix) with ESMTP id 1E59C3772 for ; Mon, 6 Mar 2017 06:33:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Rr561nVcWLsW8Fq36V5UBwEOupQlxzL6R2VO/tD21V0=; b=eGufJ8BisCbEP1ttX0CEuHT8E7+uB81isgHpUU6/q38JYFhLwpSRldfkctpR8XVv3EznhEQz4+h70b5VL8DF6mZV+lLpV2Z/TaHvfRGLVRdZ57fOyZkWfhYv+HyYlyfDZqq1O32/ajI3FruMY8RLdCSHPXVx4oMsSLnBZpcSgUA= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (106.200.218.207) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) 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:33:02 +0000 Date: Mon, 6 Mar 2017 11:02:48 +0530 From: Jerin Jacob To: Hemant Agrawal Cc: dev@dpdk.org Message-ID: <20170306053246.GA9964@localhost.localdomain> References: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> <2c0a5f47-3015-cdee-8519-1f602fa0240a@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c0a5f47-3015-cdee-8519-1f602fa0240a@nxp.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [106.200.218.207] X-ClientProxiedBy: PN1PR01CA0109.INDPRD01.PROD.OUTLOOK.COM (10.174.144.25) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: d157c23c-b792-477c-9a53-08d464524349 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:DWx+bs0fP1aSVUB7QhvLiFgThJSimlEjM33NyBA6YqPA4lsCgwKQu6B8Nsf3Q3GyiKcyCp6dShnpzLFzyy7f0ITDyN0q+1xsajwpgOyGh2yQrw3oTpO8dGJT6F8Ebqyk4CuRXy60tgpgNW3oJJthUtCZmmo56cVX9eVR2Cim/nbJJ3OEESwDWcDrnMEmUjw46gKebdvoe6c0Xq16ttfxgjqkpbP8zC8Awu+IoSXia/Tj2NJOtMklq4xYUiUVhrMX3WZGN2K8/VEqySgjlH1zLA==; 25:OK+YQ/LiLMErACuBo6rfDk9sUlHlGSKZL0nSLeMOEED+WaJ5Kxj9CbXu+lJfQOaitcfCAlcp78SoVh47wQAyVIoE62VME9+CmNM/1oI9+uR/n0qUXfT4SCM5qbdQN3sq0TVs86W8ASU2QsyKXl7c/MEE2GhjbSVPWzlUd6d+bvdN9qeuTW2dCU7/9rNguGouhhwl9Wpz313bmarLOdBs+jAOciQzpc23zGGEcG4L1srjQvQCvwJ25dtwXlxSya8R8E/AR74zFvhCadiJCJkWh4MFt7mQ2Bq8ivhR1YV5Nvr94cWgix2Lgjok6AkBqFNElpkE8QZw7ON/iG9BP+Sy+8zWWbehYMwaAtT3MEAU2JyP/N8YAuGGJ2phQnMTns3c0ARorQQWnWTjrS0N0gj4qjxtReC4sTNz/gcDKlm5Wry21W3zhnuVOiFgD6R4BSiG6Wu6aNsnCLOjGeD9aUzyIQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:ihBosFuOVNOGwyFPLgzrq+eNhdSjGhjSQfdb9LNQI7OQbZUOV+PpJ1GmyEH7RS2+Oul0CbS4+s3Nk0e9gbQW23v3D3B4b49i4YCI2p27348NSHMg8jDG+Rb3A1Alrj2qqxEYrn1QIDbcn2tf2E54QFlQzWc/XaKQuL4u1luVoXKXA9Ew4j6ULWsqdWYj9RS8PGF2Zef+LMyng6C79uaYXyp92CSI54W2hlbgL907coywhm2fmdyIimCglVdphy58ShyN3Xxc6Rjnbd6MkKIT3A==; 20:0X9ZixLxPne3GtgI6PaeP6f7+s1TCyiOHY+elo2L9Iogx+R4z0y2dQjEMEIBa9QH/byj+Nbkb4yHRa+nqfyk4D0uoMh7VfBHLDYu0Z3ov0CmL9INxWD8d8phwG24ut/MtAyVwX9wlv3z9kR5k+FDsQuYXwnjXTxT+Iy9JVWfQTMjSHobL94TmXz/cYEuVeq11HMzGdq3MaKNtknR/8vwUsAAhyHNG0CMDwwSrVmti+PKxMy2uW2QRHLrX6rnz5X1mClDcZ42JIFDzVfhb0VuefkBEt6NDrzuwBIT2dEqbswaEEyMbgO/v1vbQ6t+3WVrs6/qsUo5eAWSBc6f8nmO4GBl/wmCKzgZ57slaRUnmbJPB+gW5Gaw74pVltIu3cLn8pBO/utK0tdyKcdXSUc07q/xH6FJtRyUBrDaCW0vJYM4PPUKE4z5HpyTUp0xYeoYXLozd1j10dyEI/2QPnjW20ZFMsb9cXY2G6bJWm8HArYSe4WfYN8FcTOnQlCcyrfz3JzzE10WXIvvNlXIy177YZ0PjdHq1YfNKrRRst4iuZEQPJmyleL56KkA9bmlfCiN/+6je3cDSPTBrrogAmYCD/kVbTWe5qevioWQ2qK3Rpo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123558025)(20161123560025)(20161123555025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:rQE1W4lugyojuwMeZsL9VGxXHUFeEIqU16+GhJkj+KNAbnL8igXcZKGip6c4XWKb/cR89WtXIPQOWU5SAfCOP+R6XGrD0flDXE7k+jGv+xNt3wU/TGbppGAOF+ampDnYgvB5O/bk3cF3W5v86LO5MfyyVqgnkf6WVt6ivSrK1hJaYwejwp9SFSAguDIROJr4lG8MnM22/eZkrdgiOqIAleGbcQB27JE6mMO+D7Wf+RjC83bqE2K+Tfm0WV7J+boTOrRyBNOXu91fiWzsoALDa10Rem0Pf2fEpR/vh2wJZbAheyFHncGQIBtBPd6rYCrUptjc3WR5qDWmexTF2xd5yn9scvJdzFb/1k1Nwyr+0sevy36KBNGIk8rSDldhBHA8Vr2HFHmLxfwj2vKM5yy8OaneMo/Ar7CR+PMwXq+F2KjR8ciuTBmCMN6aF0ea83qIKlQ+ppuzfkJU/UK89ySZZZeSGRRhCKvQXNhvJnds2kGHCVrVeWL1aVHzMVsHujoSo2LPMidv5urJJA/EcjCyzYrgoX4WuwyvNzgdjNVAA1186gSsHtJjiA4oGqncj3xl+EhDcqwor9Mpu9Xw+5WEOCUUkbIA6n+V3lEwBQq+7K+JXlGVXSkLkBScJ79CtRelDkZVo+hMUphnzQX31DEdvg== X-Forefront-PRVS: 0238AEEDB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(24454002)(377454003)(1076002)(305945005)(4001350100001)(54356999)(50986999)(76176999)(7736002)(189998001)(42186005)(2906002)(81166006)(8676002)(47776003)(66066001)(33656002)(61506002)(92566002)(55016002)(5660300001)(53936002)(110136004)(4326008)(38730400002)(53546006)(42882006)(2950100002)(6916009)(6666003)(50466002)(3846002)(25786008)(6116002)(5009440100003)(9686003)(23726003)(8656002)(6506006)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii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pamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:4NxeLHZyHC+Vef41q8K8WeBoLfF3zwuyIH4NRdNg3VXZHm5KwUxYe26xrySxQY2DcA6C36jiZCIGDZFtiEB3B/GasGGfLW4EwBx3OSRXn6mMyxZ/KdYnx7K8rjdDPEGBBC4M2y7gbmvPfLKvyFFJAp86fXnQVBGlITHq+kQRtMahXsiJBMESU9UWImcYkDzm3RAyQv4m4wtd+PooUsMxrqTBF+7Kl76tlL3l0tq2DT/A0mPq8UoEYL4V1S7zb2iWctVLvyeiq08CRtLoNRosc0Ux5WtYUCMWv4nKN+Wf1Hl7ehH8xObqtC+vMZPnEuyMzAadvo7wOLn8d+CWIIBjsA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 05:33:02.6324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 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:33:06 -0000 On Mon, Mar 06, 2017 at 11:00:01AM +0530, Hemant Agrawal wrote: > 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 Yes.I will add the pool name in v2. Thanks. > > > + 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 >