From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0077.outbound.protection.outlook.com [104.47.41.77]) by dpdk.org (Postfix) with ESMTP id DD986FE5 for ; Sat, 4 Mar 2017 13:47:25 +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=L+s9vTXPutd5TlJ6DXkU2gPGfxPIXwb7uABw3uI8tpc=; b=j4Wmu6+tGuofPG13gEAaFxZrlMn3DgDJDmlBx+umce+8rpIPwfRq60LPBNaYF+rXfWuIPr8y9qijF214FU7AZ3ZuUkFkr2lOdCgUxtF+gS4+r6JrTShWTvQUk/2EJz2tAKsmAu31br+kijdMuq0G9ySrF0bOde6pFj3CfYB3X6E= 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 (14.140.2.178) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Sat, 4 Mar 2017 12:47:22 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: Jerin Jacob Date: Sat, 4 Mar 2017 18:16:55 +0530 Message-Id: <1488631615-5452-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0072.INDPRD01.PROD.OUTLOOK.COM (10.174.144.140) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 29e7bac9-94f8-46b7-3957-08d462fc9b38 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); S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pfJBKaVr0ylN4O0gS8gAjJR0h; 20:hz0gsM2fAbpEsG5/FXsCvqwsbYU+DJ8dWkYFiqZYey3OXBe0fL+kUU5GvfwUcH65OWoWTlXK64XYAtwp8NcjTg1lhtypD5w6qByhoQpsej6ayDUmSyMz/bGeWBY0vosHY35kzTZXiqXpcaORHC3fKQpmYJayAZgIdDS0moEPY+mDaaqPOL7EqeTWzU/vtElHKuREB4xXL2gzVc40amp4lU3Ew6uL/9tZey6iSiKHqED4hVRxOJ+1rT8Wobw8jOqUrhqoL1XrMgk3W3Yc/qTqc5I5nbGNnpgx3S80QojaNEIDUZbKV6hYrpmnDV++40eMgya9ZlHsyObVSe0js7r1xt3v6cL2OgLiNuYb3gJjQXS0fSMRyl1YvHP45aQuwrtW/smt+0Px09Ys1rH4zvnvL41ASbTKcplNKGXm52OaeXSaEz+bK2MZCgXnDDHaUuaYfKVe7hdZhzM8fjxt9o2kePTGC+UufHZ3SfXjhL+Jd0zvbjfFPtVC9JmqzaBG4w2fUh/WmqE50kIA+9z9Z1c2LQa9Dz+bc1ua9tEstZqphbfbTCceKsXK/mDypYmJq9+thPwZ645c0G2ZsB4JrrF/TBHkmLDjtNZHhJLbbpK2/xk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123558025)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:30TTktHJtTAvlrknfATxIWLnnTyJq/VuBEMwga5ODy4EeSh1urVuY7HXv5n+tK2PyFxz0bU5m7+d3E82PQvHFSXKLp5m7r+fzEfykNXvrC8hF1kDaxB0y0VtBhxzpVJTJCt7Y/0Ql4a6xlQamstAz7sMJjxhLf8+XyhPnOgVnLwAsg9ctRU/siTOeIBlNxbhD8x/yiv61tPqu1aSqDvfaiWwY6UQ80svWfg8ckqMNpte4+f04eqrl6mwyb1w/O6WMuTsqDSnnlBiLEHSmSDLE1RI+2xgTnVzG/5HhdPfClVPGaS2NNUw50z2f0pd3DfG2024ViIMU3gS5fD1ayHlYr+4anaJJVNufixCbLB/MQ2j6W7FkUh3+ysevUavtg4ywgF/56/9cya+rw+b+ywW4Msn2SSjDRvT8uBCn3zRiaZuXrwU3L4X0p1KW+LpJWz+aTVqnB0fr3pbAQBDqmxVJypL/Uv8b2AcXzaERjIXq09jOwYERFiCRKw85DMRbzWtHTWCjb0g3lsNGAHBwDF4Z7O7gKkXHeMw5xtarBDrlwpXaVQjFW56YJWv+fIwcydgXdmoZqJzyf1Jsc7jBQOJQ9kt7QNxXBGpDrJ8JdX4iGc= X-Forefront-PRVS: 0236114672 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(3846002)(6116002)(47776003)(2906002)(6486002)(5003940100001)(50986999)(6506006)(25786008)(66066001)(5009440100003)(92566002)(106356001)(5660300001)(305945005)(42186005)(33646002)(6666003)(50226002)(8676002)(81166006)(2351001)(2361001)(6916009)(42882006)(4326008)(6512007)(50466002)(53936002)(189998001)(48376002)(7736002)(450100001)(36756003)(110136004)(107886003)(38730400002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:x3PuIyWzbmPxPJmoLcQSqjOR8jU+TXQgjjHdUyz?= =?us-ascii?Q?xXkIyJXhS5h/IOxI3rPX0pnBU/8HHFoUaPPnOpwMd84k6K5j8EiSEhmwlc+r?= =?us-ascii?Q?5u4Fy8+1mNwsrGNa9LRXzJINKYhhf3PPADlKdUA0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NL1QFCl0luVjEc3UTivRf9Keq+NkqsbScK+tqLBWOvhC1KetAj8ovWCIGePePKe4HnBg74o+l1+t2gD+Y0oBI3DFuQLp158Z5jcT4puY9C0+kg4bACgtVcIe+nr5uTh5I45BL+0RcwRgmo2XadUMYD45bCohAYR38krqGQ9xjouCZdftfvx7Sq1B5woC8PN2tZfddw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2017 12:47:22.4171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [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: Sat, 04 Mar 2017 12:47:26 -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 --- 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); + 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