From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id AB414695C for ; Thu, 23 Mar 2017 15:00:47 +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=q4Gi2a+Im6dVdrMIAErrNDNjKsolkXRyA/QTXJey6I4=; b=MsdWp7frOg/hAeL/fAjSR1A9nc10WPoCs9qvJEsYrmiOe4jDjK4JdOjEpMNC2UxHVAec6Gm9F1/fhSypKfJdmpNZNdhVvgFV6THPBa5GNAzuiItRRzX91gVgD3c+t/lka8G9Qe7+ulxrRzCsAAoFP8vlq/REdrRs6o2Lv+P6Kbs= 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 BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Thu, 23 Mar 2017 14:00:42 +0000 Date: Thu, 23 Mar 2017 19:30:27 +0530 From: Jerin Jacob To: Ferruh Yigit Cc: dev@dpdk.org, Christian Ehrhardt Message-ID: <20170323140026.inooqnbb6dq3jkjy@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> <20170323132013.lg4f7k26o5klsgyn@localhost.localdomain> <8f471344-24cd-2727-626b-84cc49c813cf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f471344-24cd-2727-626b-84cc49c813cf@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [171.76.89.237] X-ClientProxiedBy: MAXPR01CA0057.INDPRD01.PROD.OUTLOOK.COM (10.164.146.157) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: 8a6b2689-7f02-4808-363f-08d471f4ffa2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 3:qa24AefaDkQ39wdbaD4NDtWUx24IqqJV02QwoFrZjuNTG6ER/gB/1rIfQkEEHJuRFzXA9x3AurRKAFtptYD+su0xclH9gr7SoqRaf1N97GhOsRTjNURex+Zhj1msQJ/ftSUzcRRZuRmAU9/1RnmigcqyfRCj2weu9D+phGRT6AqqFjslN0FQGWzLsquaKxvxkfn0nELRY0/WyK4KlTy6VfTpWSW9rG3hHd+MqUkTgBUM9PQIVKZpk4Nn1dXBkWWMWd2Gw2Rvz5sx9HTVgD0w0w==; 25:cKr8SaI5NGOk+SKUiddJf8X7MkLZYubP3cshnRsjBj2l5peVpWNw30nHGcf7EGewNZH3ciho2qmg/57rL6uSMyrkVBM8v2L1aPjhPS28VUStjJ49KmY7lzk7hf+e5IHsF7rGgK4C1ICkSywn8aSbxo/bRJ7IprLQleMPfKAvnsJr3ejvtaKPASEAWByd+GC3PTNtzJDfMpJlAN5puZ6sZzgryxgf2BhoYISzO5DUOgqwA2iosgIwLAtvnqCLw/hZ4r8Qxtk1kQSDqJPLv8cq9fUYB3oVXR/PCA+ZCkCBNxEVzgzvSxibfxhbHeEOIpf/CwkAvi9q9pLW96/RzRBIekvaoQkCKFf198bKy/FXmI1eDZWhBCgkPRQN8OVc9GLXGFpUmlNotjxCIhEePy0PKl27iQvPHvTGBUO9OvK7CX2lzJW4CCbIlW+nAjBR9/blbFpsT7x216+FK8UJ9kp9Eg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 31:VZFze67+6JNAP/Be8SNlgC/QKV80Lrm1sARRrB66WNkikcxBvpPjBt0hc0UwpLcZgTMPRT97okeEtNBdWden0KEHOOkgBzAFPK6nKIZTMwGli8YAL/3jCsydXUQyJoWOZpc2WH0LmTirh1tV5LjDIeeSKIulHr5fLFg2Mxmiee575S0I4PjB/j5zgphTG9u8owEZJhfNiA+T7XqpuZwtYQrkh7m0EfAeyzRzTziP3totpvds35vSQKn5bta0sQIdNyhsvY4DUVsf7BKz/IRWWik44HeVKBeqV6G16LtMz98=; 20:RecgJFmPqO4SEXnUesQ0AT4PN2P59GEQGNuX/boNjKgBHfbJwCPqKMkrgP1ZaQtXKI3JfCZM6BLUEELWX8r/fhfwS2fd8lENxdop0tVDhP3hyJyUvqk1pS0t/V5lbjf8gAZ9gHiiuQbYVGWvTh9W5UiLExM0T3ctocKZqhF4fmZ9NP1FcljD08ZKvU5IEhRpToLwOCkPSjRFz9YWmORjIiOfmm7MgTVYuYstfktWQVp/Jb87cnKx+OQ/0Tp/q8d4Sw/XVbKIdMG/nYj8aAzQug5C0B/tBwLMLOMqV7jNpb3KBQPvABjl+9t+sKcCLI4vG/i06U7Mpe+i0pG6ZneEWJ88KKotH4US4qO190ycddnpp9XvOxIv6mX90m52gpJNiPyv2JUiMgkU3Z1OaTxNtLVbn8cKm1Og/4lD93qYFIkTWWbWWXPHPp0MyEmGAKhVzAhxME2pPCVd6kJcPLfD9Lxk9Ql8vx63hXzJ4Hhfc684VJkPzNFEQvMDm+busDB+GapIHSPkghvGhnIwTc68/Nk+FD7F/TPL83jHM59sdMlByx1LO/N2+s7P9unawN2Eq7zlowxiWrqGhmeh7i/C5sA1lFrHgL6fzQm7i/d6W4c= 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)(20161123562025)(20161123558025)(20161123564025)(20161123555025)(20161123560025)(6072148); SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:Mfr8Sfj/YnCyPNA/avy73gcjeaAit5eknEOp0wCOwu0UTCgQYEzlQxRvgY+IL53zkFN/uF8PmtG61Wu6lkBf4HzEt7CZUB1QZAzPWtrTqhYiOXEkiZmlAE+9B6HcWwX/4xJwYp26/EFfmE8jmaV+mDmsCzhAQFc2Zm11yxtsAD+roDalSNFJx6lWmqEYs/MMBTg3hwjPW5CKomDh5cZ3w1Fy0MYuBiHsGYe1EZ8VsVvemjtE0e2lxT9T9D90DEgdNLODP9bs8wpITlUTZObMrJZ97JOSDMdft3DFHTU4kM88UGa/2fy/kHYSYV1xjJczLMRHBZFvjM0o4h0KnKNSySsyEsOKmTj56I0T5ZaEeBcl4R0f67sCMcqHLkrD08JeT/+cM3vxwsbXvDpqAu3b9tZnfuzIuV56LJOrimFxiahInMXmmzr9Zxgtjg2AKZw+SgpwkPkPsZ0w8TJUNwZE0T5laNCxYGMyiWbzlx0TRX35E8SJhora6PwIBhVgOJThM9MWB7cHYxSczSMEpUvV5z7MS65BsNY33H/fu1DhFxp7QCyKH/rV1htdBMt+PcisB9YW9wQhB9pA5Tzpubko0/RhrkcgpPA8CXNXTUHOxsw= X-Forefront-PRVS: 0255DF69B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39410400002)(39450400003)(39830400002)(377454003)(24454002)(2906002)(7736002)(6246003)(5660300001)(305945005)(8676002)(33646002)(2950100002)(47776003)(81166006)(4001350100001)(42186005)(6916009)(42882006)(50986999)(229853002)(54356999)(6666003)(76176999)(4326008)(66066001)(25786009)(83506001)(38730400002)(50466002)(110136004)(93886004)(23726003)(3846002)(53936002)(1076002)(6116002)(189998001)(55016002)(9686003)(53546009)(61506002)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718; 23:s7kDzKRg5qDpfagqnEVvalylKVxhpZKkXsteAaI?= =?us-ascii?Q?qD/GqKGvrkKglSlb3BDVAavEKYoPnVCFsAR28+RUNrbdNj9zXvZi1+qxjn5r?= =?us-ascii?Q?P7Ehd2WYGJnWo+VFbmLc8+qQh2nwhaFeo5c8FGMMA1qlo30Vw8MWfeyFWDgA?= =?us-ascii?Q?4rER9FIgJN9Wj+fTAJsU5XSFE8siqwhmppI8gBmF5PAZgmN9qQXw6CD5RvBl?= =?us-ascii?Q?QZ8W8P2Wrj6n6FRWI/+bdbUCqTEdYJmUZ6wJ1eYqhgGqMRNUz7OdGEmIy8QC?= =?us-ascii?Q?fo/z2sHN427UsM94N/mttqyb6e5LTrK9uGNLCwvgGUa5sSxyvwycwTnowmgf?= =?us-ascii?Q?oWBZriqx+NE8kbo20xtVo+qIRLdH78RlwVefQnXNsXvKqm7EEXF4W3xJAWC6?= =?us-ascii?Q?1DOWN6q/2bPha61xqKx5DHG5CmMsF4D0ohEnlhKIDhchWXmsX7V7nOFqYzLh?= =?us-ascii?Q?kb9gD6CFr+g5il8rUBVJ4rzvg5T4dDozOCAMDjXGh7nh0fQtt70VplqWXh8n?= =?us-ascii?Q?O0mtjyCxfFiKBhJ7E/Ocaa0wMkZM2golC4KCcKtieV5zVEXT9LsIlLdzU3Sf?= =?us-ascii?Q?L+J8cHymGxYfC/gpU0j25CB4E+/3DzIjMkiW/kjLhMMrKcMasqNOsn0X8G3i?= =?us-ascii?Q?cDNBXqIGL0qeiyy7pbTF3fBl3IieCGzuS0e+b1wKSkRRNcU9n7TBJ/QAYmXL?= =?us-ascii?Q?ldJiu8Cuaz40zhHjxgn2PlorkzjoAJx8UxF5OMe+h2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k4Bul85oP7iGhe5NBGV5Tj6mIadU6aV9ADrttwoeftpyxwQ==; 24:J2bCVwPJqDmKzBLwt2qxckSjq8a1ykTjbmJR6niCWxbcMusobDqzV1bBL+fFQOAV7E0DBUClYO1lHQJaCn4BlvmEqulJu1n5Kf2EV6JHUB0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 7:/mE29oPDpCAmRQlz2D0XKX3o46lG8uSLg7TKSdXVjbcZiwtr6kB+iAkJTy3z2/e6eA4UVC8q5eFuvmTK6ejv981bA8YLivjbFd7tRoHk/B/h/Y+QPoYPKs4Ibf0MqIiRRMJMT7+2hwAo0IJz8mzzMekCEUVwsphIV8waXrcZSYIKcScPbs8X/ZrCTFw7pAwWRIHV5jIXKDxRcMmE11RAzmtOBrUhOkdzGbT/xYhD9lXMczEFv3DdgEhMZuS1iYPbnUwTPCkA/ooMPPKxs1irALZJSE6IxS+P+Y+07y/+N+aX/o5XLGNHMGRbz+ZWolSegRmWMHAjwh1O5Dbe7Z9d4w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2017 14:00:42.4299 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 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 14:00:48 -0000 On Thu, Mar 23, 2017 at 01:26:15PM +0000, Ferruh Yigit wrote: > On 3/23/2017 1:20 PM, Jerin Jacob wrote: > > 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? > > If this won't cause a problem for you with older kernels, I would prefer > no kernel check option. OK. I will ask our kernel team to backport the offending the kernel change to old versions based on the requirement. Please merge this patch if you don't see any other issue. I can post a separate patch add to the kernel version check if it is really required. > > > > >> > >>> > >>> > >>>> > >>>>> > >>>>> > >>>>>> > >>>>>>> uint8_t link_up; > >>>>>>> uint8_t duplex; > >>>>>>> uint32_t speed; > >>>>>>> > >>>>>> > >>>> > >> >