* [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
@ 2008-12-09 14:21 Sathya Perla
2008-12-10 6:54 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Sathya Perla @ 2008-12-09 14:21 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, subbu
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
---
drivers/net/Kconfig | 2 ++
drivers/net/Makefile | 1 +
drivers/net/benet/Kconfig | 7 +++++++
drivers/net/benet/MAINTAINERS | 8 ++++++++
4 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/benet/Kconfig
create mode 100644 drivers/net/benet/MAINTAINERS
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 231eeaf..85992af 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2579,6 +2579,8 @@ config QLGE
source "drivers/net/sfc/Kconfig"
+source "drivers/net/benet/Kconfig"
+
endif # NETDEV_10000
source "drivers/net/tokenring/Kconfig"
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 017383a..0d48432 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_GIANFAR) += gianfar_driver.o
obj-$(CONFIG_TEHUTI) += tehuti.o
obj-$(CONFIG_ENIC) += enic/
obj-$(CONFIG_JME) += jme.o
+obj-$(CONFIG_BENET) += benet/
gianfar_driver-objs := gianfar.o \
gianfar_ethtool.o \
diff --git a/drivers/net/benet/Kconfig b/drivers/net/benet/Kconfig
new file mode 100644
index 0000000..f680607
--- /dev/null
+++ b/drivers/net/benet/Kconfig
@@ -0,0 +1,7 @@
+config BENET
+ tristate "ServerEngines 10Gb NIC - BladeEngine"
+ depends on PCI && INET
+ select INET_LRO
+ help
+ This driver implements the NIC functionality for ServerEngines
+ 10Gb network adapter BladeEngine (EC 3210).
diff --git a/drivers/net/benet/MAINTAINERS b/drivers/net/benet/MAINTAINERS
new file mode 100644
index 0000000..60f3144
--- /dev/null
+++ b/drivers/net/benet/MAINTAINERS
@@ -0,0 +1,8 @@
+SERVER ENGINES 10Gbe NIC - BLADE-ENGINE
+P: Subbu Seetharaman
+M: subbus@serverengines.com
+P: Sathya Perla
+M: sathyap@serverengines.com
+L: netdev@vger.kernel.org
+W: http://www.serverengines.com
+S: Supported
--
1.5.5
___________________________________________________________________________________
This message, together with any attachment(s), contains confidential and proprietary information of
ServerEngines Corporation and is intended only for the designated recipient(s) named above. Any unauthorized
review, printing, retention, copying, disclosure or distribution is strictly prohibited. If you are not the
intended recipient of this message, please immediately advise the sender by reply email message and
delete all copies of this message and any attachment(s). Thank you.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
2008-12-09 14:21 [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile Sathya Perla
@ 2008-12-10 6:54 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-12-10 6:54 UTC (permalink / raw)
To: sathyap; +Cc: netdev, jgarzik, subbus
Ok I looked at this driver some more and I have many comments.
The hardware library abstraction has to go. You aren't writing a
native linux driver if you split things up like this. I know you want
code sharing with your other supported platforms, but that's too bad.
If we let every vendor do this the whole tree would be one big
unmaintainable mess.
Many structures have all-caps or capitalized names. Good coding style
indicates that only CPP macros are to be named with capital letters.
(capital letterd symbols say to the reader "I'm a CPP macro and
probably have side-effects, beware") What's happening here looks ugly
and is inconsistent with the rest of the linux kernel.
The definition of the access to the chip registers is overly
obfuscated. All of this structure stuff and offsetof() business
adds complexity to the driver and makes it harder to understand.
The bit twiddling is difficult to understand and makes the compiler
work too hard.
I would suggest to fix all of this by simply using macros which
define chip register offsets, and next to those offset define
macros which define the bit values within the register. Endianness
is not an issue, and all read*()/write*() calls will write out
to the chip in little endian regardless of cpu endianness.
See other drivers such as drivers/net/tg3.[ch] or drivers/net/niu.[ch]
As you'll notice even such huge drivers as those can be done cleanly
in a single source file with no hardware abstraction library layer and
no funny register access structures and bit twiddling, so you can
strive for that as well.
So, this driver still needs a lot of work. :)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
@ 2008-12-11 11:43 Subbu Seetharaman
0 siblings, 0 replies; 5+ messages in thread
From: Subbu Seetharaman @ 2008-12-11 11:43 UTC (permalink / raw)
To: David Miller, sathyap; +Cc: netdev, jgarzik, romieu, kaber
Thanks to everyone who reviwed and commented on the driver.
Regarding David's comments, some explation is due from us.
Unlike most other NICs, inititilizations and configuration of
the BladeEngine NIC is done by issuing f/w commands to the
embedded processor and not by writing / reading
hardware registers. Most of these f/w commands involve passing
a request message with several fields of parameters and getting a
response message with a several fields. It is best to use
structures to represent these request and response messages.
The header files that describe these structures are generated
automatically by a tool as part of the f/w build. These
header files are used by both the drivers and f/w. The first
version of the driver we posted had bit fields in many of these
structures and it was suggested that we get rid of bit fields.
We removed the bit fields and currently using offsets and masks
to get and set these bit fileds. Instead of a constant definitions
for these offsets and masks, we calculate them using the pseudo
structures BE_XXX_AMAP where a byte (u8) represents a bit.
Regarding the abstraction, there is no separate layering here.
We use a bunch of functions to create / destroy rings; but these
functions are Linux native. There is some more simplifcation possible
here.
Thanks.
Subbu
----- Original Message -----
From: David Miller [mailto:davem@davemloft.net]
To: sathyap@serverengines.com
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, subbus@serverengines.com
Sent: Tue, 09 Dec 2008 22:54:53 -0800
Subject: Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
Ok I looked at this driver some more and I have many comments.
The hardware library abstraction has to go. You aren't writing a
native linux driver if you split things up like this. I know you want
code sharing with your other supported platforms, but that's too bad.
If we let every vendor do this the whole tree would be one big
unmaintainable mess.
Many structures have all-caps or capitalized names. Good coding style
indicates that only CPP macros are to be named with capital letters.
(capital letterd symbols say to the reader "I'm a CPP macro and
probably have side-effects, beware") What's happening here looks ugly
and is inconsistent with the rest of the linux kernel.
The definition of the access to the chip registers is overly
obfuscated. All of this structure stuff and offsetof() business
adds complexity to the driver and makes it harder to understand.
The bit twiddling is difficult to understand and makes the compiler
work too hard.
I would suggest to fix all of this by simply using macros which
define chip register offsets, and next to those offset define
macros which define the bit values within the register. Endianness
is not an issue, and all read*()/write*() calls will write out
to the chip in little endian regardless of cpu endianness.
See other drivers such as drivers/net/tg3.[ch] or drivers/net/niu.[ch]
As you'll notice even such huge drivers as those can be done cleanly
in a single source file with no hardware abstraction library layer and
no funny register access structures and bit twiddling, so you can
strive for that as well.
So, this driver still needs a lot of work. :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
___________________________________________________________________________________
This message, together with any attachment(s), contains confidential and proprietary information of
ServerEngines Corporation and is intended only for the designated recipient(s) named above. Any unauthorized
review, printing, retention, copying, disclosure or distribution is strictly prohibited. If you are not the
intended recipient of this message, please immediately advise the sender by reply email message and
delete all copies of this message and any attachment(s). Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
@ 2008-12-27 15:41 Subbu Seetharaman
2008-12-28 2:23 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Subbu Seetharaman @ 2008-12-27 15:41 UTC (permalink / raw)
To: Subbu Seetharaman, David Miller, sathyap; +Cc: netdev, jgarzik, romieu, kaber
David,
Do you still have objection to the use of the the macros to
calculate the offsets and shifts with the help of the pseudo
structure ratger than defining constants ?
Thanks.
Subbu
----- Original Message -----
From: Subbu Seetharaman [mailto:subbus@serverengines.com]
To: David Miller [mailto:davem@davemloft.net], sathyap@serverengines.com
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, romieu@fr.zoreil.com, kaber@trash.net
Sent: Thu, 11 Dec 2008 03:43:06 -0800
Subject: Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
Thanks to everyone who reviwed and commented on the driver.
Regarding David's comments, some explation is due from us.
Unlike most other NICs, inititilizations and configuration of
the BladeEngine NIC is done by issuing f/w commands to the
embedded processor and not by writing / reading
hardware registers. Most of these f/w commands involve passing
a request message with several fields of parameters and getting a
response message with a several fields. It is best to use
structures to represent these request and response messages.
The header files that describe these structures are generated
automatically by a tool as part of the f/w build. These
header files are used by both the drivers and f/w. The first
version of the driver we posted had bit fields in many of these
structures and it was suggested that we get rid of bit fields.
We removed the bit fields and currently using offsets and masks
to get and set these bit fileds. Instead of a constant definitions
for these offsets and masks, we calculate them using the pseudo
structures BE_XXX_AMAP where a byte (u8) represents a bit.
Regarding the abstraction, there is no separate layering here.
We use a bunch of functions to create / destroy rings; but these
functions are Linux native. There is some more simplifcation possible
here.
Thanks.
Subbu
----- Original Message -----
From: David Miller [mailto:davem@davemloft.net]
To: sathyap@serverengines.com
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, subbus@serverengines.com
Sent: Tue, 09 Dec 2008 22:54:53 -0800
Subject: Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
Ok I looked at this driver some more and I have many comments.
The hardware library abstraction has to go. You aren't writing a
native linux driver if you split things up like this. I know you want
code sharing with your other supported platforms, but that's too bad.
If we let every vendor do this the whole tree would be one big
unmaintainable mess.
Many structures have all-caps or capitalized names. Good coding style
indicates that only CPP macros are to be named with capital letters.
(capital letterd symbols say to the reader "I'm a CPP macro and
probably have side-effects, beware") What's happening here looks ugly
and is inconsistent with the rest of the linux kernel.
The definition of the access to the chip registers is overly
obfuscated. All of this structure stuff and offsetof() business
adds complexity to the driver and makes it harder to understand.
The bit twiddling is difficult to understand and makes the compiler
work too hard.
I would suggest to fix all of this by simply using macros which
define chip register offsets, and next to those offset define
macros which define the bit values within the register. Endianness
is not an issue, and all read*()/write*() calls will write out
to the chip in little endian regardless of cpu endianness.
See other drivers such as drivers/net/tg3.[ch] or drivers/net/niu.[ch]
As you'll notice even such huge drivers as those can be done cleanly
in a single source file with no hardware abstraction library layer and
no funny register access structures and bit twiddling, so you can
strive for that as well.
So, this driver still needs a lot of work. :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
___________________________________________________________________________________
This message, together with any attachment(s), contains confidential and proprietary information of
ServerEngines Corporation and is intended only for the designated recipient(s) named above. Any unauthorized
review, printing, retention, copying, disclosure or distribution is strictly prohibited. If you are not the
intended recipient of this message, please immediately advise the sender by reply email message and
delete all copies of this message and any attachment(s). Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile
2008-12-27 15:41 Subbu Seetharaman
@ 2008-12-28 2:23 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2008-12-28 2:23 UTC (permalink / raw)
To: subbus; +Cc: sathyap, netdev, jgarzik, romieu, kaber
From: "Subbu Seetharaman" <subbus@serverengines.com>
Date: Sat, 27 Dec 2008 07:41:51 -0800
> Do you still have objection to the use of the the macros to
> calculate the offsets and shifts with the help of the pseudo
> structure ratger than defining constants ?
I objected to the capitalized structure names et al.
You should make your driver more match the coding and
naming style used in the rest of the kernel.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-28 2:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-09 14:21 [PATCH 11/11] benet: Kconfig, MAINTAINETS, drivers/net Makefile Sathya Perla
2008-12-10 6:54 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2008-12-11 11:43 Subbu Seetharaman
2008-12-27 15:41 Subbu Seetharaman
2008-12-28 2:23 ` David Miller
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).