NET: Questions about supporting older kernel's with kmods

From: Gregory Haskins
Date: Thu Nov 19 2009 - 09:21:57 EST


Hi All,

So I was in the process of packaging up my venet driver so that it could
not only support the in-tree build (in -next), but also build as a KMP
for inclusion in existing distros that already shipped (like SLE, RHEL,
CentOS, etc).

The problem I ran into is that the ethtool and netdev_ops components of
the in-tree version do not necessarily align with the substrate
capabilities of older kernels. What are the best-practices surrounding
this issue?

Q1) Is there any official CONFIG tags (e.g. HAVE_NETDEV_OPS) I can key
off of, or should I simply look at the kernel version? If the latter,
any recommendation on what to use for the aforementioned features? (I
can always try to git-annotate to figure it out, but I wonder if there
are best-practices already in place).

Q2) Is it considered "bad form" to include such compile-time directives
in the version of the code going upstream? E.g. can my driver in -next
have "#ifdef CONFIG_HAVE_NETDEV_OPS" or other version/capability deps,
or do I need to patch these externally into the code destined for the
kmod, and leave the upstream code "pure"?

Thanks in advance,
-Greg

Attachment: signature.asc
Description: OpenPGP digital signature