From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38886C10F27 for ; Wed, 11 Mar 2020 10:12:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BA912071B for ; Wed, 11 Mar 2020 10:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583921576; bh=NE4BXmUrGZkTZWZLEq+5Vk64hBuIHGYpS8uyjzAZI4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=qGhIjYauYi+LXhyeTvqyEtB46JCZkKFKvsPBetCJggr6gxDhaqcYH1C61tCThuvh0 1FzVfuNl+btMRFYDnjPUkSsHyOa+skTOWuy13us4iEEHbIScYdrKb29IXjBLS+Z060 WB3hc9lxyfdRjeSdJfWif7YCduCkziLAdiPSbgJk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728951AbgCKKMz (ORCPT ); Wed, 11 Mar 2020 06:12:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:50378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgCKKMz (ORCPT ); Wed, 11 Mar 2020 06:12:55 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 989822071B; Wed, 11 Mar 2020 10:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583921574; bh=NE4BXmUrGZkTZWZLEq+5Vk64hBuIHGYpS8uyjzAZI4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DHMg/Eh7Skd2GdhxhF7f3stALbPKzVS3T4/ruJQJY0cZYnu8OeaA4kLiK2FlRKu12 J71ZjG16k9i0hoVIhiZcO6342QhSo0Hc5my97/NWRUtVVP7ZeEtWr7GQXOYGN97gQy 8zNECYF9Ooo5mAR7rxSz6pzSJMbC9iwsgBNOZFFs= Date: Wed, 11 Mar 2020 12:12:50 +0200 From: Leon Romanovsky To: Sunil Kovvuri Cc: Andrew Lunn , Linux Netdev List , "David S. Miller" , Tomasz Duszynski , Sunil Goutham Subject: Re: [PATCH net-next 4/6] octeontx2-vf: Ethtool support Message-ID: <20200311101250.GI4215@unreal> References: <1583866045-7129-1-git-send-email-sunil.kovvuri@gmail.com> <1583866045-7129-5-git-send-email-sunil.kovvuri@gmail.com> <20200310192111.GC11247@lunn.ch> <20200311070549.GG4215@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 11, 2020 at 12:48:13PM +0530, Sunil Kovvuri wrote: > On Wed, Mar 11, 2020 at 12:35 PM Leon Romanovsky wrote: > > > > On Wed, Mar 11, 2020 at 12:09:45PM +0530, Sunil Kovvuri wrote: > > > On Wed, Mar 11, 2020 at 12:51 AM Andrew Lunn wrote: > > > > > > > > On Wed, Mar 11, 2020 at 12:17:23AM +0530, sunil.kovvuri@gmail.com wrote: > > > > > +int __weak otx2vf_open(struct net_device *netdev) > > > > > +{ > > > > > + return 0; > > > > > +} > > > > > + > > > > > +int __weak otx2vf_stop(struct net_device *netdev) > > > > > +{ > > > > > + return 0; > > > > > +} > > > > > > > > Hi Sunil > > > > > > > > weak symbols are very unusual in a driver. Why are they required? > > > > > > > > Thanks > > > > Andrew > > > > > > For ethtool configs which need interface reinitialization of interface > > > we need to either call PF or VF open/close fn()s. > > > If VF driver is not compiled in, then PF driver compilation will fail > > > without these weak symbols. > > > They are there just for compilation purpose, no other use. > > > > It doesn't make sense, your PF driver should be changed to allow > > compilation with those empty functions. > > > > Thanks > > > > I didn't get, if VF driver is not compiled in then there are no > otx2vf_open/stop fn()s defined. > Either i have add weak fn()s or add empty ones based on VF CONFIG > option, anyother option ? I have no access to your implementation. But in general case: If those fn() are accessed through pointer ->fn(), you need add checks like this "if (..>fn) ..->fn()". If you call directly, add empty declarations in the .h and enable them in case VF is not compiled. Thanks > > Thanks, > Sunil.