Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PULL REQUEST] Please pull rdma.git (tag for-linus-2)
From: Doug Ledford @ 2016-10-07 22:06 UTC (permalink / raw)
  To: Torvalds, Linus, linux-rdma


[-- Attachment #1.1: Type: text/plain, Size: 2940 bytes --]

Hi Linus,

I have two separate pull requests for you today.  I'll do the simple one
first.

I had originally intended to include the rxe update patches in my main
pull request.  However, on merge tests, there were conflicts against
your tree.  It was because I had forgotten that there were late rxe
driver changes in 4.8, so like the hfi1 driver, those patches needed to
be against a late 4.8-rc kernel in order to apply cleanly.  As a result,
I was forced to make a new 4.9 branch, remove the rxe patches, then
replace the rxe patches onto the for-4.9-hfi1 branch that you already
pulled.  So this first pull request is just a few rxe specific patches
tacked onto that branch.  The incremental pull looks like this:

The following changes since commit 61347fa6087884305ea4a3a04501839fdb68dc76:

  IB/rdmavt: Trivial function comment corrected. (2016-10-03 10:55:27 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
tags/for-linus-2

for you to fetch changes up to e404f945a6101a6f0f2a29aade6dc32015471daa:

  IB/rxe: improved debug prints & code cleanup (2016-10-06 13:50:04 -0400)

----------------------------------------------------------------
Minor updates for rxe driver

----------------------------------------------------------------
Parav Pandit (5):
      IB/rxe: Avoid scheduling tasklet for userspace QP
      IB/rxe: Fix sending out loopback packet on netdev interface.
      IB/{rxe,core,rdmavt}: Fix kernel crash for reg MR
      IB/rxe: Properly honor max IRD value for rd/atomic.
      IB/rxe: improved debug prints & code cleanup

Stephen Bates (1):
      rdma_rxe: Ensure rdma_rxe init occurs at correct time

 drivers/infiniband/sw/rdmavt/dma.c    | 17 +++++++++++
 drivers/infiniband/sw/rxe/rxe.c       | 36 +++++------------------
 drivers/infiniband/sw/rxe/rxe.h       |  5 ++++
 drivers/infiniband/sw/rxe/rxe_av.c    |  4 +--
 drivers/infiniband/sw/rxe/rxe_comp.c  |  6 ++--
 drivers/infiniband/sw/rxe/rxe_dma.c   | 17 +++++++++++
 drivers/infiniband/sw/rxe/rxe_loc.h   |  2 +-
 drivers/infiniband/sw/rxe/rxe_mmap.c  |  2 +-
 drivers/infiniband/sw/rxe/rxe_mr.c    |  2 +-
 drivers/infiniband/sw/rxe/rxe_net.c   | 51 ++++++++++++++++++++++----------
 drivers/infiniband/sw/rxe/rxe_net.h   |  3 +-
 drivers/infiniband/sw/rxe/rxe_qp.c    | 55
+++++++++++++++++++----------------
 drivers/infiniband/sw/rxe/rxe_recv.c  |  3 +-
 drivers/infiniband/sw/rxe/rxe_req.c   | 19 ++++++------
 drivers/infiniband/sw/rxe/rxe_resp.c  | 27 +++++++++++------
 drivers/infiniband/sw/rxe/rxe_sysfs.c | 12 ++++----
 drivers/infiniband/sw/rxe/rxe_verbs.c | 50 +++++++++++++++++++------------
 include/rdma/ib_verbs.h               | 23 +++++++++++++--
 18 files changed, 210 insertions(+), 124 deletions(-)

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply

* Re: [PATCH 0/5 for rdma-core] Five rxe_cfg patches
From: Jason Gunthorpe @ 2016-10-07 22:07 UTC (permalink / raw)
  To: Parav Pandit; +Cc: Bart Van Assche, Doug Ledford, Moni Shoua, linux-rdma
In-Reply-To: <CAG53R5XMwgs6rj9cMnniHk8xvYqk9zxOv1Nuhog3CJfNCpmDFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sat, Oct 08, 2016 at 03:12:45AM +0530, Parav Pandit wrote:

> Instead of relying on user land to do configuration of different OS
> flavors, I am considering to auto create rxe interfaces via netdev
> notifier for all the network interfaces which gets newly added.

Interesting, my concern is that rxe seems to currently be buggy and
inadvertently enabling rxe on any non-dev systems at this time is
probably insane from a security perspective :\

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 0/5 for rdma-core] Five rxe_cfg patches
From: Parav Pandit @ 2016-10-07 22:14 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Bart Van Assche, Doug Ledford, Moni Shoua, linux-rdma
In-Reply-To: <20161007220736.GB9810-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Sat, Oct 8, 2016 at 3:37 AM, Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> On Sat, Oct 08, 2016 at 03:12:45AM +0530, Parav Pandit wrote:
>
>> Instead of relying on user land to do configuration of different OS
>> flavors, I am considering to auto create rxe interfaces via netdev
>> notifier for all the network interfaces which gets newly added.
>
> Interesting, my concern is that rxe seems to currently be buggy and
> inadvertently enabling rxe on any non-dev systems at this time is
> probably insane from a security perspective :\
>

Sure. Yes. I agree. Once its stable I can take this up.
However if rdma_rxe is not loaded, its should be fine.

> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PULL REQUEST] Please pull rdma.git (tag for-linus)
From: Doug Ledford @ 2016-10-07 22:24 UTC (permalink / raw)
  To: Torvalds, Linus, linux-rdma


[-- Attachment #1.1: Type: text/plain, Size: 21729 bytes --]

Hi Linus,

This is the second pull request and it is the main pull request for the
rdma stack this release.  The pull request looks larger than it will end
up being when you take it.  At the early stage of 4.9 development,
Mellanox submitted 30 patches to both DaveM's tree and mine, and we both
pulled them from Leon's tree so we had identical git hashes and the
patches will simply fall away when you pull from my tree since you've
already pulled DaveM's tree.  But, my git request-pull macro can't
separate that out, so they show up in the pull request but won't make it
through the final merge.

There are three conflicts in this merge (that don't automatically resolve):

1) cxgb4 - keep the head version in your tree, my tree and the common
ancestor were prior to a refactoring in your tree that moved uld_attach
from cxgb4_main.c to cxgb4_uld.c

2) mlx4 - Keep both additions in fw.c, and pick one addition to be 36
and one to be 37 in device.h (which is which is not important).  I asked
Leon why this happened since we've done really well lately at avoiding
all Mellanox conflicts like this, and his response is that two patches
were submitted during the last rc cycles and Mellanox had expected one
to go into for-next and the other to go into -rc (one went to Dave and
one to me).  Instead, we swapped and the one they thought would go into
-rc went into -next and vice versa.  That overlooked that when
submitting their 4.9 patches, and it resulted in this oversight.

Aside from these issues, the merge should be clean.  The code has been
through 0day and I had it tagged for linux-next testing for a couple
days, but the changes to pull the rxe patches out and move them mean
that whatever linux-next testing had been done is no longer completely
valid.  I've done manual merge testing to compensate.

Here's the boilerplate (with the 30 extra commit messages and the
diffstat from those commits):

The following changes since commit c1346a7e70b5be7f01cc1f64a7e3aefb80d48ad7:

  Revert "l2tp: Refactor the codes with existing macros instead of
literal number" (2016-08-21 15:50:11 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
tags/for-linus

for you to fetch changes up to 2937f375751922ffce9ef1d5fa84491840b0c8e0:

  staging/lustre: Disable InfiniBand support (2016-10-07 16:54:41 -0400)

----------------------------------------------------------------
Merge of primary rdma-core code for 4.9

- Updates to mlx5
- Updates to mlx4 (two conflicts, both minor and easily resolved)
- Updates to iw_cxgb4 (one conflict, not so obvious to resolve, proper
  resolution is to keep the code in cxgb4_main.c as it is in Linus'
  tree as attach_uld was refactored and moved into cxgb4_uld.c)
- Improvements to uAPI (moved vendor specific API elements to uAPI area)
- Add hns-roce driver and hns and hns-roce ACPI reset support
- Conversion of all rdma code away from deprecated
  create_singlethread_workqueue
- Security improvement: remove unsafe ib_get_dma_mr (breaks lustre in
  staging)

----------------------------------------------------------------
Alex Vesker (3):
      net/mlx5: Modify RQ bitmask from mlx5 ifc
      IB/mlx5: Refactor raw packet QP modify function
      IB/mlx5: Add port counter support for raw packet QP

Artemy Kovalyov (1):
      net/mlx5: Update struct mlx5_ifc_xrqc_bits

Aviv Heller (14):
      net/mlx5: Add HW interfaces used by LAG
      net/mlx5: Implement RoCE LAG feature
      net/mlx5: Get RoCE netdev
      net/mlx5e: Avoid port remapping of mlx5e netdev TISes
      net/mlx5: LAG and SRIOV cannot be used together
      net/mlx5: LAG demux flow table support
      net/mlx5: Add LAG flow steering namespace
      net/mlx5: Vport LAG creation support
      net/mlx5: Configure IB devices according to LAG state
      IB/mlx5: Port events in RoCE now rely on netdev events
      IB/mlx5: Merge vports flow steering during LAG
      IB/mlx5: Port status track LAG master, when LAG is active
      IB/mlx5: Set unique device name on LAG
      IB/mlx5: LAG QP load balancing

Bart Van Assche (3):
      IB/core: Improve ib_map_mr_sg() documentation
      IB/srp: Remove an unused argument
      IB/srp: Fix infinite loop when FMR sg[0].offset != 0

Bhaktipriya Shridhar (22):
      IB/sa : Remove deprecated create_singlethread_workqueue
      IB/mad: Remove deprecated create_singlethread_workqueue
      IB/multicast: Remove deprecated create_singlethread_workqueue
      IB/ucma: Remove deprecated create_singlethread_workqueue
      IB/cma: Remove deprecated create_singlethread_workqueue
      IB/addr: Remove deprecated create_singlethread_workqueue
      IB/iwcm: Remove deprecated create_singlethread_workqueue
      iw_cxgb3: Remove deprecated create_singlethread_workqueue
      IB/qib: Remove deprecated create_singlethread_workqueue
      iw_cxgb4: Remove deprecated create_singlethread_workqueue
      IB/mthca: Remove deprecated create_singlethread_workqueue
      i40iw_main: Remove deprecated create_singlethread_workqueue
      i40iw_cm: Remove deprecated create_singlethread_workqueue
      IB/mlx5: Remove deprecated create_singlethread_workqueue
      IB/mlx5/odp: Remove deprecated create_singlethread_workqueue
      IB/mlx4: Remove deprecated create_singlethread_workqueue
      IB/mlx4/mad: Remove deprecated create_singlethread_workqueue
      IB/mlx4/mcg: Remove deprecated create_singlethread_workqueue
      IB/nes: Remove deprecated create_singlethread_workqueue
      IB/ipoib: Remove deprecated create_singlethread_workqueue
      IB/ipoib_verbs: Remove deprecated create_singlethread_workqueue
      IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue

Christoph Hellwig (6):
      IB/core: rename pd->local_mr to pd->__internal_mr
      IB/core: add support to create a unsafe global rkey to ib_create_pd
      IB/iser: use IB_PD_UNSAFE_GLOBAL_RKEY
      IB/srp: use IB_PD_UNSAFE_GLOBAL_RKEY
      nvme-rdma: use IB_PD_UNSAFE_GLOBAL_RKEY
      IB/core: remove ib_get_dma_mr

Doug Ledford (5):
      Merge tag 'shared-for-4.9-1' of
