Skip to contentSkip to conversation

drivers: misc: stcam: Renesas stcam device

PATCH In review Daniel Walker 2 participants 5 messages Oct 30, 2013 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: misc: stcam: Renesas stcam device

This is a driver for the ternary content addressable memory unit from Renesas. It allows filtering on bits, and wildcards thru the chip.

---
 drivers/misc/Kconfig  |   7 +
 drivers/misc/Makefile |   1 +
 drivers/misc/stcam.c  | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 356 insertions(+)
 create mode 100644 drivers/misc/stcam.c
drivers/misc/Kconfig +7 -0
index 8dacd4c..1f9bc31 100644
@@ -528,6 +528,13 @@ config SRAM
 	  the genalloc API. It is supposed to be used for small on-chip SRAM
 	  areas found on many SoCs.
 
+config STCAM
+	bool "Renesas stcam device"
+	help    
+	  This is a ternary content addressable memory unit (TCAM) from Renesas. It
+	  allows filtering on bits, and wildcards.
+ 
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
drivers/misc/Makefile +1 -0
index c235d5b..30d413e 100644
@@ -53,3 +53,4 @@ obj-$(CONFIG_INTEL_MEI)		+= mei/
 obj-$(CONFIG_VMWARE_VMCI)	+= vmw_vmci/
 obj-$(CONFIG_LATTICE_ECP3_CONFIG)	+= lattice-ecp3-config.o
 obj-$(CONFIG_SRAM)		+= sram.o
+obj-$(CONFIG_STCAM)		+= stcam.o
drivers/misc/stcam.c new file +348 -0

348 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 4 lines · Daniel Walker

This is a driver for the ternary content addressable memory unit from Renesas. It allows filtering on bits, and wildcards thru the chip.

What about the Cisco copyright? Has that author signed off on this?

And why a separate driver, can't you do this all from userspace as a normal i2c driver?

You are creating sysfs files without the corrisponding Documentation/ABI/ files, why?

and most important, what is a "ternary content addressable memory unit" and what would you do with such a thing?

greg k-h

#2 lore raw
Quoted 7 lines · Greg Kroah-Hartman
Quoted 4 lines · Daniel Walker

This is a driver for the ternary content addressable memory unit from Renesas. It allows filtering on bits, and wildcards thru the chip.

What about the Cisco copyright? Has that author signed off on this?

He's not aware of the release .. I can ask him to sign off, but I think it's academic (he doesn't care).. I don't think he knows what a sign off means.

Quoted 2 lines

And why a separate driver, can't you do this all from userspace as a normal i2c driver?

I don't know , can I ? This is what Cisco is currently using ..

Quoted 3 lines

You are creating sysfs files without the corrisponding Documentation/ABI/ files, why?

Because I didn't realize I needed to.. This release is one in about 25 or so similar drivers that I am planning to release.. I wasn't really sure of what I needed to do w.r.t the sysfs interface details. Most of the drivers have them in some form.

Quoted 2 lines

and most important, what is a "ternary content addressable memory unit" and what would you do with such a thing?

I asked the same question when I looked at the driver. It's in wikipedia,

http://en.wikipedia.org/wiki/Content_addressable_memory#Ternary_CAMs

It used for filtering things by 0,1 or wildcard.. In Cisco case "things" is packets.

Daniel

#3 lore raw
Quoted 5 lines · Daniel Walker
Quoted 4 lines · Greg Kroah-Hartman
Quoted 3 lines · Daniel Walker

This is a driver for the ternary content addressable memory unit from Renesas. It allows filtering on bits, and wildcards thru the chip.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

What about the Cisco copyright? Has that author signed off on this?

He's not aware of the release .. I can ask him to sign off, but I think it's academic (he doesn't care).. I don't think he knows what a sign off means.

You should at least ask, it's only nice to do so.

Quoted 4 lines
Quoted 2 lines

And why a separate driver, can't you do this all from userspace as a normal i2c driver?

I don't know , can I ? This is what Cisco is currently using ..

That doesn't mean anything, sorry. We don't want to duplicate stuff that can already be done using i2c-dev and the like, right?

Quoted 10 lines
Quoted 2 lines

and most important, what is a "ternary content addressable memory unit" and what would you do with such a thing?

I asked the same question when I looked at the driver. It's in wikipedia,

http://en.wikipedia.org/wiki/Content_addressable_memory#Ternary_CAMs

It used for filtering things by 0,1 or wildcard.. In Cisco case "things" is packets.

That still doesn't explain what this driver is used for to me, sorry. Care to explain?

thanks,

greg k-h

#4 lore raw
Quoted 8 lines · Greg Kroah-Hartman
Quoted 7 lines · Daniel Walker
Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Daniel Walker

This is a driver for the ternary content addressable memory unit from Renesas. It allows filtering on bits, and wildcards thru the chip.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

What about the Cisco copyright? Has that author signed off on this?

He's not aware of the release .. I can ask him to sign off, but I think it's academic (he doesn't care).. I don't think he knows what a sign off means.

You should at least ask, it's only nice to do so.

Ok, assuming I actually re-submit ..

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And why a separate driver, can't you do this all from userspace as a normal i2c driver?

I don't know , can I ? This is what Cisco is currently using ..

That doesn't mean anything, sorry. We don't want to duplicate stuff that can already be done using i2c-dev and the like, right?

Would it matter if I said there was billion routers using this code?

The amount of work drops if I use the driver similar to it's current form times 25.. I realize you don't give a rats ass about that, which is fine..

Most of the legacy drivers in i2c can be done in userspace it looks like .. That means there's only super rare cases when you would take a kernel i2c driver ?

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

and most important, what is a "ternary content addressable memory unit" and what would you do with such a thing?

I asked the same question when I looked at the driver. It's in wikipedia,

Quoted 7 lines
Quoted 4 lines

http://en.wikipedia.org/wiki/Content_addressable_memory#Ternary_CAMs

It used for filtering things by 0,1 or wildcard.. In Cisco case "things" is packets.

That still doesn't explain what this driver is used for to me, sorry. Care to explain?

A packet goes into a switch, the TCAM is set to filter specific packets to specific ports on the router (this is my understanding from wikipedia) based on specific fields in the packets.. I'm not sure I can do much better then that, but I'm sure someone with more network experience could explain in more detail..

Daniel