1. 11 Jul, 2018 5 commits
    • oulijun's avatar
      RDMA/hns: Fix endian conversions and annotations · 0576cbde
      oulijun authored
      This patch removes the warnings reported by sparse.
      Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      0576cbde
    • Bart Van Assche's avatar
      RDMA/ocrdma: Make ocrdma_destroy_qp() easier to analyze · beae9eb5
      Bart Van Assche authored
      This patch does not change any functionality but avoids that sparse
      reports the following:
      
      drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:1818:31: warning: context imbalance in 'ocrdma_destroy_qp' - different lock contexts for basic block
      
      Compile-tested only.
      Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
      Cc: Selvin Xavier <selvin.xavier@broadcom.com>
      Cc: Devesh Sharma <devesh.sharma@broadcom.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      beae9eb5
    • Arnd Bergmann's avatar
      infiniband: i40iw, nes: don't use wall time for TCP sequence numbers · 07f3355d
      Arnd Bergmann authored
      The nes infiniband driver uses current_kernel_time() to get a nanosecond
      granunarity timestamp to initialize its tcp sequence counters. This is
      one of only a few remaining users of that deprecated function, so we
      should try to get rid of it.
      
      Aside from using a deprecated API, there are several problems I see here:
      
      - Using a CLOCK_REALTIME based time source makes it predictable in
        case the time base is synchronized.
      - Using a coarse timestamp means it only gets updated once per jiffie,
        making it even more predictable in order to avoid having to access
        the hardware clock source
      - The upper 2 bits are always zero because the nanoseconds are at most
        999999999.
      
      For the Linux TCP implementation, we use secure_tcp_seq(), which appears
      to be appropriate here as well, and solves all the above problems.
      
      i40iw uses a variant of the same code, so I do that same thing there
      for ipv4. Unlike nes, i40e also supports ipv6, which needs to call
      secure_tcpv6_seq instead.
      Acked-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      07f3355d
    • Bart Van Assche's avatar
      RDMA/nes: Avoid complaints about unused variables · 59b851db
      Bart Van Assche authored
      Avoid that the compiler reports the following when building with W=1:
      
      drivers/infiniband/hw/nes/nes_utils.c: In function 'nes_arp_table':
      drivers/infiniband/hw/nes/nes_utils.c:689:9: warning: variable 'tmp_addr' set but not used [-Wunused-but-set-variable]
        __be32 tmp_addr;
               ^~~~~~~~
      drivers/infiniband/hw/nes/nes_hw.c: In function 'flush_wqes':
      drivers/infiniband/hw/nes/nes_hw.c:3840:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
        int ret;
            ^~~
      drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_setup_virt_qp':
      drivers/infiniband/hw/nes/nes_verbs.c:811:6: warning: variable 'pbl_entries' set but not used [-Wunused-but-set-variable]
        u32 pbl_entries;
            ^~~~~~~~~~~
      drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_dereg_mr':
      drivers/infiniband/hw/nes/nes_verbs.c:2487:6: warning: variable 'minor_code' set but not used [-Wunused-but-set-variable]
        u16 minor_code;
            ^~~~~~~~~~
      drivers/infiniband/hw/nes/nes_cm.c: In function 'mini_cm_recv_pkt':
      drivers/infiniband/hw/nes/nes_cm.c:2570:20: warning: variable 'tmp_saddr' set but not used [-Wunused-but-set-variable]
        __be32 tmp_daddr, tmp_saddr;
                          ^~~~~~~~~
      drivers/infiniband/hw/nes/nes_cm.c:2570:9: warning: variable 'tmp_daddr' set but not used [-Wunused-but-set-variable]
        __be32 tmp_daddr, tmp_saddr;
               ^~~~~~~~~
      drivers/infiniband/hw/nes/nes_cm.c: In function 'cm_event_connected':
      drivers/infiniband/hw/nes/nes_cm.c:3578:22: warning: variable 'raddr' set but not used [-Wunused-but-set-variable]
        struct sockaddr_in *raddr;
                            ^~~~~
      drivers/infiniband/hw/nes/nes_cm.c: In function 'cm_event_reset':
      drivers/infiniband/hw/nes/nes_cm.c:3753:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
        int ret;
            ^~~
      Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
      Cc: Faisal Latif <faisal.latif@intel.com>
      Cc: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      59b851db
    • Jason Gunthorpe's avatar
      RDMA/cxgb4: Restore the dropped uninitialized_var · 23ff6ba8
      Jason Gunthorpe authored
      In some configurations even gcc 7 cannot unravel this complexity and still
      throws a warning.
      
      Fixes: 4ab39e2f ("RDMA/cxgb4: Make c4iw_poll_cq_one() easier to analyze")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      23ff6ba8
  2. 10 Jul, 2018 6 commits
  3. 09 Jul, 2018 26 commits
  4. 04 Jul, 2018 3 commits
    • Jason Gunthorpe's avatar
      RDMA/uverbs: Combine MIN_SZ_OR_ZERO with UVERBS_ATTR_STRUCT · 422e3d37
      Jason Gunthorpe authored
      After all the rework is done it is now possible to include single flags in
      the type macros. Any user of UVERBS_ATTR_STRUCT needs to zero check data
      past the end of the known struct to be correct, so make this mandatory,
      and get rid of MIN_SZ_OR_ZERO as a user flag.
      
      This changes UVERBS_ATTR_TYPE to refer to a struct of exact size with not
      possibility of extension, convert the few users of UVERBS_ATTR_TYPE and
      MIN_SZ_OR_ZERO to use UVERBS_ATTR_STRUCT.
      
      The one user of UVERBS_ATTR_STRUCT without MIN_SZ_OR_ZERO is just
      confused. There is some padding at the end of that struct, but userspace
      always provides it with the padding. The construction doesn't test if the
      padding is zero, so it is pointless. Just use UVERBS_ATTR_TYPE.
      
      Finally, rename min_sz_or_zero to zero_trailing to better reflect what it
      does and hopefully avoid such mis-uses in the future.
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      422e3d37
    • Jason Gunthorpe's avatar
      RDMA/uverbs: Use UVERBS_ATTR_MIN_SIZE correctly and uniformly · 540cd692
      Jason Gunthorpe authored
      This newer macro allows specifying a lower bound on the accepted size, and
      has an 'unlimited' upper bound. Due to this it never checks for trailing
      zeroing so it doesn't make any sense to combine it with MIN_SZ_OR_ZERO, so
      drop MIN_SZ_OR_ZERO when they are used together
      
      There were a couple of places that open coded this pattern, switch them to
      use the clearer UVERBS_ATTR_MIN_SIZE for clarity.
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      540cd692
    • Jason Gunthorpe's avatar
      RDMA/uverbs: Remove UA_FLAGS · 83bb4442
      Jason Gunthorpe authored
      This bit of boilerplate isn't really necessary, we can use bitfields
      instead of a flags enum and the macros can then individually initialize
      them through the __VA_ARGS__ like everything else.
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      83bb4442