<title>
  ethtool development
</title>

<h1>
  ethtool development
</h1>

<h2>Contact addresses</h2>

<dl>
  <dt>Maintainer</dt>
  <dd><code>Michal Kubecek &lt;mkubecek@suse.cz&gt;</code></dd>
  <dt>Mailing list</dt>
  <dd><code>netdev@vger.kernel.org</code></dd>
</dl>

<h2>Repository</h2>

<p>
  The main git repository is
  git://git.kernel.org/pub/scm/network/ethtool/ethtool.git
  (<a href="http://git.kernel.org/?p=network/ethtool/ethtool.git">gitweb
  view</a>).
</p>

<p>
  Versions of ethtool follow kernel versions and userspace implementation
  of new features in kernel ethtool interface should preferrably land in
  matching ethtool release. However, new ethtool versions must work with
  older kernels and vice versa, to the maximum possible extent, i.e. all
  features supported by both kernel and ethtool should work properly.
</p>

<p>
  Similar to kernel networking, there are two target branches:
  <code>master</code> (for code targeting the closest release) and
  <code>next</code> (for code to be merged after the closest release).
  Unlike in kernel, there is no "bugs only" policy for <code>master</code>
  branch, new features can be also submitted against <code>master</code>
  with exception of (1) features relying on kernel counterpart not going to
  be present in the corresponding kernel release (ususally present in
  kernel net-next tree) and (2) bigger and/or intrusive changes shortly
  before a release. Those should be submitted against <code>next</code>
  branch.
</p>

<h2>User interface</h2>

<p>
  The ethtool user interface leaves something to be desired.  In
  particular, it is currently restricted to the English language.  I
  would appreciate patches to support translation.  The output for the
  "C" locale must not be changed, as there are undoubtedly many
  scripts that grep the output and depend on the current text.
</p>

<p>
  The ethtool <em>utility</em> is intended for use by system
  administrators and network administrators, and not primarily by
  kernel developers.  It should not expose unpleasant details of the
  ethtool <em>API</em> to the user if this can be avoided.  For
  example, the user should not need to know the unfortunate history of
  and subtle differences between the RX n-tuple versus RX NFC
  commands.  If the user runs <code>ethtool -U</code> with a filter
  specification that can be represented through either
  <code>ETHTOOL_SRXNTUPLE</code> or <code>ETHTOOL_RXCLSRLINS</code>, we will
  try both commands in turn.
</p>

<p>
  Many existing options return exit codes indicating specific failure
  points.  This is not sustainable, as exit codes are 8-bit and shells
  assign special meaning to values from 127 upward.  Any new failure
  points must produce an exit code of 1.
</p>

<p>
  All new features must be documented in the manual page
  (<code>ethtool.8.in</code>), and usually in the help text for the
  relevant option(s).
</p>

<h2>Coding style</h2>

<p>
  Coding style is broadly similar to the kernel.  You can use
  <code>scripts/checkpatch.pl</code> from the kernel to find style errors
  before I complain about them!
</p>

<h2>Submitting patches</h2>

<p>
  Please follow the same
  <a href="https://www.kernel.org/doc/html/latest/process/submitting-patches.html">procedure
  as for the kernel</a>, including the Developer's Certificate of
  Origin.  The relevant maintainer and mailing list addresses are
  shown above. Please use &quot;<code>[PATCH ethtool]</code>&quot; subject
  prefix in patches or series submitted against <code>main</code> branch
  and &quot;<code>[PATCH ethtool-next]</code>&quot; in patches or series
  submitted against <code>next</code> branch.
</p>

<p>
  The build must succeed after every commit, both with netlink interface
  enabled and disabled (<code>configure --disable-netlink</code>).
  Submitted series also should not introduce new build warnings. Note: gcc
  only shows some warnings with optimization enabled so run the build with
  "-O2" or similar to check for compiler warnings.
</p>

<p>
  If you need new or updated definitions from the kernel userspace API (uapi)
  headers, run <code>make headers_install</code> in the kernel tree and copy
  the resulting files into <code>uapi</code> directory. Update all uapi
  header copies to the same kernel tree snapshot (mainline or net-next tree)
  and identify this snapshot (by tag or commit id) in your commit message.
  Commit this change <em>before</em> your other changes. This can be automated
  using the ethtool-import-uapi script present in the scripts subdirectory
  of the git repository;
  it expects <code>LINUX_GIT</code> environment variable to be set to the
  location of a local copy of kernel git repository, use a commit id, tag or
  branch name as an argument.
</p>

<p>
  Documentation and code must be kept synchronised, i.e. when you add
  or change a feature you must update the help text and manual page in
  the same patch series.
</p>

<h2>
<a href="https://scan.coverity.com/projects/ethtool">
  <img alt="Coverity Scan Build Status"
       src="https://scan.coverity.com/projects/10317/badge.svg"/>
</a>
</h2>