git://git.kernel.org/.../leon/linux-rdma into mlx5-shared
      Merge tag 'shared-for-4.9-2' of
git://git.kernel.org/.../leon/linux-rdma into mlx5-shared
      Merge branch 'mlx5-shared' into k.o/for-4.9
      Merge branch 'hns-roce' into k.o/for-4.9
      staging/lustre: Disable InfiniBand support

Hadar Hen Zion (2):
      net/mlx5: Enable setting minimum inline header mode for VFs
      net/mlx5: Update mlx5_ifc.h for vxlan encap/decap

Ilya Lesokhin (1):
      net/mlx5: Introduce alloc_encap and dealloc_encap commands

Jack Morgenstein (1):
      IB/mlx4: Fix possible vl/sl field mismatch in LRH header in QP1
packets

Leon Romanovsky (7):
      IB/mlx5: Move and decouple user vendor structures
      IB/cxgb3: Move user vendor structures
      IB/cxgb4: Move user vendor structures
      IB/mlx4: Move user vendor structures
      IB/ocrdma: Move user vendor structures
      IB/nes: Move user vendor structures
      IB/mthca: Move user vendor structures

Maor Gottlieb (14):
      net/mlx5: Introduce sniffer steering hardware capabilities
      net/mlx5: Add sniffer namespaces
      IB/mlx5: Fix steering resource leak
      IB/mlx5: Save flow table priority handler instead of index
      IB/mlx5: Fix coverity warning
      IB/mlx5: Increase flow table reference count in create rule
      IB/mlx5: Add sniffer support to steering
      IB/mlx4: Add validation to flow specifications parsing
      IB/mlx5: Add validation to flow specifications parsing
      IB/uverbs: Add support to extend flow steering specifications
      IB/uverbs: Add more fields to IPv4 flow specification
      IB/core: Add more fields to IPv6 flow specification
      IB/mlx5: Add support in TOS and protocol to flow steering
      IB/mlx5: Add support of more IPv6 fields to flow steering

Noa Osherovich (2):
      net/mlx5: Expose mlx5e_link_mode
      net/mlx5: Separate query_port_proto_oper for IB and EN

Saeed Mahameed (12):
      net/mlx5: Init/Teardown hca commands via mlx5 ifc
      net/mlx5: Access register and MAD IFC commands via mlx5 ifc
      net/mlx5: PD and UAR commands via mlx5 ifc
      net/mlx5: MCG commands via mlx5 ifc
      net/mlx5: Pages management commands via mlx5 ifc
      net/mlx5: EQ commands via mlx5 ifc
      {net,IB}/mlx5: CQ commands via mlx5 ifc
      {net,IB}/mlx5: MKey/PSV commands via mlx5 ifc
      {net,IB}/mlx5: QP/XRCD commands via mlx5 ifc
      {net,IB}/mlx5: Modify QP commands via mlx5 ifc
      net/mlx5: Unify and improve command interface
      net/mlx5: Improve driver log messages

Salil (2):
      net: hns: Add support of ACPI to HNS driver RoCE Reset function
      IB/hns: Add support of ACPI to the Hisilicon RoCE driver

Steve Wise (3):
      IB/core: correctly handle rdma_rw_init_mrs() failure
      cxgb4: advertise support for FR_NSMR_TPTE_WR
      iw_cxgb4: add fast-path for small REG_MR operations

Wei Yongjun (1):
      IB/hns: Fix return value check in hns_roce_get_cfg()

Yishai Hadas (4):
      IB/core: Expose RSS related capabilities
      IB/uverbs: Expose RSS related capabilities
      IB/mlx5: Expose RSS related capabilities
      IB/mlx5: Track asynchronous events on a receive work queue

Yuval Shaia (1):
      IB/{core,hw}: Add constant for node_desc

kernel-6AxghH7DbtA@public.gmane.org (1):
      ipoib: Make ipoib_warn ratelimited

oulijun (4):
      devicetree: bindings: IB: Add binding document for Hisilicon RoCE
      IB/hns: Add driver files for hns RoCE driver
      IB/hns: Kconfig and Makefile for RoCE module
      MAINTAINERS: Add maintainers for Hisilicon RoCE driver

 .../bindings/infiniband/hisilicon-hns-roce.txt     |  107 +
 MAINTAINERS                                        |   14 +
 drivers/infiniband/Kconfig                         |    1 +
 drivers/infiniband/core/addr.c                     |    2 +-
 drivers/infiniband/core/cma.c                      |    2 +-
 drivers/infiniband/core/iwcm.c                     |    2 +-
 drivers/infiniband/core/mad.c                      |    4 +-
 drivers/infiniband/core/multicast.c                |    2 +-
 drivers/infiniband/core/sa_query.c                 |    2 +-
 drivers/infiniband/core/sysfs.c                    |    2 +-
 drivers/infiniband/core/ucma.c                     |    3 +-
 drivers/infiniband/core/uverbs_cmd.c               |  121 +-
 drivers/infiniband/core/verbs.c                    |   77 +-
 drivers/infiniband/hw/Makefile                     |    1 +
 drivers/infiniband/hw/cxgb3/iwch.c                 |    2 +-
 drivers/infiniband/hw/cxgb3/iwch_cm.c              |    2 +-
 drivers/infiniband/hw/cxgb3/iwch_provider.c        |    3 +-
 drivers/infiniband/hw/cxgb4/cm.c                   |    2 +-
 drivers/infiniband/hw/cxgb4/cq.c                   |   17 +
 drivers/infiniband/hw/cxgb4/iw_cxgb4.h             |    2 +-
 drivers/infiniband/hw/cxgb4/mem.c                  |    2 +-
 drivers/infiniband/hw/cxgb4/provider.c             |    1 +
 drivers/infiniband/hw/cxgb4/qp.c                   |   67 +-
 drivers/infiniband/hw/cxgb4/t4.h                   |    4 +-
 drivers/infiniband/hw/cxgb4/t4fw_ri_api.h          |   12 +
 drivers/infiniband/hw/hfi1/verbs.c                 |    3 +-
 drivers/infiniband/hw/hns/Kconfig                  |   10 +
 drivers/infiniband/hw/hns/Makefile                 |    8 +
 drivers/infiniband/hw/hns/hns_roce_ah.c            |  128 +
 drivers/infiniband/hw/hns/hns_roce_alloc.c         |  257 ++
 drivers/infiniband/hw/hns/hns_roce_cmd.c           |  368 +++
 drivers/infiniband/hw/hns/hns_roce_cmd.h           |   80 +
 drivers/infiniband/hw/hns/hns_roce_common.h        |  325 +++
 drivers/infiniband/hw/hns/hns_roce_cq.c            |  446 ++++
 drivers/infiniband/hw/hns/hns_roce_device.h        |  734 +++++
 drivers/infiniband/hw/hns/hns_roce_eq.c            |  762 ++++++
 drivers/infiniband/hw/hns/hns_roce_eq.h            |  130 +
 drivers/infiniband/hw/hns/hns_roce_hem.c           |  476 ++++
 drivers/infiniband/hw/hns/hns_roce_hem.h           |  131 +
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c         | 2800
++++++++++++++++++++
 drivers/infiniband/hw/hns/hns_roce_hw_v1.h         |  981 +++++++
 drivers/infiniband/hw/hns/hns_roce_main.c          | 1142 ++++++++
 drivers/infiniband/hw/hns/hns_roce_mr.c            |  614 +++++
 drivers/infiniband/hw/hns/hns_roce_pd.c            |  144 +
 drivers/infiniband/hw/hns/hns_roce_qp.c            |  855 ++++++
 drivers/infiniband/hw/hns/hns_roce_user.h          |   53 +
 drivers/infiniband/hw/i40iw/i40iw_cm.c             |    7 +-
 drivers/infiniband/hw/i40iw/i40iw_main.c           |    2 +-
 drivers/infiniband/hw/mlx4/alias_GUID.c            |    2 +-
 drivers/infiniband/hw/mlx4/cq.c                    |    2 +-
 drivers/infiniband/hw/mlx4/mad.c                   |   73 +-
 drivers/infiniband/hw/mlx4/main.c                  |  147 +-
 drivers/infiniband/hw/mlx4/mcg.c                   |    4 +-
 drivers/infiniband/hw/mlx4/mlx4_ib.h               |    7 +
 drivers/infiniband/hw/mlx4/qp.c                    |   25 +-
 drivers/infiniband/hw/mlx4/srq.c                   |    2 +-
 drivers/infiniband/hw/mlx5/cq.c                    |  111 +-
 drivers/infiniband/hw/mlx5/mad.c                   |    2 +-
 drivers/infiniband/hw/mlx5/main.c                  |  404 ++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h               |   52 +-
 drivers/infiniband/hw/mlx5/mr.c                    |  187 +-
 drivers/infiniband/hw/mlx5/odp.c                   |    4 +-
 drivers/infiniband/hw/mlx5/qp.c                    |  347 ++-
 drivers/infiniband/hw/mlx5/srq.c                   |    1 -
 drivers/infiniband/hw/mthca/mthca_catas.c          |    2 +-
 drivers/infiniband/hw/mthca/mthca_mad.c            |    3 +-
 drivers/infiniband/hw/mthca/mthca_provider.c       |    7 +-
 drivers/infiniband/hw/nes/nes.h                    |    2 +-
 drivers/infiniband/hw/nes/nes_cm.c                 |    4 +-
 drivers/infiniband/hw/ocrdma/ocrdma_main.c         |    3 +-
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c        |    2 +-
 drivers/infiniband/hw/qib/qib_init.c               |    4 +-
 drivers/infiniband/hw/qib/qib_verbs.c              |    3 +-
 drivers/infiniband/ulp/ipoib/ipoib.h               |    8 +-
 drivers/infiniband/ulp/ipoib/ipoib_main.c          |    3 +-
 drivers/infiniband/ulp/ipoib/ipoib_verbs.c         |    4 +-
 drivers/infiniband/ulp/iser/iscsi_iser.h           |    1 -
 drivers/infiniband/ulp/iser/iser_memory.c          |    6 +-
 drivers/infiniband/ulp/iser/iser_verbs.c           |   22 +-
 drivers/infiniband/ulp/isert/ib_isert.c            |    2 +-
 drivers/infiniband/ulp/srp/ib_srp.c                |   56 +-
 drivers/infiniband/ulp/srp/ib_srp.h                |    3 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c              |    2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h         |    1 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c    |    7 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h     |    1 +
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h      |    2 +
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c  |   17 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c |   47 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h |    9 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c |   53 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.h |    3 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h  |    4 +-
 drivers/net/ethernet/mellanox/mlx4/fw.c            |   13 +-
 drivers/net/ethernet/mellanox/mlx5/core/Makefile   |    2 +-
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |  273 +-
 drivers/net/ethernet/mellanox/mlx5/core/cq.c       |  109 +-
 drivers/net/ethernet/mellanox/mlx5/core/debugfs.c  |   50 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h       |   34 -
 .../net/ethernet/mellanox/mlx5/core/en_common.c    |   23 +-
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c   |    3 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   55 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |    4 +-
 drivers/net/ethernet/mellanox/mlx5/core/eq.c       |   80 +-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |   98 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c   |  232 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h   |    8 +
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c  |  118 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h  |   10 +
 drivers/net/ethernet/mellanox/mlx5/core/fw.c       |   43 +-
 drivers/net/ethernet/mellanox/mlx5/core/lag.c      |  602 +++++
 drivers/net/ethernet/mellanox/mlx5/core/mad.c      |   41 +-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |  145 +-
 drivers/net/ethernet/mellanox/mlx5/core/mcg.c      |   72 +-
 .../net/ethernet/mellanox/mlx5/core/mlx5_core.h    |   44 +-
 drivers/net/ethernet/mellanox/mlx5/core/mr.c       |  189 +-
 .../net/ethernet/mellanox/mlx5/core/pagealloc.c    |  156 +-
 drivers/net/ethernet/mellanox/mlx5/core/pd.c       |   61 +-
 drivers/net/ethernet/mellanox/mlx5/core/port.c     |  181 +-
 drivers/net/ethernet/mellanox/mlx5/core/qp.c       |  299 ++-
 drivers/net/ethernet/mellanox/mlx5/core/rl.c       |   11 +-
 drivers/net/ethernet/mellanox/mlx5/core/sriov.c    |   19 +-
 drivers/net/ethernet/mellanox/mlx5/core/srq.c      |   49 +-
 drivers/net/ethernet/mellanox/mlx5/core/transobj.c |  183 +-
 drivers/net/ethernet/mellanox/mlx5/core/uar.c      |   67 +-
 drivers/net/ethernet/mellanox/mlx5/core/vport.c    |   94 +-
 drivers/net/ethernet/mellanox/mlx5/core/vxlan.c    |   29 +-
 drivers/nvme/host/rdma.c                           |   25 +-
 drivers/nvme/target/rdma.c                         |    2 +-
 drivers/staging/lustre/lnet/Kconfig                |    1 +
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |    2 +-
 include/linux/mlx4/device.h                        |   13 +-
 include/linux/mlx5/cq.h                            |    6 +-
 include/linux/mlx5/device.h                        |  441 +--
 include/linux/mlx5/driver.h                        |   31 +-
 include/linux/mlx5/fs.h                            |    6 +
 include/linux/mlx5/mlx5_ifc.h                      |  297 ++-
 include/linux/mlx5/port.h                          |   40 +-
 include/linux/mlx5/qp.h                            |  128 +-
 include/linux/mlx5/vport.h                         |    2 +
 include/rdma/ib_verbs.h                            |   81 +-
 include/uapi/rdma/Kbuild                           |    7 +
 .../iwch_user.h => include/uapi/rdma/cxgb3-abi.h   |    8 +-
 .../cxgb4/user.h => include/uapi/rdma/cxgb4-abi.h  |   11 +-
 include/uapi/rdma/ib_user_verbs.h                  |   27 +-
 .../hw/mlx4/user.h => include/uapi/rdma/mlx4-abi.h |    6 +-
 .../hw/mlx5/user.h => include/uapi/rdma/mlx5-abi.h |   52 +-
 include/uapi/rdma/mthca-abi.h                      |  111 +
 .../nes/nes_user.h => include/uapi/rdma/nes-abi.h  |    6 +-
 .../ocrdma_abi.h => include/uapi/rdma/ocrdma-abi.h |  138 +-
 net/9p/trans_rdma.c                                |    2 +-
 net/rds/ib.c                                       |    2 +-
 net/sunrpc/xprtrdma/svc_rdma_transport.c           |    2 +-
 net/sunrpc/xprtrdma/verbs.c                        |    2 +-
 154 files changed, 14583 insertions(+), 2824 deletions(-)
 create mode 100644
Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt
 create mode 100644 drivers/infiniband/hw/hns/Kconfig
 create mode 100644 drivers/infiniband/hw/hns/Makefile
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_ah.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_alloc.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_cmd.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_cmd.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_common.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_cq.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_device.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_eq.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_eq.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_hem.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_hem.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_hw_v1.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_hw_v1.h
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_main.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_mr.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_pd.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_qp.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_user.h
 create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/lag.c
 rename drivers/infiniband/hw/cxgb3/iwch_user.h =>
