diff options
author | David S. Miller <davem@davemloft.net> | 2015-05-30 18:25:03 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-30 18:25:03 -0700 |
commit | 1dcf3ac49fb0079ed7d3d3f4a4cf25e9fb9fffc6 (patch) | |
tree | 64a8da331114ff1b10ddd2deeacb7e2f7aa98af0 /drivers/infiniband/hw/mlx5/cq.c | |
parent | 8ed9b5e1c8f3cfc0d8c94f1a19d1167422eea7a8 (diff) | |
parent | f62b8bb8f2d30582f30f51e85a8c0e1260125d7e (diff) | |
download | linux-1dcf3ac49fb0079ed7d3d3f4a4cf25e9fb9fffc6.tar.bz2 |
Merge branch 'mlx5-next'
Amir Vadai says:
====================
net/mlx5: ConnectX-4 100G Ethernet driver
This patchset extends the mlx5_core driver to support Ethernet
functionality. The Ethernet functionality in the mlx5 driver is
integrated into the core driver and not as separated driver. The
IB functionality remains in the mlx5_ib driver as before.
This functionality will enable the Ethernet capability of Mellanox's new
famility of cards - ConnectX-4. Due to the fact that backword
compatability is being kept, existing Connect-IB cards that are using
this driver are fully working with the modified driver, and no issues
with current deployments should be seen.
Like the ConnectX-3 cards, ConnectX-4 is a VPI (Virtual Port Interface -
every port can be configured as Infiniband or Ethernet) card.
Unlike previous generations, the ConnectX-4 has a separate PCI function
per port.
The current code has a limitation that Infiniband and Ethernet port types
are mutually exclusive. When the driver is compiled with Ethernet
support, the Infiniband functionality is disabled and vice versa. To
control that we added the CONFIG_MLX5_CORE_EN config directive
which is 'n' by default, but can be changed by the user.
This limitation is short-lived and would be addressed soon.
As part of this patchset, mlx5_ifc.h was heavily modified [1]. This file
is now generated automatically from the device specification document.
Since this patch is too big for the mail server, it might be missing in
the mailing list, but could be pulled from an external git repository [2].
irq name selection is done at driver initialization and doesn't contain the
interface name as part of the irq name.
irq_balancer will still work thanks to an improvement introduced by Neil Horman
[3] to use sysfs instead of /proc/interrupts.
Patchset was applied on top of commit ed2dfd9 ("tcp/dccp: warn user for
preferred ip_local_port_range")
[1] - Patch 4/11 ("net/mlx5_core: HW data structs/types definitions preparation for mlx5 ehternet driver")
[2] - http://git.openfabrics.org/?p=~amirv/linux.git;a=shortlog;h=refs/heads/mlx5e_v1
[3] - kernel: da8d1c8 PCI/sysfs: add per pci device msi[x] irq listing (v5)
irq_balancer: 32a7757 Complete rework of how we detect and classify irqs
Thanks to Achiad, Saeed, Yevheny, Or and the whole team for making this happen,
Amir
Changes from V4:
- Removed Patch 3/12: net/mlx5_core: Add EQ renaming mechanism
- Patch 12/12: net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality
- irq name is created on driver initialization, therefore it won't contain
the network interface name in it. This won't effect irq_balancer thanks to
patches introduced by Neil Horman to use sysfs instead of /proc/interrupts.
Changes from V3:
- PATCH 8/11: net/mlx5_core: Set/Query port MTU commands
- Return value directly - no need for err.
Changes from V2:
- Improved changelogs and cover-letter
- Added CONFIG_MLX5_EN to disable/enable the Ethernet functionality
- Moved en.h and wq.[ch] into the patch with data-path related code
Changes from V1:
- Added patch 1/12 ("net/mlx5_core,mlx5_ib: Do not use vmap() on coherent
memory")
Changes from V0:
- Removed V0 Patch 1/11 ("net/mlx5_core: Virtually extend work/completion queue
buffers by one page") due to misuse of DMA API. Thanks Dave.
- Patch 1/11 ("net/mlx5_core: Set irq affinity hints"):
- Use kcalloc instead of kzalloc
- Fix build error when CONFIG_CPUMASK_OFFSTACK=n. Driver loading will fail
now if cpumask allocation is failing.
- Using dev_to_node helper. Thanks, Ido.
- Patch 3/11 ("net/mlx5_core: HW data structs/types definitions preparation for
mlx5 ehternet driver")
- Removed Mellanox internal comment at the head of the file. Thanks Joe
- Patch 6/11 ("net/mlx5_core: Implement get/set port status")
- Use direct return of function's result. Thanks Sergei.
- Added Patch 8/11 ("net/mlx5_core: Set/Query port MTU commands")
- Patch 9/11 ("net/mlx5: Ethernet Datapath files")
- Use rq->wqe_sz instead of skb_end_offset. Thanks Ido.
- Use dma_wmb() when possible instead of wmb(). Thanks Alex.
- Fix checkpatch issues
- Patch 10/11 ("net/mlx5: ethernet resources handling")
- checkpatch issues
- Added missing include
- Patch 11/11 ("net/mlx5: Ethernet driver")
- checkpatch issues
- fixed typo
- Modified use of affinity hint
- Using dev_to_node helper. Thanks, Ido.
- Use new hardware commands from Patch 8/11 ("net/mlx5_core: Set/Query port
MTU commands") to get/set port MTU in hardware.
- Removed NETIF_F_SG since hardware ring wraparound is not supported
- Use dma_wmb() when possible instead of wmb(). Thanks Alex.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/cq.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/cq.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 2ee6b1051975..e2bea9ab93b3 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -590,8 +590,7 @@ static int alloc_cq_buf(struct mlx5_ib_dev *dev, struct mlx5_ib_cq_buf *buf, { int err; - err = mlx5_buf_alloc(dev->mdev, nent * cqe_size, - PAGE_SIZE * 2, &buf->buf); + err = mlx5_buf_alloc(dev->mdev, nent * cqe_size, &buf->buf); if (err) return err; @@ -754,7 +753,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, int entries, return ERR_PTR(-EINVAL); entries = roundup_pow_of_two(entries + 1); - if (entries > dev->mdev->caps.gen.max_cqes) + if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz))) return ERR_PTR(-EINVAL); cq = kzalloc(sizeof(*cq), GFP_KERNEL); @@ -921,7 +920,7 @@ int mlx5_ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period) int err; u32 fsel; - if (!(dev->mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_CQ_MODER)) + if (!MLX5_CAP_GEN(dev->mdev, cq_moderation)) return -ENOSYS; in = kzalloc(sizeof(*in), GFP_KERNEL); @@ -1076,7 +1075,7 @@ int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata) int uninitialized_var(cqe_size); unsigned long flags; - if (!(dev->mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_RESIZE_CQ)) { + if (!MLX5_CAP_GEN(dev->mdev, cq_resize)) { pr_info("Firmware does not support resize CQ\n"); return -ENOSYS; } @@ -1085,7 +1084,7 @@ int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata) return -EINVAL; entries = roundup_pow_of_two(entries + 1); - if (entries > dev->mdev->caps.gen.max_cqes + 1) + if (entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz)) + 1) return -EINVAL; if (entries == ibcq->cqe + 1) |