netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shannon Nelson <snelson@pensando.io>
To: Saeed Mahameed <saeedm@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH v4 net-next 14/19] ionic: Add Tx and Rx handling
Date: Fri, 9 Aug 2019 15:27:56 -0700	[thread overview]
Message-ID: <22b81224-8899-0803-6449-36c13e673c62@pensando.io> (raw)
In-Reply-To: <c20a9924af9ce298f1997f57b8b51235726583d8.camel@mellanox.com>

On 7/25/19 4:48 PM, Saeed Mahameed wrote:
> On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote:
>> Add both the Tx and Rx queue setup and handling.  The related
>> stats display comes later.  Instead of using the generic napi
>> routines used by the slow-path commands, the Tx and Rx paths
>> are simplified and inlined in one file in order to get better
>> compiler optimizations.
>>
>> Signed-off-by: Shannon Nelson<snelson@pensando.io>
>> ---
>>   drivers/net/ethernet/pensando/ionic/Makefile  |   2 +-
>>   .../net/ethernet/pensando/ionic/ionic_lif.c   | 387 ++++++++
>>   .../net/ethernet/pensando/ionic/ionic_lif.h   |  52 ++
>>   .../net/ethernet/pensando/ionic/ionic_txrx.c  | 879
>> ++++++++++++++++++
>>   .../net/ethernet/pensando/ionic/ionic_txrx.h  |  15 +
>>   5 files changed, 1334 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/net/ethernet/pensando/ionic/ionic_txrx.c
>>   create mode 100644 drivers/net/ethernet/pensando/ionic/ionic_txrx.h
>>
>> diff --git a/drivers/net/ethernet/pensando/ionic/Makefile
>> b/drivers/net/ethernet/pensando/ionic/Makefile
>> index 9b19bf57a489..0e2dc53f08d4 100644
>> --- a/drivers/net/ethernet/pensando/ionic/Makefile
>> +++ b/drivers/net/ethernet/pensando/ionic/Makefile
>> @@ -4,4 +4,4 @@
>>   obj-$(CONFIG_IONIC) := ionic.o
>>   
>>   ionic-y := ionic_main.o ionic_bus_pci.o ionic_dev.o ionic_ethtool.o
>> \
>> -	   ionic_lif.o ionic_rx_filter.o ionic_debugfs.o
>> +	   ionic_lif.o ionic_rx_filter.o ionic_txrx.o ionic_debugfs.o
>> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
>> b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
>> index 2bd8ce61c4a0..40d3b1cb362a 100644
>> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
>> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
>> @@ -10,6 +10,7 @@
>>   #include "ionic.h"
>>   #include "ionic_bus.h"
>>   #include "ionic_lif.h"
>> +#include "ionic_txrx.h"
>>   #include "ionic_ethtool.h"
>>   #include "ionic_debugfs.h"
>>   
>> @@ -18,6 +19,13 @@ static int ionic_lif_addr_add(struct lif *lif,
>> const u8 *addr);
>>   static int ionic_lif_addr_del(struct lif *lif, const u8 *addr);
>>   static void ionic_link_status_check(struct lif *lif);
>>   
>> +static int ionic_lif_stop(struct lif *lif);
>> +static int ionic_txrx_alloc(struct lif *lif);
>> +static int ionic_txrx_init(struct lif *lif);
>> +static void ionic_qcq_free(struct lif *lif, struct qcq *qcq);
>> +static int ionic_lif_txqs_init(struct lif *lif);
>> +static int ionic_lif_rxqs_init(struct lif *lif);
>> +static void ionic_lif_qcq_deinit(struct lif *lif, struct qcq *qcq);
>>   static int ionic_set_nic_features(struct lif *lif, netdev_features_t
>> features);
>>   static int ionic_notifyq_clean(struct lif *lif, int budget);
>>   
>> @@ -66,12 +74,96 @@ static void ionic_lif_deferred_enqueue(struct
>> ionic_deferred *def,
>>   	schedule_work(&def->work);
>>   }
> Bottom up or top down ? your current design is very mixed and I had to
> to scroll down and up too often just to understand what a function is
> doing, i strongly suggest to pick an use one approach.
>
> [1]
> https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design#Programming

Hi Saeed,