include/uapi/rdma/cxgb3-abi.h (95%)
 rename drivers/infiniband/hw/cxgb4/user.h =>
include/uapi/rdma/cxgb4-abi.h (94%)
 rename drivers/infiniband/hw/mlx4/user.h =>
include/uapi/rdma/mlx4-abi.h (97%)
 rename drivers/infiniband/hw/mlx5/user.h =>
include/uapi/rdma/mlx5-abi.h (83%)
 create mode 100644 include/uapi/rdma/mthca-abi.h
 rename drivers/infiniband/hw/nes/nes_user.h =>
include/uapi/rdma/nes-abi.h (97%)
 rename drivers/infiniband/hw/ocrdma/ocrdma_abi.h =>
include/uapi/rdma/ocrdma-abi.h (64%)

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply

* [PATCH rdma-core 0/5] clang support
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA

This series gets clang running warning free and has travis run the build
through clang-3.9 so we don't break it again.

Jason Gunthorpe (5):
  Pull uninitialized_var into util/compiler.h
  ibacm: Avoid clang 3.8 warning -Wmissing-field-initializers
  mthca: Avoid bogus gcc 4.8 warning -Wmaybe-uninitialized
  Improve linker flag detection to work with clang and -Werror
  Update TravisCI to use clang 3.9 as well

 .travis.yml                    | 20 +++++++++++++++++---
 CMakeLists.txt                 | 22 ++++++++++++++--------
 buildlib/FindLDSymVer.cmake    | 16 ++++++++++++----
 buildlib/RDMA_EnableCStd.cmake | 25 +++++++++++++++++++++++++
 ibacm/prov/acmp/src/acmp.c     |  2 +-
 providers/cxgb4/cq.c           |  1 +
 providers/cxgb4/libcxgb4.h     |  2 --
 providers/cxgb4/qp.c           |  1 +
 providers/mlx4/mlx4.h          |  4 ----
 providers/mlx4/qp.c            |  1 +
 providers/mlx5/mlx5.h          |  4 ----
 providers/mlx5/qp.c            |  1 +
 providers/mthca/qp.c           | 23 +++++------------------
 util/CMakeLists.txt            |  3 +++
 util/compiler.h                | 18 ++++++++++++++++++
 15 files changed, 99 insertions(+), 44 deletions(-)
 create mode 100644 util/CMakeLists.txt
 create mode 100644 util/compiler.h

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH rdma-core 1/5] Pull uninitialized_var into util/compiler.h
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

The new common definition turns it off for new compilers since
it is not needed and is too easy to abuse.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt             |  1 +
 providers/cxgb4/cq.c       |  1 +
 providers/cxgb4/libcxgb4.h |  2 --
 providers/cxgb4/qp.c       |  1 +
 providers/mlx4/mlx4.h      |  4 ----
 providers/mlx4/qp.c        |  1 +
 providers/mlx5/mlx5.h      |  4 ----
 providers/mlx5/qp.c        |  1 +
 util/CMakeLists.txt        |  3 +++
 util/compiler.h            | 18 ++++++++++++++++++
 10 files changed, 26 insertions(+), 10 deletions(-)
 create mode 100644 util/CMakeLists.txt
 create mode 100644 util/compiler.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0864da660fc..1611e90d7933 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -253,6 +253,7 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
 #-------------------------
 # Sub-directories
 add_subdirectory(ccan)
+add_subdirectory(util)
 # Libraries
 add_subdirectory(libibumad)
 add_subdirectory(libibumad/man)
diff --git a/providers/cxgb4/cq.c b/providers/cxgb4/cq.c
index 1ed7dfdb88d4..5f662ac49d0c 100644
--- a/providers/cxgb4/cq.c
+++ b/providers/cxgb4/cq.c
@@ -37,6 +37,7 @@
 #include <sys/errno.h>
 #include <netinet/in.h>
 #include <infiniband/opcode.h>
+#include <util/compiler.h>
 #include "libcxgb4.h"
 #include "cxgb4-abi.h"
 
diff --git a/providers/cxgb4/libcxgb4.h b/providers/cxgb4/libcxgb4.h
index 4c8383209287..9a4bc98f34e9 100644
--- a/providers/cxgb4/libcxgb4.h
+++ b/providers/cxgb4/libcxgb4.h
@@ -264,6 +264,4 @@ void dump_state();
 extern int stall_to;
 #endif
 
-#define uninitialized_var(x) x = x
-
 #endif				/* IWCH_H */
diff --git a/providers/cxgb4/qp.c b/providers/cxgb4/qp.c
index 384bf11369ac..95b459a1a9b4 100644
--- a/providers/cxgb4/qp.c
+++ b/providers/cxgb4/qp.c
@@ -37,6 +37,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <netinet/in.h>
+#include <util/compiler.h>
 #include "libcxgb4.h"
 
 #ifdef STATS
diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h
index 95a6521c457b..a2d39e169c15 100644
--- a/providers/mlx4/mlx4.h
+++ b/providers/mlx4/mlx4.h
@@ -43,10 +43,6 @@
 
 #define MLX4_PORTS_NUM 2
 
-#ifndef uninitialized_var
-#define uninitialized_var(x) x = x
-#endif
-
 #include <valgrind/memcheck.h>
 
 #define PFX		"mlx4: "
diff --git a/providers/mlx4/qp.c b/providers/mlx4/qp.c
index 4b5acd71108e..268fb7dc83dd 100644
--- a/providers/mlx4/qp.c
+++ b/providers/mlx4/qp.c
@@ -39,6 +39,7 @@
 #include <pthread.h>
 #include <string.h>
 #include <errno.h>
+#include <util/compiler.h>
 
 #include "mlx4.h"
 #include "doorbell.h"
diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h
index f8674c7a90db..cb65429b51f7 100644
--- a/providers/mlx5/mlx5.h
+++ b/providers/mlx5/mlx5.h
@@ -48,10 +48,6 @@
 #define unlikely(x)	__builtin_expect((x), 0)
 #endif
 
-#ifndef uninitialized_var
-#define uninitialized_var(x) x = x
-#endif
-
 #include <valgrind/memcheck.h>
 
 #ifdef HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
diff --git a/providers/mlx5/qp.c b/providers/mlx5/qp.c
index 04abe1588d6e..e82b1a0bebc3 100644
--- a/providers/mlx5/qp.c
+++ b/providers/mlx5/qp.c
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
+#include <util/compiler.h>
 
 #include "mlx5.h"
 #include "doorbell.h"
diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
new file mode 100644
index 000000000000..1cda8905d8f4
--- /dev/null
+++ b/util/CMakeLists.txt
@@ -0,0 +1,3 @@
+publish_internal_headers(util
+  compiler.h
+  )
diff --git a/util/compiler.h b/util/compiler.h
new file mode 100644
index 000000000000..9b57e048df4b
--- /dev/null
+++ b/util/compiler.h
@@ -0,0 +1,18 @@
+/* GPLv2 or OpenIB.org BSD (MIT) See COPYING file */
+#ifndef UTIL_COMPILER_H
+#define UTIL_COMPILER_H
+
+/* Use to tag a variable that causes compiler warnings. Use as:
+    int uninitialized_var(sz)
+
+   This is only enabled for old compilers. gcc 6.x and beyond have excellent
+   static flow analysis. If code solicits a warning from 6.x it is almost
+   certainly too complex for a human to understand.
+*/
+#if __GNUC__ >= 6 || defined(__clang__)
+#define uninitialized_var(x) x
+#else
+#define uninitialized_var(x) x = x
+#endif
+
+#endif
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 2/5] ibacm: Avoid clang 3.8 warning -Wmissing-field-initializers
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

The canonical way to zero fill a struct in this tree is {}.

