All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
	ehabkost@redhat.com, yuval.shaia@oracle.com, dotanb@mellanox.com,
	yanjun.zhu@oracle.com
Subject: Re: [Qemu-devel] [PATCH V10 3/9] include/standard-headers: add pvrdma related headers
Date: Wed, 14 Feb 2018 18:15:21 +0200	[thread overview]
Message-ID: <20180214175303-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20180212180819.82556-4-marcel@redhat.com>

On Mon, Feb 12, 2018 at 08:08:13PM +0200, Marcel Apfelbaum wrote:
> Also modify update-linux-headers.sh script to manage
> the headers needed by the pvrdma device.
> 
> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---

Would be best to make script update a separate patch.
Automatically generated stuff can come later.

Overall comments below are minor. if you do not respin
you can address them later as a patch on top.

> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index 135a10d96a..c1a7c1e99c 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -38,6 +38,7 @@ cp_portable() {
>                                       -e 'linux/if_ether' \
>                                       -e 'input-event-codes' \
>                                       -e 'sys/' \
> +                                     -e 'pvrdma_verbs' \
>                                       > /dev/null
>      then
>          echo "Unexpected #include in input file $f".
> @@ -46,6 +47,7 @@ cp_portable() {
>  
>      header=$(basename "$f");
>      sed -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \
> +        -e 's/u\([0-9][0-9]*\)/uint\1_t/g' \
>          -e 's/__s\([0-9][0-9]*\)/int\1_t/g' \
>          -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \
>          -e 's/__be\([0-9][0-9]*\)/uint\1_t/g' \
> @@ -56,6 +58,7 @@ cp_portable() {
>          -e 's/__inline__/inline/' \
>          -e '/sys\/ioctl.h/d' \
>          -e 's/SW_MAX/SW_MAX_/' \
> +        -e 's/atomic_t/int/' \
>          "$f" > "$to/$header";
>  }
>  
> @@ -147,6 +150,30 @@ for i in "$tmpdir"/include/linux/*virtio*.h "$tmpdir/include/linux/input.h" \
>      cp_portable "$i" "$output/include/standard-headers/linux"
>  done
>  
> +rm -rf "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma"
> +mkdir -p "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma"
> +
> +# Remove the unused functions from pvrdma_verbs.h avoiding the unnecessary
> +# import of several infiniband/networking/other headers
> +tmp_pvrdma_verbs="$tmpdir/pvrdma_verbs.h"
> +sed  -e '1h;2,$H;$!d;g'

what does this do exactly?

>  -e 's/[^};]*pvrdma[^(| ]*([^)]*);//g' \

and this?

> +    "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h" > \
> +    "$tmp_pvrdma_verbs";
> +

I suspect you want the enums from these headers but not the
rest of stuff there?

> +for i in "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" \
> +         "$linux/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h" \
> +         "$tmp_pvrdma_verbs"; do \
> +    cp_portable "$i" \
> +         "$output/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/"
> +done

Is the maintainer aware these are an interface? If yes
is there a chance to move at least some of these out to uapi?
That will split the code logically, and qemu could import
files without hacks.


> +
> +rm -rf "$output/include/standard-headers/rdma/"
> +mkdir -p "$output/include/standard-headers/rdma/"
> +for i in "$tmpdir/include/rdma/vmw_pvrdma-abi.h"; do
> +    cp_portable "$i" \
> +         "$output/include/standard-headers/rdma/"
> +done
> +
>  cat <<EOF >$output/include/standard-headers/linux/types.h
>  /* For QEMU all types are already defined via osdep.h, so this
>   * header does not need to do anything.
> -- 
> 2.13.5

  parent reply	other threads:[~2018-02-14 16:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 18:08 [Qemu-devel] [PATCH V10 0/9] hw/pvrdma: PVRDMA device implementation Marcel Apfelbaum
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 1/9] mem: add share parameter to memory-backend-ram Marcel Apfelbaum
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 2/9] docs: add pvrdma device documentation Marcel Apfelbaum
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 3/9] include/standard-headers: add pvrdma related headers Marcel Apfelbaum
2018-02-14 14:18   ` Gal Hammer
2018-02-14 16:15   ` Michael S. Tsirkin [this message]
2018-02-14 16:50     ` Marcel Apfelbaum
2018-02-14 16:57       ` Michael S. Tsirkin
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 4/9] hw/rdma: Add wrappers and macros Marcel Apfelbaum
2018-02-13  8:23   ` Yanjun Zhu
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 5/9] hw/rdma: Definitions for rdma device and rdma resource manager Marcel Apfelbaum
2018-02-13  8:23   ` Yanjun Zhu
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 6/9] hw/rdma: Implementation of generic rdma device layers Marcel Apfelbaum
2018-02-13  8:22   ` Yanjun Zhu
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 7/9] hw/rdma: PVRDMA commands and data-path ops Marcel Apfelbaum
2018-02-13  8:22   ` Yanjun Zhu
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 8/9] hw/rdma: Implementation of PVRDMA device Marcel Apfelbaum
2018-02-13  8:22   ` Yanjun Zhu
2018-02-12 18:08 ` [Qemu-devel] [PATCH V10 9/9] MAINTAINERS: add entry for hw/rdma Marcel Apfelbaum

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=20180214175303-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=dotanb@mellanox.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yanjun.zhu@oracle.com \
    --cc=yuval.shaia@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.