From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0087.outbound.protection.outlook.com [104.47.32.87]) by dpdk.org (Postfix) with ESMTP id 2187869F7 for ; Mon, 13 Mar 2017 09:02:42 +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=2I6IpD/rFIgcIQBUl4EMo8TWC5JOGGvcZh6wfHns0aQ=; b=CNe001vTIjanmJCnCBA6XPRQdyZzdBFAA49adDspez4bxiFZ0GRfIFiAXKeTMSnuCtpVoGmqegFv+5MlPSlDq156Tp2MYOKDg2yTlfrgKuihvB7JgfgbM2PMp4V0Ka7UjkEs5pGqGpzD23Fa9iVLAxwbHiP2eGkbVeHeCZcFFY4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (111.93.218.67) by BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Mon, 13 Mar 2017 08:02:38 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, Jerin Jacob Date: Mon, 13 Mar 2017 13:32:11 +0530 Message-Id: <1489392131-9293-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0057.INDPRD01.PROD.OUTLOOK.COM (10.164.146.157) To BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) X-MS-Office365-Filtering-Correlation-Id: 563ba5d8-ef7c-4c39-ea19-08d469e7526c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 3:Tq/jSdOYdv2wQTR2r2Wa3idYNDOBRMy/V9nT0idruQz5MarvRrOpfDbLMTA/FmUFqHxFdKReGuNcr1kvY9SWKMqWGKm6xhel2ol/mSGA0pH7jsxPVpk3DfnDZUUey9R9tahIT8gtU7WrD96o9ETDHVuXN/Povkgr9KD4n7iAEfxRfPmSvix1HDPzOSPjE3RLotUztni4jWP31y9X55g7z46fjxjO3+IieZFKSPs/7wNrljd9oDKWQnPB0FGO7985QWKKrPtYvBRyzG29Ke/YUg==; 25:0bM3mb5ujarDSJvrHqjy42cItiMBYDaeZbaew6uKXvdZULOvrWtprK1OAzaw7WpeO9F3pi1hlGvLKYH4S8WvQ3HUbhL04HdHJWLcddmH4VqAOeKjx7q00W4ijsMWwA3xHpytZS2b4cwc44bVXahFnXo/8TN093goS/8mMjaijZo5Q4jtTP7n4SWFf8SqYEGlONxhHgKFf8uNua06WRMsdU6aEOYvfTp/hS8rCZS40CiIHtbNZz8rXYp0G9lkaAS2vo46/OMBTPNGMmYNu3ln/jaHplLbMDiUSFVHqBHNBastsiSJA5C6rxew4gzNZSkGkz28PkSw0KdLXvRTK2tnYYn5Zj4RcB/mx+iB7nutnI1p1vkOgdou4sqL+RRud0QNLgCf/KBrENqt0otq59UwXY4PRUzEtxaQu8VDpwx45N1KFrvKMJLhDtgKigdWivD/skijHM/RdRKXcfUhduNWNg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 31:If/ozlIc8x6vQipnaHqSIhilH+n9YxCKHlobTF0pBFRqX6zYnDd/9EnE1hbmRBCj0I1zgfIpNMtqatIOkiid8sYJ7Dg+heLM7+Mpq/+YYOV4trSodkoxnA9suXx4NP7T4S148oth38/KKxDHRswsx5Eg+2pmkvdbejXS1TT5RmnUAfJuHJ6MC/vw/gjpZvjYcQX2guGP9ZzPzuBrDUall0eN00EUyTUuLxJlTH39uiA=; 20:9L8A3bYRqE/pU+MhjUV2AVAe5g1nKJUdm3kh2bJ6EjAi+WON2dSIiMUT7cNo6GB/FAI/FhDkMzYi2KIbUAbPOzPvzL0GM5vAB2kiD/gC/O2jdTjEPj23E2LO1hN3fmYycfNBZ3EPxL/sX5/JxiMswwEV3P0EhKOwcT+/M5QvEzzzwnaEcmyAC2mdg/2+CpXt9HIIxADt+fIyOQX6c69CXQLdYYyPq1Ue7lmjxckNbSG1+lQKBQUklOyney9v51xx/NMC7NRnBhbMfAJGxU/UACcFW6VJmp5LsNwW6McXpbBsCN/rY1KNMKbc7EK7+cCUNXY7Hf9ej+JBopFoXV1I58/Goh32T/PPBejTFTy+4PZt9U5kU/XJtgHpwJPlED/2V70DoGyQnE9guHBnCzro0eyGJDRzyvOViNRPmaCtBHIm7DSn59me9pCEZz5Dv3WBo0enQNi6HlYsaH3INLdbEgrEaE5xOmgyjNcE/9PhNUCpf9u6hcoXt3TzL+50tO/g0kXsLmmAg+H4H6hPMDZVx1mObsiiow+LOYOjfO4AkRUIYigciZw1/aMlFBognMOvtfOaArqpO95qPlMhyDrFx5Sh+JvrgvhZA9FhqUOzweQ= 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)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(20161123555025)(6072148); SRVR:BN3PR0701MB1720; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 4:x5c8SDIq+KoiKHEerjByozQCITQjvglcvM39BXntwKZIO5zVHtcXNewia51leO56ctFPLjBOZ2xZaH4C54Hg3EV1du6iqlLbpY2LDI5kOgQvyjdMRjxr9n+Q3vtvSH+a3ZP/9DWrJgVMyWonAsTYuj/jqYKOl39vXhmg21wwyRuG9kY4hMLxYXhwn1oE8UpyCKqIEBhQhRKNnW21itWGu0xlzem3hvylFOLdlNv3M+06EsVaUgF6W90+mKydRK06FEfIDvBVL3ZPZalVhslmUhnbf5aF4BO/iolphPQbO1aRnt9XF8kVJwD8WuHJy772cf0vANZIvc9R6rjUO7pQxaXgEBMjx3o3eV0hZiTQMi8Q9BcJt5DHc9ekUSS4T72TVMNufnF2vXjkreLatCyvI78PYZtI3vWSG7u+k/hMCpne6ZF2qkEZJK2VnSaU2SgIC8JNPvzeZCTy89McylNBo/orQLeYwy1F5xAq0+XKR/WQX/GS0psNpOQI5ioHFud2+VLD8Cw2Dp4GQTy6d8MU1Li6Yh05TtF8YJY47n8ltyAy9EbQZAHsKMIpcRdyWgld+fLnF2IN5yfSlc35EGGvwBQ3rNHf/YR4KFfYvxTte8qNjnQ4jIPTATBSnERPJcEg40zkmY4G0KuJkPyABfqbLA== X-Forefront-PRVS: 0245702D7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39450400003)(2361001)(2906002)(48376002)(25786008)(66066001)(3846002)(6116002)(36756003)(5660300001)(6486002)(6512007)(42186005)(5009440100003)(47776003)(81166006)(33646002)(5003940100001)(6506006)(8656002)(7736002)(53936002)(2950100002)(6666003)(6916009)(2351001)(8676002)(42882006)(4326008)(189998001)(305945005)(50226002)(76176999)(38730400002)(50986999)(107886003)(110136004)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1720; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1720; 23:5sO4eeKJNfb+4H42PlsJZ5Yhf22CLpT2L7H5Idq?= =?us-ascii?Q?q6IY6jkb2e+oFIKkfO5AdqbPT1q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H3vWsE?= =?us-ascii?Q?59sMlrW0NeLeDbH901bykySwDfICl0m5rPHKzMGGA+fxn2BVBR5GiQdiOymc?= =?us-ascii?Q?mBvevTWWJ0d5XB7FLTEG4dUkl?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 6:BcbMuP2P7uYVuq6i+TA0mJyVg0uPuH4GxkMdR/XDHiaW4grDYs8IABuKgRhMiBw5b9+/wPbrRdBba71S54sdxzQH1euqDl7l90gKKzP5jtjucwF2brQkYY0GT3dpeZiurL6OXy1Y35bMFOqamia0b/2rgPYMuPdOKjVrbw8Npurk1Gg0iHrTNuVeLBdTag1Rm/WwgdDhK8aQW5PhQh8z98YtplfofXPFTgLxXUgGHnRX29pK8RU2juQgvPMzDdPDh6BVdFqm4S2slWVa1CXqYTVx87Eq5gj9oF9A3pbbW/sn0IZ+s2LdDP1+UVcgMs8bvGvkv4E7GPQZC9SjjCzyr3p6gvkHACQciiLdWfyfblWeQa3QPGSF+m4PEsNgkc1FwPh51iPqr+qDNwyk2f6u2Q==; 5:cCfaGAbNhiBmrtVqqwGeryWZ1TIsLD6I4C+H8k4+OJQ3Ge69Ctpr6CNJO8uAgXqTEBoePEV7/kMZNS+Zs91FlV5U1ThD3+WBWbIavf8lg6oerlsgrUfiPAfcobb7ah8KNNw/FdSd0Kb1NwEWb8cD7aCEktiYQVIvat9qc3EOdp0=; 24:VSVTZg2b/3USNyYj5Vrvf0H8nwVqkKWcOcPWHSe8N3Bwgy6O3iUtuikGE+Vx5F03xrQo0UU2KsJpoCB5/UJt9ES/+octraP8UGJ91smamAY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 7:b4LZazRfYPJ3svJMh2FbqMdacDtkHBWSG6xdcZ5rDCevoRDcjcNc0M8oiPDXvyDD2I9jVQTIVTuRJox+b1zGR/4gKbPCAFU4ofYUFtw3rmCd4apvPWAFzv7IfN97qFZwTKQhhtDzu6fdG0tOgtKbTOTipUGrSg4wqUFQe3+RE7vwt9WPuk4KM0SUDCL4vdqeIL2W1Tm25cqUHBecegmnNE3sFSd0w3+m+QecXiiq+eTBspfwBpGjBzqW946hQcJKUAHkBYwPthd4usGBmo/hU5ry9tiFBKBmovQ7QK/GdQ2/LwOleQm/43532GdNHQ/swR4F2FZ0hNWGpi35OXX58g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2017 08:02:38.4344 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1720 Subject: [dpdk-dev] [PATCH v2] 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, 13 Mar 2017 08:02:43 -0000 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 Acked-by: Hemant Agrawal --- v2: Add pool name in error log(Hemant) --- drivers/net/thunderx/nicvf_ethdev.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index fa1cb32..5f34237 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -1409,7 +1409,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; @@ -1450,10 +1450,18 @@ 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, "%s: unaligned data_off=%d delta=%d", + rxq->pool->name, data_off, + data_off % RTE_CACHE_LINE_SIZE); + 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) { -- 2.5.5