Fixes: 0db49b8b3e8f ("Avoid clang 3.6 warning -Wmissing-field-initializers")
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 ibacm/prov/acmp/src/acmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index 3f590d0b51f3..d70501aff8e8 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -2118,7 +2118,7 @@ static void acmp_parse_osm_fullv1_lid2guid(FILE *f, uint64_t *lid2guid)
 static int acmp_parse_osm_fullv1_paths(FILE *f, uint64_t *lid2guid, struct acmp_ep *ep)
 {
 	union ibv_gid sgid, dgid;
-	struct ibv_port_attr attr = { 0 };
+	struct ibv_port_attr attr = {};
 	struct acmp_dest *dest;
 	char s[128];
 	char *p, *ptr, *p_guid, *p_lid;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 3/5] mthca: Avoid bogus gcc 4.8 warning -Wmaybe-uninitialized
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Newer compilers get this right, so use uninitialized_var()

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 providers/mthca/qp.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

diff --git a/providers/mthca/qp.c b/providers/mthca/qp.c
index 715ca65e9bd6..129e6c74ef53 100644
--- a/providers/mthca/qp.c
+++ b/providers/mthca/qp.c
@@ -37,6 +37,7 @@
 #include <netinet/in.h>
 #include <pthread.h>
 #include <string.h>
+#include <util/compiler.h>
 
 #include "mthca.h"
 #include "doorbell.h"
@@ -107,15 +108,8 @@ int mthca_tavor_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 	int size;
 	int size0 = 0;
 	int i;
-	/*
-	 * f0 and op0 cannot be used unless nreq > 0, which means this
-	 * function makes it through the loop at least once.  So the
-	 * code inside the if (!size0) will be executed, and f0 and
-	 * op0 will be initialized.  So any gcc warning about "may be
-	 * used unitialized" is bogus.
-	 */
-	uint32_t f0;
-	uint32_t op0;
+	uint32_t uninitialized_var(f0);
+	uint32_t uninitialized_var(op0);
 
 	pthread_spin_lock(&qp->sq.lock);
 
@@ -449,15 +443,8 @@ int mthca_arbel_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 	int size;
 	int size0 = 0;
 	int i;
-	/*
-	 * f0 and op0 cannot be used unless nreq > 0, which means this
-	 * function makes it through the loop at least once.  So the
-	 * code inside the if (!size0) will be executed, and f0 and
-	 * op0 will be initialized.  So any gcc warning about "may be
-	 * used unitialized" is bogus.
-	 */
-	uint32_t f0;
-	uint32_t op0;
+	uint32_t uninitialized_var(f0);
+	uint32_t uninitialized_var(op0);
 
 	pthread_spin_lock(&qp->sq.lock);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 4/5] Improve linker flag detection to work with clang and -Werror
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

If a linker flag is passed to a clang compile command then it
prints out a warning that the flag is a linker flag. If -Werror
is set then the warning is an error and all linker flag detection
is broken.

The fix is to only pass linker flags to the linker. cmake does not have
an integrated way to do this until 3.2, the recommended approach is to
abuse CMAKE_REQUIRED_LIBRARIES on older versions.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt                 | 21 +++++++++++++--------
 buildlib/FindLDSymVer.cmake    | 16 ++++++++++++----
 buildlib/RDMA_EnableCStd.cmake | 25 +++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1611e90d7933..4d291d2c3fb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,11 @@ else()
   string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
 endif()
 
+# Make RDMA_CHECK_C_LINKER_FLAG work better
+if(POLICY CMP0056)
+  cmake_policy(SET CMP0056 NEW)
+endif()
+
 set(PACKAGE_NAME "RDMA")
 
 # See Documentation/versioning.md
