I was recently looking into this bug: 6557249 DLS layer now expects the IP addresses to be aligned
And it occurred to me that the check that was already present in DLS (which is inadequate, because it only considers the length, not alignment ... we need to fix that) is redundant with one in ip_input.
Additionally, coming up from this point in the stack, I think we know that the packet is an M_DATA, and don't need to do the M_PROTO checks.
So what I'm thinking about is a custom version of ip_input, call it ip_input_fast, which is pretty much just like ip_input, but assumes that the underneath layer has already stripped off any M_PROTO (or, more correctly, just never prepended one) and has already done any necessary pullup to get an aligned, concatenated IP header.
Then the regular ip_input could call ip_input_fast after making these checks. Penalty gets applied to legacy drivers, and maybe to any paths in IP that can't use the shorter version, but I'd think that for most modern drivers we'd see a benefit.
Its only a few cycles, but, as I think I've already noted, on hot code paths, every cycle counts, especially when dealing with tiny 64-byte frames needed in certain performance benchmarks.
Thoughts? -- Garrett _______________________________________________ networking-discuss mailing list [email protected]
