From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0089.outbound.protection.outlook.com [104.47.37.89]) by dpdk.org (Postfix) with ESMTP id 105C63B5 for ; Thu, 23 Mar 2017 14:20:30 +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=LTsy3XA1pSZ89CeVDSlu9BXi8/m9NpSsrm4PF67CoRc=; b=DehH97GLJ4rqsofu7RUXpzLt2i9ODEZprkQouoksHdMKmq1GBtAUQzByJtXIFd1Jafo3IR77grbuPXb1qbkr6j7pE6SdhNrLB26wJIbkxGro04fUS90vMQealHoBh9Ioh/ZMAXRJ+FoSiph/EPRfqWofZELwsmfRaBIclt40TVA= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (171.76.89.237) 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.977.11; Thu, 23 Mar 2017 13:20:27 +0000 Date: Thu, 23 Mar 2017 18:50:14 +0530 From: Jerin Jacob To: Ferruh Yigit Cc: dev@dpdk.org, Christian Ehrhardt Message-ID: <20170323132013.lg4f7k26o5klsgyn@localhost.localdomain> References: <1490019040-6268-1-git-send-email-jerin.jacob@caviumnetworks.com> <20170321143832.swnf7xetxlxc3k5w@localhost.localdomain> <8059571c-9747-ca33-0d61-f453e43afa48@intel.com> <20170322093931.2u5z3n645cnobi63@localhost.localdomain> <526d95ae-fe16-6c54-441c-32368df01c7d@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <526d95ae-fe16-6c54-441c-32368df01c7d@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [171.76.89.237] X-ClientProxiedBy: BM1PR01CA0066.INDPRD01.PROD.OUTLOOK.COM (10.163.199.38) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: 30525233-61a4-4f24-401c-08d471ef5fea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:7iJ4qaEA+s8mqfYRIfdl9KHhjRTB6WFatyeWAXjYhUvSSVN5uhP1mBa5+J89WgOSQzTp0CCU1lxQX2RA+qs0bqpvM/XchQ9HKiIjCd5yl0FeKOgKgqJWfpep6B4DWK3hEE398r+J/+dWV/4aGmu1z+EgC/cR08fM719K63G7iH6zWKoFX455CeRsfT5AUZGb9LD16LAn6vIp8ixY+4Xxut9hhB/bCvYFuIsFb8uzY2sotL4OS2cNWJpqVD+6gGg/NcaqegUoPonXWzKp5HtuvA==; 25:ylsOWHA7/md9OWV0UwJL929U0pXq9s4OauQQ/dqjQ8nGwqfZNJ0I7879wChrKPUGaMyKyu2wVPUmgjhTWWGKCS0y1NePMJ9KgATHYoYgHTkuImH/BgA345x0EK5jmdZZCVVlPKYJgbUDHHUjfZJsu/5SRAgIZb022BqJdx5DtFMod76UrW0R10amJVyXQJdtxUhxJa/btaXgiJAF855KOzf35N6oPnM5PnbR93QX77X6OgqtQ8AfjHauUX5H/9PjZ8xf+du06k+vgR1Efa1JpvIVnzvrNV7GXbXliWPFLvx8vI1TiIXMpwTquHcyrQBqpjT6f3Kiz3BCPg4LUYjTo9UKKXKvJVgicSBkaCAHR/noFMrUCHIBpoO9aL+kHkIXP0s1RKOCvI7jK4DzD8VxcRXH6VOYGYci3cQv4eP8K/s/Nk1go/TQbkT+4lfqLLSZT0N7c/4+gnhdLAqJsb2aLA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:iMPvi8broYyFTKdirwOQtplPPgun88fa3+/m7S8jWIdHJ/JbEahDlB31Ne3Ai1Mz1tqR943cF2zF8PxG3KkylFsuAHBwwDJl67ANDUWvMTMMHNsVwXr5GT0Q2/6+2tR3PN4oMwCJbSRlKJWIyrzpy8V4PX3Rxpw7IOGpf/1MC3ESsfXm2S98jO/wwkBEdiHWJUj9Yky6of2dzWiFXpcFF0DeiovLBFzL9fVlsjSXKnhsZBva6LqD+ylal7Ivj7AEFtlaZKGYYZtyaqipiuN7n5aRVuhUSUYwk4IPjOcBtcY=; 20:xmTkWs+5bv1KcrX/XwGw1M4fL35zbcsYdtMAyxToCIADj9SZGBklDymB53qf02IBWR1V6JZb92TRvea/mDW0oUIHonOA4dQIyvpguts9fCgQ3UFwXQZwjjcu5zMmVrHZ9vw4+Xb5DyO8KnJ5UGZMqZOvtjr4hCdgmGlN0LQGo8zztgEPl2tzPjEJ+Bhghk7+qdeiaX4MW5OTvtmW02KHGi+GaOeSx4Lps86LjZPaVZmujyh38IJtv8xwanGcyUFO3qCBagylGIlPdEY3c3llrntVP8zhZ3iglEWzUO+cHFXyveeLT7SL5Rq1GB6wgVd1iyloj0J+ud0FHpXDszUplIMOnMfHdJ9qxf+D8TgjbZlBbhFTHKfizCiOgghUD5Oq6QXKOEunYBCFhHxmSnFhEEC8XSHaQKaqI+c6hCJKgJvNQuMtoCcjqpzxYOp/FM7cuP+DXsK6HY+OTZzTm7nLu1b0JswxzAyiTslHn4EqMfvOSlN/yYmEerkzPYAb1UBY+GXPFaB7R2PAQ99nvWiBcY+hTjpWwI17IlnJ+cPTKeYVevPiN6ZlWXSaUIGEEU2yjz5YffVkGvk7TaixRiR3bzChFUv6YraEKrOvlB+Ndkg= 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)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123558025)(20161123560025)(20161123564025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:CLhYqd6q8ASK0f2TWKLpQxulmpUPSasx44hPSuAoolwld5fnQhUhZJ7cTbxVjJdy2dXtJOyAKr+xxwR4OKpvVqoRxQXCt5RFdg/n6We1tD+FeiK7o0x5XVLvEdhs+4ows/9k3W8Zv3S7CStFZ2VYaTkWWYsCX2kezdw0Be9NtTjjWTCOT6gD912rJcBU+pZkeXTKuge4BzryLo0X1AKuSiGHvaInbEb1J4Rl7lXUslU32xfiqt/g613hSpbiGeBl02WXiJK76gBjXXCClxudkvrTvBk+6GwDkgb3kHEvj+60BiHPvpQLHdEBbwEjI8uEqapBd5YBZpWPwV14EcZTpgelCKhjsyHHFxH41lhJ5jVsZ80sIWVfA0AM3DeX7hzR8sk/iLfnYRbLmxaD+tSDxzTd3SdysNzJhky8aXP8fiw9jhQJJV0jA53Rz8hEwf+PzMAjwc2eeyB5f+Yx66SjiJX9A3SDwJPhyJYpFQYsOkjfR+fSZaQmAzLP3pz4cSYFiZZkemjKieh2xjHtO8SGE72ucN1EXdo6Esr6UedcWQtBOe0D080Bib9o6yghKLPYnlSk1EJL8GoMb8/cbJ8pbQ+OKUiprIVy5VkYCrh1epE= X-Forefront-PRVS: 0255DF69B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39450400003)(377454003)(24454002)(4001350100001)(38730400002)(6246003)(189998001)(110136004)(54356999)(6666003)(53546009)(25786009)(66066001)(42882006)(76176999)(50986999)(61506002)(2906002)(23726003)(83506001)(4326008)(47776003)(3846002)(1076002)(6116002)(5660300001)(50466002)(6506006)(93886004)(9686003)(55016002)(229853002)(53936002)(33646002)(2950100002)(6916009)(8676002)(81166006)(7736002)(305945005)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:z1aaoEfMpV8AfwRb0z0tq0LEJbTp7qiZEGRBqfQ?= =?us-ascii?Q?kULrWUP2k4e2H1mn7Ig6pVqRUT7WUuW2U9162+DL4XsFWnehQp1KdYaHajV9?= =?us-ascii?Q?11+sjg/hgtknKfiwVy70pS3IJyOQFenZ6SD6wrkcFcY0BNkK1YFmJE9g8LRS?= =?us-ascii?Q?xI4t7UGMJgjeUaKMYMpNc8bAqj+0g2CRIp2X6FreDDEADy5UxRTDz+00KPdk?= =?us-ascii?Q?RRSHkKfpK8liOKnFOjon+XF3g2AUNigmEOSgKtxABxBdV6fdI5MM1OPpQW7n?= =?us-ascii?Q?hL4gLrl6ZUoBimuPmQRR2EczTP3OvHGOM7YK1fF2etlcKVmvUYHv8c9pI4W3?= =?us-ascii?Q?S26wJQ9OUgf2tN+Z3Dm9cWoeHOMq2xSc3z2SyVwrRhj2TO/VQ5A6eTzegt4s?= =?us-ascii?Q?GP+VkzstvPRVNQu/lX8eXJaJLai0M4TQCd4ZHK/cBSWZ9yfJMMYDX9s+M4L5?= =?us-ascii?Q?50nM81Jx4BkY/Qkdh2Hu1oBC47QP6/6sUOt1LfDtpd80Jw5j4jsNp7SC6GyU?= =?us-ascii?Q?eQD23/KaW765mA2ZsnanP8jYw1PHF3y14oXbxQrrV4bDDTY8938mr+qKLe5D?= =?us-ascii?Q?sdwNBwq2nEx4SIt5UvFFF2H58uDwobDKhd1WdOAjqcRkuyo6+O6XZ4unApy3?= =?us-ascii?Q?H6oFWoPSTlan7DXl0G/q+2z+6jnDbiParhdNunzhHWNRRBNLqzjPNmsMZfec?= =?us-ascii?Q?yA1Djl6uHH61pzAPwmLSopjCG5VV8PPB+/Lj/1fRZMs5/1xHNxBbwpfE3yDE?= =?us-ascii?Q?ZwaQioukuUdjP+sUNBZuoBE+2w6IH7ofBWcL0rqYoROOxnQATlh0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osticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:mvW4hVtRircAV2QO/UGpCStV4Nr0EncmwKQno8feFOnQBYniWdL5+0n4UXXZUbbBAgDf07WGwEhIGh5khwGQG4OR9e3jCawI46PRKM3mYiQC71xIQwiarHKC+ifX/ovoTtMJxRGfBSYy1THBI8pN9X2Clw614YEixSZsOi2WOqOJ3ko7hTfy0enlwpkhfi9x9uFHL9C9/oMq7VvDf6uBbBnaqFt6vv+fx2dXd4mgnJiGLz5CfRZfVjy3aCNr561JsPDaY2WQt8lWMBhV1WSD7bwAsiOKn1Bhwb0K7saRJsJ+U7pmOtk3F1svFS8VHFlrmkW9AJOBAfiWOgZtXc3jHg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2017 13:20:27.0249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: Re: [dpdk-dev] [PATCH] net/thunderx: sync mailbox definitions with Linux PF driver 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, 23 Mar 2017 13:20:30 -0000 On Wed, Mar 22, 2017 at 10:33:14AM +0000, Ferruh Yigit wrote: > On 3/22/2017 9:39 AM, Jerin Jacob wrote: > > On Tue, Mar 21, 2017 at 02:53:29PM +0000, Ferruh Yigit wrote: > >> On 3/21/2017 2:38 PM, Jerin Jacob wrote: > >>> On Tue, Mar 21, 2017 at 02:31:41PM +0000, Ferruh Yigit wrote: > >>>> On 3/20/2017 2:10 PM, Jerin Jacob wrote: > >>>>> - bgx_link_status mbox definition was changed in Linux > >>>>> commit 1cc702591bae ("net: thunderx: Add ethtool support") > >>>>> - NIC_MBOX_MSG_RES_BIT related changes were never part of Linux PF driver > >>>>> > >>>>> Signed-off-by: Jerin Jacob > >>>> > >>>> <...> > >>>> > >>>>> @@ -157,6 +151,7 @@ struct rss_cfg_msg { > >>>>> /* Physical interface link status */ > >>>>> struct bgx_link_status { > >>>>> uint8_t msg; > >>>>> + uint8_t mac_type; > >>>> > >>>> Hi Jerin, > >>>> > >>>> Is this modification related to this patch? > >>> > >>> Yes Ferruh. > >>> > >>> This was related to the following section in git log comment. > >>> ---- > >>> - bgx_link_status mbox definition was changed in Linux > >>> commit 1cc702591bae ("net: thunderx: Add ethtool support") > >>> --- > >> > >> I see now, thanks. Since this is to sync with Linux PF, shouldn't it be > >> used in driver, perhaps something like in Linux driver: > >> "nic->mac_type = mbx.link_status.mac_type" > >> > >> What is the point of just adding definition without using it? > > > > That is to keep "link_up"(next element in the struct bgx_link_status) points > > to correct location after the kernel change. > > I see, thanks. It is pity that new field added into middle (or beginning > if you exclude msg) of the struct. > > > I thought about, the backward > > compatibility with older kernel, Is it OK to use linux/version.h in PMD drivers > > to detect the kernel version? > > Technically possible, but kernel version check has its problems: > 1) Adds maintenance cost, which gets worse by time. > 2) If added a compile time check, it creates binary distribution > problems, distro guys may not like PMD has dependency to kernel. > 3) It will create dependency to Linux, assuming Thunderx PMD supported > in FreeBSD > > > drivers/net/mlx5/mlx5_ethdev.c has similar > > kernel detection mechanism to make it backward compatible. > > Yes, at least mlx added a dynamic check which prevents above issue 2. > > > If there are no issue with such approach, I will roll out a new revision. > > Is there any way to detect this dynamically, first things I can think of: > - Any mbx versioning to rely on? > - Any common NIC user header file provided by kernel, to use in DPDK, to > prevent any this kind of issues in the future? > - Any msg size value to detect if mac_type exists or not? > - Heuristic approach to other values to detect mac_type existence? Thanks for sharing the options. First three options wont work. Heuristic option is pretty limited, mac_type value can also be 0 or 1(same as link_up) So I think, The best option now to use the patch as is(without kernel check). What do you think? > > > > > > >> > >>> > >>> > >>>> > >>>>> uint8_t link_up; > >>>>> uint8_t duplex; > >>>>> uint32_t speed; > >>>>> > >>>> > >> >