@@ -150,18 +155,18 @@ CHECK_C_SOURCE_COMPILES("
 
 # Enable development support features
 # Prune unneeded shared libraries during linking
-RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
-RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
-RDMA_AddOptCFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+RDMA_AddOptLDFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
 
 # Ensure all shared ELFs have fully described linking
-RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
-RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
+RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
+RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
 
 # Enable gold linker - gold has different linking checks
-#RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
-#RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
-#RDMA_AddOptCFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+#RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+#RDMA_AddOptLDFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+#RDMA_AddOptLDFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
 
 # Verify that GNU --version-script and asm(".symver") works
 find_package(LDSymVer REQUIRED)
diff --git a/buildlib/FindLDSymVer.cmake b/buildlib/FindLDSymVer.cmake
index c0f01a562e32..7169b2c4db68 100644
--- a/buildlib/FindLDSymVer.cmake
+++ b/buildlib/FindLDSymVer.cmake
@@ -16,8 +16,14 @@ IBVERBS_1.1 {
 } IBVERBS_1.0;
 ")
 
-set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
-set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
+# See RDMA_CHECK_C_LINKER_FLAG
+set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+set(SAFE_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
+if (POLICY CMP0056)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
+else()
+  set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
+endif()
 
 # And matching source, this also checks that .symver asm works
 check_c_source_compiles("
@@ -26,9 +32,11 @@ asm(\".symver ibv_get_device_list_1, ibv_get_device_list@IBVERBS_1.1\");
 void ibv_get_device_list_0(void){}
 asm(\".symver ibv_get_device_list_0, ibv_get_device_list@@IBVERBS_1.0\");
 
-int main(void){return 0;}" _LDSYMVER_SUCCESS)
+int main(int argc,const char *argv[]){return 0;}" _LDSYMVER_SUCCESS)
+
 file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test.map")
-set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+set(CMAKE_EXE_LINKER_FLAGS "${SAFE_CMAKE_EXE_LINKER_FLAGS}")
+set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")
 
 if (_LDSYMVER_SUCCESS)
   set(LDSYMVER_MODE "GNU" CACHE INTERNAL "How to set symbol versions on shared libraries")
diff --git a/buildlib/RDMA_EnableCStd.cmake b/buildlib/RDMA_EnableCStd.cmake
index 9cbbb881cd19..bcf3ea525c73 100644
--- a/buildlib/RDMA_EnableCStd.cmake
+++ b/buildlib/RDMA_EnableCStd.cmake
@@ -1,5 +1,30 @@
 # COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
 
+# cmake does not have way to do this even slightly sanely until CMP0056
+function(RDMA_CHECK_C_LINKER_FLAG FLAG CACHE_VAR)
+  set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+  set(SAFE_CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
+
+  if (POLICY CMP0056)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}")
+  else()
+    set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} ${FLAG}")
+  endif()
+
+  CHECK_C_COMPILER_FLAG("" ${CACHE_VAR})
+
+  set(CMAKE_EXE_LINKER_FLAGS "${SAFE_CMAKE_EXE_LINKER_FLAGS}")
+  set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")
+endfunction()
+
+# Test if the CC compiler supports the linker flag and if so add it to TO_VAR
+function(RDMA_AddOptLDFlag TO_VAR CACHE_VAR FLAG)
+  RDMA_CHECK_C_LINKER_FLAG("${FLAG}" ${CACHE_VAR})
+  if (${CACHE_VAR})
+    SET(${TO_VAR} "${${TO_VAR}} ${FLAG}" PARENT_SCOPE)
+  endif()
+endfunction()
+
 # Test if the CC compiler supports the flag and if so add it to TO_VAR
 function(RDMA_AddOptCFlag TO_VAR CACHE_VAR FLAG)
   CHECK_C_COMPILER_FLAG("${FLAG}" ${CACHE_VAR})
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 5/5] Update TravisCI to use clang 3.9 as well
From: Jason Gunthorpe @ 2016-10-07 22:36 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Now that the build runs warning free on clang 3.9 as well.

clang has a different set of static checker type warnings.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 .travis.yml | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index a2b9e3b8c3f3..d81b699294eb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,15 +1,23 @@
 language: c
 # We need at least cmake 2.12, this means we need to use trusty.
 # Precise's glibc, etc predates what we are willing to support.
-# No reason for sudo.
+# sudo is required to get the trusty image, and at present to enable llvm 3.9
 sudo: required
 dist: trusty
 addons:
+  # We run our builds sequentially in one VM rather than try and use the
+  # matrix feature. This is because Travis is unreasonably inefficient
+  # doing this APT setup pass.
   apt:
     sources:
+      # sourceline because travis won't white list trusty builds, and hasn't
+      # whitelisted 3.9
+      - sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main"
+        key_url: "http://apt.llvm.org/llvm-snapshot.gpg.key"
       - ubuntu-toolchain-r-test
     packages:
       - build-essential
+      - clang-3.9
       - cmake
       - debhelper
       - gcc
@@ -25,16 +33,22 @@ addons:
       # 32 bit support packages
       - gcc-multilib
       - lib32gcc-6-dev
+
 script:
-  - mkdir build build32
+  - mkdir build build-clang build32
   - cd build
   # The goal is warning free compile on latest gcc.
   - CC=gcc-6 CFLAGS=-Werror cmake -GNinja ..
   - ninja
 
+  # .. and latest clang
+  - cd ../build-clang
+  - CC=clang-3.9 CFLAGS=-Werror cmake -GNinja ..
+  - ninja
+
   # 32 bit build
   - cd ../build32
-  # travis's trusty is not configured in a way that enables all32 bit
+  # travis's trusty is not configured in a way that enables all 32 bit
   # packages. We could fix this with some sudo stuff.. For now turn off libnl
   - CC=gcc-6 CFLAGS="-Werror -m32" cmake -GNinja .. -DENABLE_RESOLVE_NEIGH=0
   - ninja
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [Bug 176901] New: Running ib_rdma_bw over rxe loopback triggers a kernel oops
From: Parav Pandit @ 2016-10-07 23:24 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-rdma
In-Reply-To: <9822c558-91d0-8d6a-8f64-07949d9fdaf7-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>

Hi Bart,

On Fri, Oct 7, 2016 at 10:19 PM, Bart Van Assche
<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org> wrote:
> Hello Parav,
>
>
> Something else I was wondering about is whether or not the rdma_rxe driver
> should allow being attached to a bridge interface?

My take is it should not to avoid mis configurations.
Below fix is required, which I tested to not allow on bridge type devices.
I will send formal patch.

diff --git a/drivers/infiniband/sw/rxe/rxe_sysfs.c
b/drivers/infiniband/sw/rxe/rxe_sysfs.c
index cf8e778..7f4e0f3 100644
--- a/drivers/infiniband/sw/rxe/rxe_sysfs.c
+++ b/drivers/infiniband/sw/rxe/rxe_sysfs.c
@@ -90,7 +90,11 @@ static int rxe_param_set_add(const char *val, const
struct kernel_param *kp)
                err = -EINVAL;
                goto err;
        }
-
+       if (netif_is_bridge_master(ndev)) {
+               pr_err("bridge device %s is unsupported\n", intf);
+               err = -EINVAL;
+               goto err;
+       }
        if (net_to_rxe(ndev)) {
                pr_err("rxe: already configured on %s\n", intf);
                err = -EINVAL;

> Apparently the rdma_rxe
> driver allows attaching to both the non-bridged and the bridged interfaces,
> resulting in duplicate GIDs:
>
> # modprobe rdma_rxe
> # brctl addbr virbr0
> # brctl addif virbr0 eth1
> # rxe_cfg add eth1
> # rxe_cfg add virbr0
> # rxe_cfg
>   Name    Link  Driver      Speed  NMTU  IPv4_addr      RDEV  RMTU
>   eth0    yes   virtio_net         1500  192.168.1.123
>   eth1    no    virtio_net         1500                 rxe0
>   virbr0  no    bridge             1500                 rxe1
> # (cd /sys/class/infiniband && grep -aH '' */ports/*/gids/0)
> rxe0/ports/1/gids/0:fe80:0000:0000:0000:5054:00ff:fefd:2e4e
> rxe1/ports/1/gids/0:fe80:0000:0000:0000:5054:00ff:fefd:2e4e
>
> Should it ever be allowed that two different ports have the same GID?
>
Not sure. It might be allowed LAG mode (at least IP based GID).
I am not upto date of recent LAG updates from Leon.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* I Hope You Get My Message This Time
From: Friedrich Mayrhofer @ 2016-10-08  2:13 UTC (permalink / raw)


This is the second time i am sending you this mail.

I, Friedrich Mayrhofer Donate $ 1,000,000.00 to You, Email  Me personally
for more details.

Regards.
Friedrich Mayrhofer

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: iscsi_trx going into D state
From: Zhu Lingshan @ 2016-10-08  2:59 UTC (permalink / raw)
  To: Robert LeBlanc, linux-rdma; +Cc: linux-scsi
In-Reply-To: <CAANLjFoj9-qscJOSf2jtKYt2+4cQxMHNJ9q2QTey4wyG5OTSAA@mail.gmail.com>

Hi Robert,

I also see this issue, but this is not the only code path can trigger 
this problem, I think you may also see iscsi_np in D status. I fixed one 
code path whitch still not merged to mainline. I will forward you my 
patch later. Note: my patch only fixed one code path, you may see other 
call statck with D status.

Thanks,
BR
Zhu Lingshan

在 2016/10/1 1:14, Robert LeBlanc 写道:
> We are having a reoccurring problem where iscsi_trx is going into D
> state. It seems like it is waiting for a session tear down to happen
> or something, but keeps waiting. We have to reboot these targets on
> occasion. This is running the 4.4.12 kernel and we have seen it on
> several previous 4.4.x and 4.2.x kernels. There is no message in dmesg
> or /var/log/messages. This seems to happen with increased frequency
> when we have a disruption in our Infiniband fabric, but can happen
> without any changes to the fabric (other than hosts rebooting).
>
> # ps aux | grep iscsi | grep D
> root      4185  0.0  0.0      0     0 ?        D    Sep29   0:00 [iscsi_trx]
> root     18505  0.0  0.0      0     0 ?        D    Sep29   0:00 [iscsi_np]
>
> # cat /proc/4185/stack
> [<ffffffff814cc999>] target_wait_for_sess_cmds+0x49/0x1a0
> [<ffffffffa087292b>] isert_wait_conn+0x1ab/0x2f0 [ib_isert]
> [<ffffffff814f0de2>] iscsit_close_connection+0x162/0x840
> [<ffffffff814df8df>] iscsit_take_action_for_connection_exit+0x7f/0x100
> [<ffffffff814effc0>] iscsi_target_rx_thread+0x5a0/0xe80
> [<ffffffff8109c6f8>] kthread+0xd8/0xf0
> [<ffffffff8172004f>] ret_from_fork+0x3f/0x70
> [<ffffffffffffffff>] 0xffffffffffffffff
>
> # cat /proc/18505/stack
> [<ffffffff814f0c71>] iscsit_stop_session+0x1b1/0x1c0
> [<ffffffff814e2436>] iscsi_check_for_session_reinstatement+0x1e6/0x270
> [<ffffffff814e4df0>] iscsi_target_check_for_existing_instances+0x30/0x40
> [<ffffffff814e4f40>] iscsi_target_do_login+0x140/0x640
> [<ffffffff814e62dc>] iscsi_target_start_negotiation+0x1c/0xb0
> [<ffffffff814e402b>] iscsi_target_login_thread+0xa9b/0xfc0
> [<ffffffff8109c6f8>] kthread+0xd8/0xf0
> [<ffffffff8172004f>] ret_from_fork+0x3f/0x70
> [<ffffffffffffffff>] 0xffffffffffffffff
>
> What can we do to help get this resolved?
>
> Thanks,
>
> ----------------
> Robert LeBlanc
> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply

* Re: Introduction of libqedr to the Consolidated Userspace RDMA Library Repo
From: Amrani, Ram @ 2016-10-08 12:49 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Elior, Ariel,
	Kalderon, Michal, Borundia, Rajesh,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
In-Reply-To: <20161006163427.GG1224-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>



>If you prepare a branch of rdma-core on github I can give it a quick
>look over.
>
>The technical steps are fairly simple, create a
>provider/qedr directory, add your source code, copy the CMakeLists.txt
>style from another provider, add a line to the sorted list in the top
>level CMakeLists.txt, update README.md, COPYING.md and MAINTAINERS
>
>You will want to look at the various patches I've prepared and ensure
>you cover off the basic cleanups that have already been done, and that
>your code compiles warning-free on FC24.
>
>Once you feel everything is ready then post it to the mailing list and
>send a pull request. For the mailing list you can just split the
>patches by file..
>
>Jason

Thanks, we'll start on it.


    --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH qedr 04/10] qedr: Add support for PD,PKEY and CQ verbs
From: Doug Ledford @ 2016-10-08 13:35 UTC (permalink / raw)
  To: Leon Romanovsky, Elior, Ariel
  Cc: Kalderon, Michal, Mintz, Yuval, Borundia, Rajesh,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Amrani, Ram
In-Reply-To: <20161007142454.GU9282-2ukJVAZIZ/Y@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2070 bytes --]

On 10/7/2016 10:24 AM, Leon Romanovsky wrote:
> On Fri, Oct 07, 2016 at 10:47:18AM +0000, Elior, Ariel wrote:
>>>> @@ -66,6 +85,12 @@ struct rdma_cqe_common {
>>>>     struct regpair qp_handle;
>>>>     __le16 reserved1[7];
>>>>     u8 flags;
>>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_MASK  0x1
>>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_SHIFT 0
>>>> +#define RDMA_CQE_COMMON_TYPE_MASK        0x3
>>>> +#define RDMA_CQE_COMMON_TYPE_SHIFT       1
>>>> +#define RDMA_CQE_COMMON_RESERVED2_MASK   0x1F
>>>> +#define RDMA_CQE_COMMON_RESERVED2_SHIFT  3
>>>>     u8 status;
>>>
>>> It is VERY uncommon to mix defines and structs together.
>>> Please don't do it, it confuses a lot and doesn't help to
>>> readability/debug.
>>
>> Hi Leon,
>> Firstly, thanks for investing your time in reviewing our driver.
>> As for mixed defines and structures, far from being very uncommon, they are
>> actually ubiquitous throughout the kernel and are used by the foremost
>> developers (Dave Miller, Linus, Jeff Kirsher).
> 
> Net subsystem is very different from other kernel community.
> For example, this article from LWN [1] - "Coding-style exceptionalism"
> talks about it.

> [1] https://lwn.net/Articles/694755/

That article only refers to multi-line comments, not to embedding
#defines inside of structs that the #defines are used with.

My personal taste on things like this is that if you had something like
a variable with a result code, then use a separate enum for the possible
options.  However, in this case, you have a multi-mask item and the
defines are the three masks and their shifts.  I'm OK with that being
mixed in or being separate, but if it's separate, I would want it
immediately before the struct with a comment specifying that this is the
format of the status byte in the struct.  What I wouldn't want is the
#defines moved far away from the struct with a bunch of other defines
where the context of the struct is lost.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply

* Re: [PATCH qedr 04/10] qedr: Add support for PD,PKEY and CQ verbs
From: Leon Romanovsky @ 2016-10-08 15:39 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Elior, Ariel, Kalderon, Michal, Mintz, Yuval, Borundia, Rajesh,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Amrani, Ram
In-Reply-To: <a146f562-1970-e939-1bd5-074af868f7d6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

On Sat, Oct 08, 2016 at 09:35:06AM -0400, Doug Ledford wrote:
> On 10/7/2016 10:24 AM, Leon Romanovsky wrote:
> > On Fri, Oct 07, 2016 at 10:47:18AM +0000, Elior, Ariel wrote:
> >>>> @@ -66,6 +85,12 @@ struct rdma_cqe_common {
> >>>>     struct regpair qp_handle;
> >>>>     __le16 reserved1[7];
> >>>>     u8 flags;
> >>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_MASK  0x1
> >>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_SHIFT 0
> >>>> +#define RDMA_CQE_COMMON_TYPE_MASK        0x3
> >>>> +#define RDMA_CQE_COMMON_TYPE_SHIFT       1
> >>>> +#define RDMA_CQE_COMMON_RESERVED2_MASK   0x1F
> >>>> +#define RDMA_CQE_COMMON_RESERVED2_SHIFT  3
> >>>>     u8 status;
> >>>
> >>> It is VERY uncommon to mix defines and structs together.
> >>> Please don't do it, it confuses a lot and doesn't help to
> >>> readability/debug.
> >>
> >> Hi Leon,
> >> Firstly, thanks for investing your time in reviewing our driver.
> >> As for mixed defines and structures, far from being very uncommon, they are
> >> actually ubiquitous throughout the kernel and are used by the foremost
> >> developers (Dave Miller, Linus, Jeff Kirsher).
> >
> > Net subsystem is very different from other kernel community.
> > For example, this article from LWN [1] - "Coding-style exceptionalism"
> > talks about it.
>
> > [1] https://lwn.net/Articles/694755/
>
> That article only refers to multi-line comments, not to embedding
> #defines inside of structs that the #defines are used with.

That article supports my claim that net subsystem is different from the
rest of the kernel.

>
> My personal taste on things like this is that if you had something like
> a variable with a result code, then use a separate enum for the possible
> options.  However, in this case, you have a multi-mask item and the
> defines are the three masks and their shifts.  I'm OK with that being
> mixed in or being separate, but if it's separate, I would want it
> immediately before the struct with a comment specifying that this is the
> format of the status byte in the struct.  What I wouldn't want is the
> #defines moved far away from the struct with a bunch of other defines
> where the context of the struct is lost.

It looks like you are neutral on the topic, and I'm against mixing these
specific defines with structures. Every change in such define changes
struct as well which can be easily missed out.

Ram,
Please invest an extra effort and help the reviewers to accomplish their
task.

Thanks

>
> --
> Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>     GPG Key ID: 0E572FDD
>




[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] i40iw: Add Quality of Service support
From: Leon Romanovsky @ 2016-10-08 15:41 UTC (permalink / raw)
  To: Henry Orosco
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	e1000-rdma-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20161006212659.GB6664-ZmvEvTIhtuUfyugFOqMDN/ooFf0ArEBIu+b9c/7xato@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]

On Thu, Oct 06, 2016 at 04:26:59PM -0500, Henry Orosco wrote:
> On Thu, Oct 06, 2016 at 07:00:16PM +0300, Leon Romanovsky wrote:
> > On Thu, Oct 06, 2016 at 10:21:28AM -0500, Henry Orosco wrote:
> > > Add support for QoS on QPs. Upon device initialization,
> > > a map is created from user priority to queue set
> > > handles. On QP creation, use ToS to look up the queue
> > > set handle for use with the QP.
> > >
> > > Signed-off-by: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > > Signed-off-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > > Signed-off-by: Henry Orosco <henry.orosco-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > > ---
> > >  drivers/infiniband/hw/i40iw/i40iw.h       |   9 ++
> > >  drivers/infiniband/hw/i40iw/i40iw_cm.c    |  30 +++++-
> > >  drivers/infiniband/hw/i40iw/i40iw_cm.h    |   2 +-
> > >  drivers/infiniband/hw/i40iw/i40iw_ctrl.c  | 151 +++++++++++++++++++++++++++++-
> > >  drivers/infiniband/hw/i40iw/i40iw_d.h     |   2 +
> > >  drivers/infiniband/hw/i40iw/i40iw_hw.c    |  25 ++---
> > >  drivers/infiniband/hw/i40iw/i40iw_main.c  |  64 +++++++++++--
> > >  drivers/infiniband/hw/i40iw/i40iw_osdep.h |   2 +
> > >  drivers/infiniband/hw/i40iw/i40iw_p.h     |   2 +
> > >  drivers/infiniband/hw/i40iw/i40iw_puda.c  |   3 +-
> > >  drivers/infiniband/hw/i40iw/i40iw_type.h  |  18 +++-
> > >  drivers/infiniband/hw/i40iw/i40iw_utils.c |  45 +++++++++
> > >  drivers/infiniband/hw/i40iw/i40iw_verbs.c |   6 +-
> > >  13 files changed, 323 insertions(+), 36 deletions(-)
> >
> > I believe that it can be split to series.
>
> As all this code is a logical unit for QoS support, we thought
> it best to submit as a single patch.

Large logical unit --> patchset
~400 lines of code --> large unit

>
> Doug, what is your preference?
> >
> > >  mode change 100644 => 100755 drivers/infiniband/hw/i40iw/i40iw_cm.c
> > >  mode change 100644 => 100755 drivers/infiniband/hw/i40iw/i40iw_ctrl.c
> >
> > Why did you change file's mode from 644 to 755?
>
> Nice catch! Will send out another version with this fixed.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* RE: [PATCH qedr 04/10] qedr: Add support for PD,PKEY and CQ verbs
From: Elior, Ariel @ 2016-10-08 23:20 UTC (permalink / raw)
  To: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
  Cc: Mintz, Yuval, Amrani, Ram, Kalderon, Michal, Borundia, Rajesh,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20161008153942.GY9282-2ukJVAZIZ/Y@public.gmane.org>

> > My personal taste on things like this is that if you had something like
> > a variable with a result code, then use a separate enum for the possible
> > options.  However, in this case, you have a multi-mask item and the
> > defines are the three masks and their shifts.  I'm OK with that being
> > mixed in or being separate, but if it's separate, I would want it
> > immediately before the struct with a comment specifying that this is the
> > format of the status byte in the struct.  What I wouldn't want is the
> > #defines moved far away from the struct with a bunch of other defines
> > where the context of the struct is lost.
> 
> It looks like you are neutral on the topic, and I'm against mixing these
> specific defines with structures. Every change in such define changes
> struct as well which can be easily missed out.
> 

Leon, I don't think that is reasonable. I can accept that refactoring all of
our code so that defines end up outside the structures would make it
easier for you personally to review, but I don't agree there is any general
improved readability. Quite the opposite. The whole purpose of storing
the defines adjacent to their fields is so you can easily associate them
together. The reason that this style is used by so many people is *for*
improved debuggability and readability. This style is prevalent throughout
the kernel. Even if you think net is a bad example (while I think it is an
excellent example), you can find examples in every corner of the kernel
so this is not "a net thing".

Here are just a few examples outside of net (there are thousands):
fs/cachefiles/internal.h line 86
block/partitions/acorn.c line 69
crypto/jitterentropy.c line line 78
kernel/sched/sched.h lines 594 and 1250
drivers/block/drbd/drbd_int.h line 996
drivers/gpu/drm/gma500/psb_intel_drv.h line 128

As Doug is comfortable with this style, we are going to leave it as is.
Try thinking of our entrance to linux-rdma as an opportunity to cross-
pollinate and bring over some new techniques and new people into
the subsystem.

Thanks,
Ariel
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-core 1/5] Pull uninitialized_var into util/compiler.h
From: Leon Romanovsky @ 2016-10-09  5:46 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475879772-29458-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 5750 bytes --]

