DPDK patches and discussions
 help / color / mirror / Atom feed
From: Igor Ryzhov <iryzhov@nfware.com>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] Incorrect install_dir for Linux kernel modules
Date: Thu, 6 Jun 2019 21:33:09 +0300	[thread overview]
Message-ID: <CAF+s_Fzq_uw5zo2UfLpb3KHu=-dDYMTwMo0on4rd1RPX9snOBw@mail.gmail.com> (raw)

Hi everyone,

I faced an issue today with install directory for rte_kni and igb_uio.
Modules are installed to '/usr/src/...' instead of '/lib/modules/...'.

Right now install_dir for both modules is set to:

install_dir: kernel_dir + '/../extra/dpdk'

where 'kernel_dir' is set manually or automatically to:

kernel_version = run_command('uname', '-r').stdout().strip()
kernel_dir = '/lib/modules/' + kernel_version + '/build'


I believe the intention of using '/../extra/dpdk' was to come back to
'/lib/modules/kernel_version/' and install the modules there, but as
'/lib/modules/kernel_version/build' is a symlink, we actually get into
the '/usr/src/linux-headers-kernel-version' and install modules there.

I see two possible solutions here:
1. Add new 'kernel_install_dir' option. If it is not set, set it
automatically:

kernel_version = run_command('uname', '-r').stdout().strip()
kernel_install_dir = '/lib/modules/' + kernel_version

and set install_dir to:
install_dir: kernel_install_dir + '/extra/dpdk'

2. Replace 'kernel_dir' option with new option 'kernel_version', and do the
following:

if kernel_version == ''

kernel_version = run_command('uname', '-r').stdout().strip()


then set 'kernel_dir' and 'kernel_install_dir' accordingly:

kernel_dir = '/lib/modules/' + kernel_version + '/build'

kernel_install_dir = 'lib/modules/' + kernel_version

and use it for building and installation:
custom_target('rte_kni',

...

command: ['make', '-j4', '-C', kernel_dir,

...

install_dir: kernel_install_dir + '/extra/dpdk',

...


I prefer the second one and already have a patch.
Can send the patch if maintainers are good with the solution.

Best regards,
Igor

             reply	other threads:[~2019-06-06 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 18:33 Igor Ryzhov [this message]
2019-06-07  9:29 ` Bruce Richardson
2019-06-10  8:32   ` Igor Ryzhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF+s_Fzq_uw5zo2UfLpb3KHu=-dDYMTwMo0on4rd1RPX9snOBw@mail.gmail.com' \
    --to=iryzhov@nfware.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).