Sorry it has taken me so long to address the comments you had on this 
patch: I've been contemplating them while working some internal issues.  
Part of my hesitance is also because, while correct, these are 
suggesting some significant rework and juggling of stable code. I've 
been aware of these issues since I inherited the code, and have been 
addressing them over time while trying to keep on top of stability, and 
was planning to continue doing so.  It sounds like I need to evolve the 
driver a little further before the next patchset version.  I think I'll 
have time in the next week to do this, so I'm hoping to have a new 
patchset out in another week or so.

Thanks for the inputs,
sln



  reply	other threads:[~2019-08-09 22:28 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 21:40 [PATCH v4 net-next 00/19] Add ionic driver Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 01/19] ionic: Add basic framework for IONIC Network device driver Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 02/19] ionic: Add hardware init and device commands Shannon Nelson
2019-07-23 21:18   ` David Miller
2019-07-23 22:50     ` Shannon Nelson
2019-07-23 23:05       ` David Miller
2019-07-23 23:23         ` Shannon Nelson
2019-07-24 17:49         ` Shannon Nelson
2019-07-24 20:07           ` David Miller
2019-07-23 23:47   ` Saeed Mahameed
2019-07-24  0:25     ` Shannon Nelson
2019-07-24 20:23       ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 03/19] ionic: Add port management commands Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 04/19] ionic: Add basic lif support Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 05/19] ionic: Add interrupts and doorbells Shannon Nelson
2019-07-23 21:24   ` David Miller
2019-07-23 22:50     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 06/19] ionic: Add basic adminq support Shannon Nelson
2019-07-23 21:27   ` David Miller
2019-07-23 22:50     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 07/19] ionic: Add adminq action Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 08/19] ionic: Add notifyq support Shannon Nelson
2019-07-24 23:21   ` Saeed Mahameed
2019-07-30 18:35     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 09/19] ionic: Add the basic NDO callbacks for netdev support Shannon Nelson
2019-07-24 23:45   ` Saeed Mahameed
2019-07-30 18:35     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 10/19] ionic: Add management of rx filters Shannon Nelson
2019-07-24 23:52   ` Saeed Mahameed
2019-07-22 21:40 ` [PATCH v4 net-next 11/19] ionic: Add Rx filter and rx_mode ndo support Shannon Nelson
2019-07-23 21:33   ` David Miller
2019-07-23 22:50     ` Shannon Nelson
2019-07-23 23:06       ` David Miller
2019-07-23 23:54         ` Saeed Mahameed
2019-07-24  0:19           ` Shannon Nelson
2019-07-24  0:19         ` Shannon Nelson
2019-07-23 22:51     ` Saeed Mahameed
2019-07-23 23:20   ` Saeed Mahameed
2019-07-24  0:07     ` Shannon Nelson
2019-07-24 21:10       ` Saeed Mahameed
2019-07-22 21:40 ` [PATCH v4 net-next 12/19] ionic: Add async link status check and basic stats Shannon Nelson
2019-07-25  0:04   ` Saeed Mahameed
2019-07-30 18:35     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 13/19] ionic: Add initial ethtool support Shannon Nelson
2019-07-23 21:35   ` David Miller
2019-07-23 22:50     ` Shannon Nelson
2019-07-25  0:17   ` Saeed Mahameed
2019-07-30 18:57     ` Shannon Nelson
2019-07-25 13:28   ` Andrew Lunn
2019-07-25 13:35   ` Andrew Lunn
2019-07-30 21:51     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 14/19] ionic: Add Tx and Rx handling Shannon Nelson
2019-07-23 21:36   ` David Miller
2019-07-25 23:48   ` Saeed Mahameed
2019-08-09 22:27     ` Shannon Nelson [this message]
2019-07-22 21:40 ` [PATCH v4 net-next 15/19] ionic: Add netdev-event handling Shannon Nelson
2019-07-25 23:55   ` Saeed Mahameed
2019-07-30 22:53     ` Shannon Nelson
2019-07-30 23:39   ` Stephen Hemminger
2019-07-31  1:10     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 16/19] ionic: Add driver stats Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 17/19] ionic: Add RSS support Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 18/19] ionic: Add coalesce and other features Shannon Nelson
2019-07-23 21:40   ` David Miller
2019-07-26  0:13   ` Saeed Mahameed
2019-08-02 21:48     ` Shannon Nelson
2019-07-22 21:40 ` [PATCH v4 net-next 19/19] ionic: Add basic devlink interface Shannon Nelson
2019-07-23 21:40   ` David Miller
2019-07-23 22:50     ` Shannon Nelson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22b81224-8899-0803-6449-36c13e673c62@pensando.io \
    --to=snelson@pensando.io \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).