On Fri, Oct 07, 2016 at 04:36:08PM -0600, Jason Gunthorpe wrote:
> The new common definition turns it off for new compilers since
> it is not needed and is too easy to abuse.

Jason,
I have two comments.

1. Can we remove this uninitialized_var at all and simply replace by
default values?
We have 5 places like this:
➜  rdma-core git:(master) grep -r uninitialized_var */src/*.c
libcxgb4/src/cq.c:      struct t4_cqe uninitialized_var(cqe), *rd_cqe;
libcxgb4/src/qp.c:      u8 uninitialized_var(len16);
libmlx4/src/qp.c:       struct mlx4_wqe_ctrl_seg *uninitialized_var(ctrl);
libmlx5/src/qp.c:       uint32_t *uninitialized_var(p);
libmlx5/src/qp.c:                       int uninitialized_var(sz);

2. Do we really want additional folder to ccan with such common headers?
What about rename ccan to be util and put this new file there (in case
you proceed with it)?

Thanks

>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> ---
>  CMakeLists.txt             |  1 +
>  providers/cxgb4/cq.c       |  1 +
>  providers/cxgb4/libcxgb4.h |  2 --
>  providers/cxgb4/qp.c       |  1 +
>  providers/mlx4/mlx4.h      |  4 ----
>  providers/mlx4/qp.c        |  1 +
>  providers/mlx5/mlx5.h      |  4 ----
>  providers/mlx5/qp.c        |  1 +
>  util/CMakeLists.txt        |  3 +++
>  util/compiler.h            | 18 ++++++++++++++++++
>  10 files changed, 26 insertions(+), 10 deletions(-)
>  create mode 100644 util/CMakeLists.txt
>  create mode 100644 util/compiler.h
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index b0864da660fc..1611e90d7933 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -253,6 +253,7 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
>  #-------------------------
>  # Sub-directories
>  add_subdirectory(ccan)
> +add_subdirectory(util)
>  # Libraries
>  add_subdirectory(libibumad)
>  add_subdirectory(libibumad/man)
> diff --git a/providers/cxgb4/cq.c b/providers/cxgb4/cq.c
> index 1ed7dfdb88d4..5f662ac49d0c 100644
> --- a/providers/cxgb4/cq.c
> +++ b/providers/cxgb4/cq.c
> @@ -37,6 +37,7 @@
>  #include <sys/errno.h>
>  #include <netinet/in.h>
>  #include <infiniband/opcode.h>
> +#include <util/compiler.h>
>  #include "libcxgb4.h"
>  #include "cxgb4-abi.h"
>
> diff --git a/providers/cxgb4/libcxgb4.h b/providers/cxgb4/libcxgb4.h
> index 4c8383209287..9a4bc98f34e9 100644
> --- a/providers/cxgb4/libcxgb4.h
> +++ b/providers/cxgb4/libcxgb4.h
> @@ -264,6 +264,4 @@ void dump_state();
>  extern int stall_to;
>  #endif
>
> -#define uninitialized_var(x) x = x
> -
>  #endif				/* IWCH_H */
> diff --git a/providers/cxgb4/qp.c b/providers/cxgb4/qp.c
> index 384bf11369ac..95b459a1a9b4 100644
> --- a/providers/cxgb4/qp.c
> +++ b/providers/cxgb4/qp.c
> @@ -37,6 +37,7 @@
>  #include <string.h>
>  #include <stdio.h>
>  #include <netinet/in.h>
> +#include <util/compiler.h>
>  #include "libcxgb4.h"
>
>  #ifdef STATS
> diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h
> index 95a6521c457b..a2d39e169c15 100644
> --- a/providers/mlx4/mlx4.h
> +++ b/providers/mlx4/mlx4.h
> @@ -43,10 +43,6 @@
>
>  #define MLX4_PORTS_NUM 2
>
> -#ifndef uninitialized_var
> -#define uninitialized_var(x) x = x
> -#endif
> -
>  #include <valgrind/memcheck.h>
>
>  #define PFX		"mlx4: "
> diff --git a/providers/mlx4/qp.c b/providers/mlx4/qp.c
> index 4b5acd71108e..268fb7dc83dd 100644
> --- a/providers/mlx4/qp.c
> +++ b/providers/mlx4/qp.c
> @@ -39,6 +39,7 @@
>  #include <pthread.h>
>  #include <string.h>
>  #include <errno.h>
> +#include <util/compiler.h>
>
>  #include "mlx4.h"
>  #include "doorbell.h"
> diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h
> index f8674c7a90db..cb65429b51f7 100644
> --- a/providers/mlx5/mlx5.h
> +++ b/providers/mlx5/mlx5.h
> @@ -48,10 +48,6 @@
>  #define unlikely(x)	__builtin_expect((x), 0)
>  #endif
>
> -#ifndef uninitialized_var
> -#define uninitialized_var(x) x = x
> -#endif
> -
>  #include <valgrind/memcheck.h>
>
>  #ifdef HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
> diff --git a/providers/mlx5/qp.c b/providers/mlx5/qp.c
> index 04abe1588d6e..e82b1a0bebc3 100644
> --- a/providers/mlx5/qp.c
> +++ b/providers/mlx5/qp.c
> @@ -38,6 +38,7 @@
>  #include <string.h>
>  #include <errno.h>
>  #include <stdio.h>
> +#include <util/compiler.h>
>
>  #include "mlx5.h"
>  #include "doorbell.h"
> diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
> new file mode 100644
> index 000000000000..1cda8905d8f4
> --- /dev/null
> +++ b/util/CMakeLists.txt
> @@ -0,0 +1,3 @@
> +publish_internal_headers(util
> +  compiler.h
> +  )
> diff --git a/util/compiler.h b/util/compiler.h
> new file mode 100644
> index 000000000000..9b57e048df4b
> --- /dev/null
> +++ b/util/compiler.h
> @@ -0,0 +1,18 @@
> +/* GPLv2 or OpenIB.org BSD (MIT) See COPYING file */
> +#ifndef UTIL_COMPILER_H
> +#define UTIL_COMPILER_H
> +
> +/* Use to tag a variable that causes compiler warnings. Use as:
> +    int uninitialized_var(sz)
> +
> +   This is only enabled for old compilers. gcc 6.x and beyond have excellent
> +   static flow analysis. If code solicits a warning from 6.x it is almost
> +   certainly too complex for a human to understand.
> +*/
> +#if __GNUC__ >= 6 || defined(__clang__)
> +#define uninitialized_var(x) x
> +#else
> +#define uninitialized_var(x) x = x
> +#endif
> +
> +#endif
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH qedr 05/10] qedr: Add support for QP verbs
From: Leon Romanovsky @ 2016-10-09  6:27 UTC (permalink / raw)
  To: Ram Amrani
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA,
	Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA,
	Yuval.Mintz-YGCgFSpz5w/QT0dZR+AlfA,
	rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1475682483-9878-6-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On Wed, Oct 05, 2016 at 06:47:58PM +0300, Ram Amrani wrote:
> Add support for Queue Pair verbs which adds, deletes,
> modifies and queries Queue Pairs.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> ---
> +	qp->wqe_wr_id = kcalloc(qp->sq.max_wr, sizeof(*qp->wqe_wr_id),
> +				GFP_KERNEL);
> +	if (!qp->wqe_wr_id) {
> +		DP_ERR(dev, "create qp: failed SQ shadow memory allocation\n");
> +		return -ENOMEM;
> +	}

Please remove prints for ENOMEM failures for all code. k*alloc
interfaces will print it for you.

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result
From: Yishai Hadas @ 2016-10-09 13:31 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma,
	Hal Rosenstock, Mike Marciniszyn, Moni Shoua, Sean Hefty,
	Steve Wise, Tatyana Nikolova, Vladimir Sokolovsky, Yishai Hadas
