From mboxrd@z Thu Jan 1 00:00:00 1970 From: gregory.clement@free-electrons.com (Gregory CLEMENT) Date: Wed, 13 Jan 2016 18:47:25 +0100 Subject: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework In-Reply-To: (Marcin Wojtas's message of "Tue, 12 Jan 2016 23:40:40 +0100") References: <1452625834-22166-1-git-send-email-gregory.clement@free-electrons.com> <1452625834-22166-11-git-send-email-gregory.clement@free-electrons.com> Message-ID: <87h9ihwevm.fsf@free-electrons.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Marcin, On mar., janv. 12 2016, Marcin Wojtas wrote: > Hi Gregory, > > A quick remark below. All changes look fine to me at a first look, but > I will test and dig more into code soon. Great! A test would be nice because I have just did basic tests: mainly an iperf. > >> >> @@ -3946,11 +3965,6 @@ static int mvneta_probe(struct platform_device *pdev) >> dev->priv_flags |= IFF_UNICAST_FLT; >> dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; >> >> - err = register_netdev(dev); >> - if (err < 0) { >> - dev_err(&pdev->dev, "failed to register\n"); >> - goto err_free_stats; >> - } > > The purpose of shifting register_netdev() was to be able to obtain > pp->id from net_device, before mvneta_bm_port_init is called. It is > needed for proper port - pool mapping control. I can revert this change, initially I moved this chunk because I wanted to add a netdev_ops before registering it and this netdev_op depend on the bm support. As for now I don't have this this netdev_op this change is pointless. But if in future I need it, then I will look for how to do it in a different way. Thanks, > >> >> pp->id = dev->ifindex; >> >> @@ -3965,6 +3979,12 @@ static int mvneta_probe(struct platform_device *pdev) >> } >> } >> >> + err = register_netdev(dev); >> + if (err < 0) { >> + dev_err(&pdev->dev, "failed to register\n"); >> + goto err_free_stats; >> + } >> + >> err = mvneta_init(&pdev->dev, pp); >> if (err < 0) >> goto err_netdev; > > Best regards, > Marcin -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755621AbcAMRr3 (ORCPT ); Wed, 13 Jan 2016 12:47:29 -0500 Received: from down.free-electrons.com ([37.187.137.238]:37590 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755424AbcAMRr2 (ORCPT ); Wed, 13 Jan 2016 12:47:28 -0500 From: Gregory CLEMENT To: Marcin Wojtas Cc: "David S. Miller" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Thomas Petazzoni , Florian Fainelli , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "linux-arm-kernel\@lists.infradead.org" , Lior Amsalem , Nadav Haklai , Simon Guinot , Ezequiel Garcia , Maxime Ripard , Boris BREZILLON , Russell King - ARM Linux , Willy Tarreau , Arnd Bergmann Subject: Re: [PATCH net-next 10/10] net: mvneta: Use the new hwbm framework References: <1452625834-22166-1-git-send-email-gregory.clement@free-electrons.com> <1452625834-22166-11-git-send-email-gregory.clement@free-electrons.com> Date: Wed, 13 Jan 2016 18:47:25 +0100 In-Reply-To: (Marcin Wojtas's message of "Tue, 12 Jan 2016 23:40:40 +0100") Message-ID: <87h9ihwevm.fsf@free-electrons.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcin, On mar., janv. 12 2016, Marcin Wojtas wrote: > Hi Gregory, > > A quick remark below. All changes look fine to me at a first look, but > I will test and dig more into code soon. Great! A test would be nice because I have just did basic tests: mainly an iperf. > >> >> @@ -3946,11 +3965,6 @@ static int mvneta_probe(struct platform_device *pdev) >> dev->priv_flags |= IFF_UNICAST_FLT; >> dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; >> >> - err = register_netdev(dev); >> - if (err < 0) { >> - dev_err(&pdev->dev, "failed to register\n"); >> - goto err_free_stats; >> - } > > The purpose of shifting register_netdev() was to be able to obtain > pp->id from net_device, before mvneta_bm_port_init is called. It is > needed for proper port - pool mapping control. I can revert this change, initially I moved this chunk because I wanted to add a netdev_ops before registering it and this netdev_op depend on the bm support. As for now I don't have this this netdev_op this change is pointless. But if in future I need it, then I will look for how to do it in a different way. Thanks, > >> >> pp->id = dev->ifindex; >> >> @@ -3965,6 +3979,12 @@ static int mvneta_probe(struct platform_device *pdev) >> } >> } >> >> + err = register_netdev(dev); >> + if (err < 0) { >> + dev_err(&pdev->dev, "failed to register\n"); >> + goto err_free_stats; >> + } >> + >> err = mvneta_init(&pdev->dev, pp); >> if (err < 0) >> goto err_netdev; > > Best regards, > Marcin -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com