In-Reply-To: <1473109698-31408-27-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On 9/6/2016 12:08 AM, Jason Gunthorpe wrote:
> It used to be you could suppress this with (void), however the gcc
> developers have decided to get rid of that.
>
> So, look closely at each occurrence and decide what to do:
> - *pingpong: Join the error handling with the if statement directly
>    above
> - niegh: read on a timer_fd should never fail, so just use assert.
>    The assert is compiled out for Release builds so this is no-change
> - acm: Failure of ucma_set_server_port is detected by a 0 return
>    so check fscanf and return appropriately. This is no change since
>    fscanf failure was assumed to have left server_port as 0 (though
>    I doubt the standard supports that usage)
> - rsocket: This looks super sketchy. At least lets make the intent clear
>    with a read_all/write_all wrapper that calls assert. Most likely
>    this code is wrong..
>    Mangle the code with failable_fscanf to make it clear, but as with
>    acm, I don't think the standard supports this usage.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>


This patch breaks rc/uc/ud/srq pingpong in a basic run, please see below.

Can you please prepare some fix for that as it was already merged ?

> ---
>  libibverbs/examples/rc_pingpong.c  | 15 +++++-----
>  libibverbs/examples/srq_pingpong.c | 13 +++++++--
>  libibverbs/examples/uc_pingpong.c  | 15 +++++-----
>  libibverbs/examples/ud_pingpong.c  | 17 +++++-------
>  libibverbs/src/neigh.c             |  7 +++--
>  librdmacm/src/acm.c                |  3 +-
>  librdmacm/src/rsocket.c            | 56 +++++++++++++++++++++++++++-----------
>  7 files changed, 78 insertions(+), 48 deletions(-)
>
> diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
> index 1fad16a0be7c..7bcc413a0f1d 100644
> --- a/libibverbs/examples/rc_pingpong.c
> +++ b/libibverbs/examples/rc_pingpong.c
> @@ -208,14 +208,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
>  		goto out;
>  	}
>
> -	if (read(sockfd, msg, sizeof msg) != sizeof msg) {
> -		perror("client read");
> -		fprintf(stderr, "Couldn't read remote address\n");
> +	if (read(sockfd, msg, sizeof msg) != sizeof msg ||
> +	    write(sockfd, "done", sizeof "done") != sizeof "done") {
> +		perror("client read/write");
> +		fprintf(stderr, "Couldn't read/write remote address\n");
>  		goto out;
>  	}
>
> -	write(sockfd, "done", sizeof "done");
> -
>  	rem_dest = malloc(sizeof *rem_dest);
>  	if (!rem_dest)
>  		goto out;
> @@ -316,14 +315,14 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
>  	gid_to_wire_gid(&my_dest->gid, gid);
>  	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
>  							my_dest->psn, gid);
> -	if (write(connfd, msg, sizeof msg) != sizeof msg) {
> -		fprintf(stderr, "Couldn't send local address\n");
> +	if (write(connfd, msg, sizeof msg) != sizeof msg ||
> +	    read(connfd, msg, sizeof msg) != sizeof msg) {
> +		fprintf(stderr, "Couldn't send/recv local address\n");

At that step the server expects to read a "done" response from its 
client, checking whether the read was done for sizeof msg which is much 
larger will fail.

Same issue appears below in several places in srq/ud/uc pingpong.

>  		free(rem_dest);
>  		rem_dest = NULL;
>  		goto out;
>  	}
>
> -	read(connfd, msg, sizeof msg);
>
>  out:
>  	close(connfd);
> diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
> index 929b736545c7..e6492dc553fd 100644
> --- a/libibverbs/examples/srq_pingpong.c
> +++ b/libibverbs/examples/srq_pingpong.c
> @@ -222,8 +222,10 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
>  		wire_gid_to_gid(gid, &rem_dest[i].gid);
>  	}
>
> -	write(sockfd, "done", sizeof "done");
> -
> +	if (write(sockfd, "done", sizeof "done") != sizeof "done") {
> +		perror("client write");
> +		goto out;
> +	}
>  out:
>  	close(sockfd);
>  	return rem_dest;
> @@ -333,7 +335,12 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
>  		}
>  	}
>
> -	read(connfd, msg, sizeof msg);
> +	if (read(connfd, msg, sizeof msg) != sizeof msg) {
> +		perror("client write");
> +		free(rem_dest);
> +		rem_dest = NULL;
> +		goto out;
> +	}
>
>  out:
>  	close(connfd);
> diff --git a/libibverbs/examples/uc_pingpong.c b/libibverbs/examples/uc_pingpong.c
> index 3802e3821773..d132de98694a 100644
> --- a/libibverbs/examples/uc_pingpong.c
> +++ b/libibverbs/examples/uc_pingpong.c
> @@ -176,13 +176,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
>  		goto out;
>  	}
>
> -	if (read(sockfd, msg, sizeof msg) != sizeof msg) {
> -		perror("client read");
> -		fprintf(stderr, "Couldn't read remote address\n");
> +	if (read(sockfd, msg, sizeof msg) != sizeof msg ||
> +	    write(sockfd, "done", sizeof "done") != sizeof "done") {
> +		perror("client read/write");
> +		fprintf(stderr, "Couldn't read/write remote address\n");
>  		goto out;
>  	}
>
> -	write(sockfd, "done", sizeof "done");
>
>  	rem_dest = malloc(sizeof *rem_dest);
>  	if (!rem_dest)
> @@ -284,15 +284,14 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
>  	gid_to_wire_gid(&my_dest->gid, gid);
>  	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
>  							my_dest->psn, gid);
> -	if (write(connfd, msg, sizeof msg) != sizeof msg) {
> -		fprintf(stderr, "Couldn't send local address\n");
> +	if (write(connfd, msg, sizeof msg) != sizeof msg ||
> +	    read(connfd, msg, sizeof msg) != sizeof msg) {
> +		fprintf(stderr, "Couldn't send/recv local address\n");
>  		free(rem_dest);
>  		rem_dest = NULL;
>  		goto out;
>  	}
>
> -	read(connfd, msg, sizeof msg);
> -
>  out:
>  	close(connfd);
>  	return rem_dest;
> diff --git a/libibverbs/examples/ud_pingpong.c b/libibverbs/examples/ud_pingpong.c
> index fa99b9e51dfb..67da4bd90f32 100644
> --- a/libibverbs/examples/ud_pingpong.c
> +++ b/libibverbs/examples/ud_pingpong.c
> @@ -176,14 +176,13 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
>  		goto out;
>  	}
>
> -	if (read(sockfd, msg, sizeof msg) != sizeof msg) {
> -		perror("client read");
> -		fprintf(stderr, "Couldn't read remote address\n");
> +	if (read(sockfd, msg, sizeof msg) != sizeof msg ||
> +	    write(sockfd, "done", sizeof "done") != sizeof "done") {
> +		perror("client read/write");
> +		fprintf(stderr, "Couldn't read/write remote address\n");
>  		goto out;
>  	}
>
> -	write(sockfd, "done", sizeof "done");
> -
>  	rem_dest = malloc(sizeof *rem_dest);
>  	if (!rem_dest)
>  		goto out;
> @@ -282,15 +281,13 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
>  	gid_to_wire_gid(&my_dest->gid, gid);
>  	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
>  							my_dest->psn, gid);
> -	if (write(connfd, msg, sizeof msg) != sizeof msg) {
> -		fprintf(stderr, "Couldn't send local address\n");
> +	if (write(connfd, msg, sizeof msg) != sizeof msg ||
> +	    read(connfd, msg, sizeof msg) != sizeof msg) {
> +		fprintf(stderr, "Couldn't send/recv local address\n");
>  		free(rem_dest);
>  		rem_dest = NULL;
>  		goto out;
>  	}
> -
> -	read(connfd, msg, sizeof msg);
> -
>  out:
>  	close(connfd);
>  	return rem_dest;
> diff --git a/libibverbs/src/neigh.c b/libibverbs/src/neigh.c
> index 6b6e58cd52f8..5acfcf06fcde 100644
> --- a/libibverbs/src/neigh.c
> +++ b/libibverbs/src/neigh.c
> @@ -19,6 +19,7 @@
>  #include <unistd.h>
>  #include <ifaddrs.h>
>  #include <netdb.h>
> +#include <assert.h>
>  #ifndef _LINUX_IF_H
>  #include <net/if.h>
>  #else
> @@ -372,9 +373,11 @@ static struct nl_addr *process_get_neigh_mac(
>
>  			if (FD_ISSET(timer_fd, &fdset)) {
>  				uint64_t read_val;
> +				ssize_t rc;
>
> -				(void)read(timer_fd, &read_val,
> -					   sizeof(read_val));
> +				rc =
> +				    read(timer_fd, &read_val, sizeof(read_val));
> +				assert(rc == sizeof(read_val));
>  				if (++retries >=  NUM_OF_TRIES) {
>  					if (!errno)
>  						errno = EDESTADDRREQ;
> diff --git a/librdmacm/src/acm.c b/librdmacm/src/acm.c
> index f0da01e6d286..c097bb923b55 100644
> --- a/librdmacm/src/acm.c
> +++ b/librdmacm/src/acm.c
> @@ -121,7 +121,8 @@ static int ucma_set_server_port(void)
>  	FILE *f;
>
>  	if ((f = fopen("/var/run/ibacm.port", "r" STREAM_CLOEXEC))) {
> -		fscanf(f, "%" SCNu16, &server_port);
> +		if (fscanf(f, "%" SCNu16, &server_port) != 1)
> +			server_port = 0;
>  		fclose(f);
>  	}
>  	return server_port;
> diff --git a/librdmacm/src/rsocket.c b/librdmacm/src/rsocket.c
> index 818505fbe02e..5645f40d2460 100644
> --- a/librdmacm/src/rsocket.c
> +++ b/librdmacm/src/rsocket.c
> @@ -404,6 +404,20 @@ struct ds_udp_header {
>
>  #define ds_next_qp(qp) container_of((qp)->list.next, struct ds_qp, list)
>
> +static void write_all(int fd, const void *msg, size_t len)
> +{
> +	// FIXME: if fd is a socket this really needs to handle EINTR and other conditions.
> +	ssize_t rc = write(fd, msg, len);
> +	assert(rc == len);
> +}
> +
> +static void read_all(int fd, void *msg, size_t len)
> +{
> +	// FIXME: if fd is a socket this really needs to handle EINTR and other conditions.
> +	ssize_t rc = read(fd, msg, len);
> +	assert(rc == len);
> +}
> +
>  static void ds_insert_qp(struct rsocket *rs, struct ds_qp *qp)
>  {
>  	if (!rs->qp_list)
> @@ -444,8 +458,8 @@ static int rs_notify_svc(struct rs_svc *svc, struct rsocket *rs, int cmd)
>  	msg.cmd = cmd;
>  	msg.status = EINVAL;
>  	msg.rs = rs;
> -	write(svc->sock[0], &msg, sizeof msg);
> -	read(svc->sock[0], &msg, sizeof msg);
> +	write_all(svc->sock[0], &msg, sizeof msg);
> +	read_all(svc->sock[0], &msg, sizeof msg);
>  	ret = rdma_seterrno(msg.status);
>  	if (svc->cnt)
>  		goto unlock;
> @@ -484,6 +498,15 @@ static int rs_scale_to_value(int value, int bits)
>  	       value : (value & ~(1 << (bits - 1))) << bits;
>  }
>
> +/* gcc > ~5 will not allow (void)fscanf to suppress -Wunused-result, but this
> +   will do it.  In this case ignoring the result is OK (but horribly
> +   unfriendly to user) since the library has a sane default. */
> +#define failable_fscanf(f, fmt, ...)                                           \
> +	{                                                                      \
> +		int rc = fscanf(f, fmt, __VA_ARGS__);                          \
> +		(void) rc;                                                     \
> +	}
> +
>  void rs_configure(void)
>  {
>  	FILE *f;
> @@ -501,27 +524,27 @@ void rs_configure(void)
>  	ucma_ib_init();
>
>  	if ((f = fopen(RS_CONF_DIR "/polling_time", "r"))) {
> -		(void) fscanf(f, "%u", &polling_time);
> +		failable_fscanf(f, "%u", &polling_time);
>  		fclose(f);
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/inline_default", "r"))) {
> -		(void) fscanf(f, "%hu", &def_inline);
> +		failable_fscanf(f, "%hu", &def_inline);
>  		fclose(f);
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/sqsize_default", "r"))) {
> -		(void) fscanf(f, "%hu", &def_sqsize);
> +		failable_fscanf(f, "%hu", &def_sqsize);
>  		fclose(f);
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/rqsize_default", "r"))) {
> -		(void) fscanf(f, "%hu", &def_rqsize);
> +		failable_fscanf(f, "%hu", &def_rqsize);
>  		fclose(f);
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/mem_default", "r"))) {
> -		(void) fscanf(f, "%u", &def_mem);
> +		failable_fscanf(f, "%u", &def_mem);
>  		fclose(f);
>
>  		if (def_mem < 1)
> @@ -529,14 +552,14 @@ void rs_configure(void)
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/wmem_default", "r"))) {
> -		(void) fscanf(f, "%u", &def_wmem);
> +		failable_fscanf(f, "%u", &def_wmem);
>  		fclose(f);
>  		if (def_wmem < RS_SNDLOWAT)
>  			def_wmem = RS_SNDLOWAT << 1;
>  	}
>
>  	if ((f = fopen(RS_CONF_DIR "/iomap_size", "r"))) {
> -		(void) fscanf(f, "%hu", &def_iomap_size);
> +		failable_fscanf(f, "%hu", &def_iomap_size);
>  		fclose(f);
>
>  		/* round to supported values */
> @@ -3345,7 +3368,8 @@ static int rs_set_keepalive(struct rsocket *rs, int on)
>  	if (on) {
>  		if (!rs->keepalive_time) {
>  			if ((f = fopen("/proc/sys/net/ipv4/tcp_keepalive_time", "r"))) {
> -				(void) fscanf(f, "%u", &rs->keepalive_time);
> +				if (fscanf(f, "%u", &rs->keepalive_time) != 1)
> +					rs->keepalive_time = 7200;
>  				fclose(f);
>  			} else {
>  				rs->keepalive_time = 7200;
> @@ -3985,7 +4009,7 @@ static void udp_svc_process_sock(struct rs_svc *svc)
>  {
>  	struct rs_svc_msg msg;
>
> -	read(svc->sock[1], &msg, sizeof msg);
> +	read_all(svc->sock[1], &msg, sizeof msg);
>  	switch (msg.cmd) {
>  	case RS_SVC_ADD_DGRAM:
>  		msg.status = rs_svc_add_rs(svc, msg.rs);
> @@ -4009,7 +4033,7 @@ static void udp_svc_process_sock(struct rs_svc *svc)
>  		break;
>  	}
>
> -	write(svc->sock[1], &msg, sizeof msg);
> +	write_all(svc->sock[1], &msg, sizeof msg);
>  }
>
>  static uint8_t udp_svc_sgid_index(struct ds_dest *dest, union ibv_gid *sgid)
> @@ -4184,7 +4208,7 @@ static void *udp_svc_run(void *arg)
>  	ret = rs_svc_grow_sets(svc, 4);
>  	if (ret) {
>  		msg.status = ret;
> -		write(svc->sock[1], &msg, sizeof msg);
> +		write_all(svc->sock[1], &msg, sizeof msg);
>  		return (void *) (uintptr_t) ret;
>  	}
>
> @@ -4222,7 +4246,7 @@ static void tcp_svc_process_sock(struct rs_svc *svc)
>  	struct rs_svc_msg msg;
>  	int i;
>
> -	read(svc->sock[1], &msg, sizeof msg);
> +	read_all(svc->sock[1], &msg, sizeof msg);
>  	switch (msg.cmd) {
>  	case RS_SVC_ADD_KEEPALIVE:
>  		msg.status = rs_svc_add_rs(svc, msg.rs);
> @@ -4253,7 +4277,7 @@ static void tcp_svc_process_sock(struct rs_svc *svc)
>  	default:
>  		break;
>  	}
> -	write(svc->sock[1], &msg, sizeof msg);
> +	write_all(svc->sock[1], &msg, sizeof msg);
>  }
>
>  /*
> @@ -4282,7 +4306,7 @@ static void *tcp_svc_run(void *arg)
>  	ret = rs_svc_grow_sets(svc, 16);
>  	if (ret) {
>  		msg.status = ret;
> -		write(svc->sock[1], &msg, sizeof msg);
> +		write_all(svc->sock[1], &msg, sizeof msg);
>  		return (void *) (uintptr_t) ret;
>  	}
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result
From: Bart Van Assche @ 2016-10-09 15:14 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Devesh Sharma, Hal Rosenstock, Mike Marciniszyn, Moni Shoua,
	Sean Hefty, Steve Wise, Tatyana Nikolova, Vladimir Sokolovsky,
	Yishai Hadas
In-Reply-To: <1473109698-31408-27-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On 09/05/16 14:08, Jason Gunthorpe wrote:
> It used to be you could suppress this with (void), however the gcc
> developers have decided to get rid of that.
>
> So, look closely at each occurrence and decide what to do:
> [ ... ]

Hi Jason,

Are you aware that there are less intrusive ways to suppress "unused 
result" warnings, e.g. by using a macro like the one below?

#define UNUSED_VALUE(v) do { if (v) { } } while (0)

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-core 1/5] Pull uninitialized_var into util/compiler.h
From: Jason Gunthorpe @ 2016-10-09 23:01 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161009054601.GB9282-2ukJVAZIZ/Y@public.gmane.org>

On Sun, Oct 09, 2016 at 08:46:01AM +0300, Leon Romanovsky wrote:

> 1. Can we remove this uninitialized_var at all and simply replace by
> default values?

I think people would complain about the extra stores. gcc 6 will
eliminate them, but older compilers will not.

But yes, we could do this.

> 2. Do we really want additional folder to ccan with such common headers?
> What about rename ccan to be util and put this new file there (in case
> you proceed with it)?

I see the ccan directory as stuf from ccan that we are not going to
change, while util is for new stuff specific to this tree.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result
From: Jason Gunthorpe @ 2016-10-09 23:12 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma,
	Hal Rosenstock, Mike Marciniszyn, Moni Shoua, Sean Hefty,
	Steve Wise, Tatyana Nikolova, Vladimir Sokolovsky, Yishai Hadas
In-Reply-To: <3884fb5e-13a2-3ab6-0cce-66f73fbe84b7-HInyCGIudOg@public.gmane.org>

On Sun, Oct 09, 2016 at 08:14:26AM -0700, Bart Van Assche wrote:

> Are you aware that there are less intrusive ways to suppress "unused result"
> warnings, e.g. by using a macro like the one below?
> 
> #define UNUSED_VALUE(v) do { if (v) { } } while (0)

Hmm, I think the only place I'd use that is the fscanf stuff - and
that is only because I don't know about about that code to put in
sensible error handling. It doesn't seem much better than the
failable_fscanf wrapper?

All the other places gained at least some kind of improvement in error
handling..

Generally this warning is not wrong so I'm not excited to have
'official' infrastructure to ignore it.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 26/28] Avoid gcc 5.4 warning -Wunused-result
From: Jason Gunthorpe @ 2016-10-09 23:19 UTC (permalink / raw)
  To: Yishai Hadas
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Devesh Sharma,
	Hal Rosenstock, Mike Marciniszyn, Moni Shoua, Sean Hefty,
	Steve Wise, Tatyana Nikolova, Vladimir Sokolovsky, Yishai Hadas
In-Reply-To: <9ae84345-4427-4689-e6d1-0bfa3eb19630-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Sun, Oct 09, 2016 at 04:31:17PM +0300, Yishai Hadas wrote:

> >-	if (write(connfd, msg, sizeof msg) != sizeof msg) {
> >-		fprintf(stderr, "Couldn't send local address\n");
> >+	if (write(connfd, msg, sizeof msg) != sizeof msg ||
> >+	    read(connfd, msg, sizeof msg) != sizeof msg) {
> >+		fprintf(stderr, "Couldn't send/recv local address\n");
> 
> At that step the server expects to read a "done" response from its client,
> checking whether the read was done for sizeof msg which is much larger will
> fail.

This OK?

>From db525af53140c3b7604ab45406ed8845cb6171e1 Mon Sep 17 00:00:00 2001
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Date: Sun, 9 Oct 2016 17:17:54 -0600
Subject: [PATCH] verbs: Fix read error check in pingpong

Turns out these reads rely on the short readed caused by EOS.

Fixes: f3912df771db (Avoid gcc 5.4 warning -Wunused-result)
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 libibverbs/examples/rc_pingpong.c  | 2 +-
 libibverbs/examples/srq_pingpong.c | 2 +-
 libibverbs/examples/uc_pingpong.c  | 2 +-
 libibverbs/examples/ud_pingpong.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
index c92e551c00e6..aca7bac4491b 100644
--- a/libibverbs/examples/rc_pingpong.c
+++ b/libibverbs/examples/rc_pingpong.c
@@ -309,7 +309,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
 							my_dest->psn, gid);
 	if (write(connfd, msg, sizeof msg) != sizeof msg ||
-	    read(connfd, msg, sizeof msg) != sizeof msg) {
+	    read(connfd, msg, sizeof msg) != sizeof "done") {
 		fprintf(stderr, "Couldn't send/recv local address\n");
 		free(rem_dest);
 		rem_dest = NULL;
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index 863ff10dd0f4..8f55d78e87d4 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -333,7 +333,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 		}
 	}
 
-	if (read(connfd, msg, sizeof msg) != sizeof msg) {
+	if (read(connfd, msg, sizeof msg) != sizeof "done") {
 		perror("client write");
 		free(rem_dest);
 		rem_dest = NULL;
diff --git a/libibverbs/examples/uc_pingpong.c b/libibverbs/examples/uc_pingpong.c
index 2b105b947cf3..b565bacaff2a 100644
--- a/libibverbs/examples/uc_pingpong.c
+++ b/libibverbs/examples/uc_pingpong.c
@@ -283,7 +283,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
 							my_dest->psn, gid);
 	if (write(connfd, msg, sizeof msg) != sizeof msg ||
-	    read(connfd, msg, sizeof msg) != sizeof msg) {
+	    read(connfd, msg, sizeof msg) != sizeof "done") {
 		fprintf(stderr, "Couldn't send/recv local address\n");
 		free(rem_dest);
 		rem_dest = NULL;
diff --git a/libibverbs/examples/ud_pingpong.c b/libibverbs/examples/ud_pingpong.c
index d0cd73cc0fae..ddb68cf8624b 100644
--- a/libibverbs/examples/ud_pingpong.c
+++ b/libibverbs/examples/ud_pingpong.c
@@ -280,7 +280,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 	sprintf(msg, "%04x:%06x:%06x:%s", my_dest->lid, my_dest->qpn,
 							my_dest->psn, gid);
 	if (write(connfd, msg, sizeof msg) != sizeof msg ||
-	    read(connfd, msg, sizeof msg) != sizeof msg) {
+	    read(connfd, msg, sizeof msg) != sizeof "done") {
 		fprintf(stderr, "Couldn't send/recv local address\n");
 		free(rem_dest);
 		rem_dest = NULL;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox