Skip to content

Commit 9369832

Browse files
committed
Merge tag 'mlx5e-updates-2018-12-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed: ==================== mlx5e-updates-2018-12-10 (gre) This patch set adds GRE offloading support to Mellanox ethernet driver. Patches 1-5 replace the existing egdev mechanism with the new TC indirect block binds mechanism that was introduced by Netronome: 7f76fa3 ("net: sched: register callbacks for indirect tc block binds") Patches 6-9 add GRE offloading support along with some required refactoring work. Patch 10, Add netif_is_gretap()/netif_is_ip6gretap() - Changed the is_gretap_dev and is_ip6gretap_dev logic from structure comparison to string comparison of the rtnl_link_ops kind field. Patch 11, add GRE offloading support to mlx5. Patch 12 removes the egdev mechanism from TC as it is no longer used by any of the drivers. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents d8ed257 + 69bd484 commit 9369832

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3563
-2924
lines changed

drivers/infiniband/core/umem_odp.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,13 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
647647
flags, local_page_list, NULL, NULL);
648648
up_read(&owning_mm->mmap_sem);
649649

650-
if (npages < 0)
650+
if (npages < 0) {
651+
if (npages != -EAGAIN)
652+
pr_warn("fail to get %zu user pages with error %d\n", gup_num_pages, npages);
653+
else
654+
pr_debug("fail to get %zu user pages with error %d\n", gup_num_pages, npages);
651655
break;
656+
}
652657

653658
bcnt -= min_t(size_t, npages << PAGE_SHIFT, bcnt);
654659
mutex_lock(&umem_odp->umem_mutex);
@@ -666,8 +671,13 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,
666671
ret = ib_umem_odp_map_dma_single_page(
667672
umem_odp, k, local_page_list[j],
668673
access_mask, current_seq);
669-
if (ret < 0)
674+
if (ret < 0) {
675+
if (ret != -EAGAIN)
676+
pr_warn("ib_umem_odp_map_dma_single_page failed with error %d\n", ret);
677+
else
678+
pr_debug("ib_umem_odp_map_dma_single_page failed with error %d\n", ret);
670679
break;
680+
}
671681

672682
p = page_to_phys(local_page_list[j]);
673683
k++;

drivers/infiniband/hw/mlx5/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o
22

3-
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o cong.o
3+
mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq_cmd.o \
4+
srq.o mr.o ah.o mad.o gsi.o ib_virt.o cmd.o \
5+
cong.o
46
mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o
57
mlx5_ib-$(CONFIG_MLX5_ESWITCH) += ib_rep.o
68
mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <rdma/ib_user_verbs.h>
3636
#include <rdma/ib_cache.h>
3737
#include "mlx5_ib.h"
38+
#include "srq.h"
3839

3940
static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq)
4041
{
@@ -81,7 +82,7 @@ static void *get_sw_cqe(struct mlx5_ib_cq *cq, int n)
8182

8283
cqe64 = (cq->mcq.cqe_sz == 64) ? cqe : cqe + 64;
8384

84-
if (likely((cqe64->op_own) >> 4 != MLX5_CQE_INVALID) &&
85+
if (likely(get_cqe_opcode(cqe64) != MLX5_CQE_INVALID) &&
8586
!((cqe64->op_own & MLX5_CQE_OWNER_MASK) ^ !!(n & (cq->ibcq.cqe + 1)))) {
8687
return cqe;
8788
} else {
@@ -177,8 +178,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
177178
struct mlx5_core_srq *msrq = NULL;
178179

179180
if (qp->ibqp.xrcd) {
180-
msrq = mlx5_core_get_srq(dev->mdev,
181-
be32_to_cpu(cqe->srqn));
181+
msrq = mlx5_cmd_get_srq(dev, be32_to_cpu(cqe->srqn));
182182
srq = to_mibsrq(msrq);
183183
} else {
184184
srq = to_msrq(qp->ibqp.srq);
@@ -197,7 +197,7 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
197197
}
198198
wc->byte_len = be32_to_cpu(cqe->byte_cnt);
199199

200-
switch (cqe->op_own >> 4) {
200+
switch (get_cqe_opcode(cqe)) {
201201
case MLX5_CQE_RESP_WR_IMM:
202202
wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
203203
wc->wc_flags = IB_WC_WITH_IMM;
@@ -537,7 +537,7 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq,
537537
*/
538538
rmb();
539539

540-
opcode = cqe64->op_own >> 4;
540+
opcode = get_cqe_opcode(cqe64);
541541
if (unlikely(opcode == MLX5_CQE_RESIZE_CQ)) {
542542
if (likely(cq->resize_buf)) {
543543
free_cq_buf(dev, &cq->buf);
@@ -1295,7 +1295,7 @@ static int copy_resize_cqes(struct mlx5_ib_cq *cq)
12951295
return -EINVAL;
12961296
}
12971297

1298-
while ((scqe64->op_own >> 4) != MLX5_CQE_RESIZE_CQ) {
1298+
while (get_cqe_opcode(scqe64) != MLX5_CQE_RESIZE_CQ) {
12991299
dcqe = mlx5_frag_buf_get_wqe(&cq->resize_buf->fbc,
13001300
(i + 1) & cq->resize_buf->nent);
13011301
dcqe64 = dsize == 64 ? dcqe : dcqe + 64;

drivers/infiniband/hw/mlx5/ib_rep.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include "ib_rep.h"
7+
#include "srq.h"
78

89
static const struct mlx5_ib_profile rep_profile = {
910
STAGE_CREATE(MLX5_IB_STAGE_INIT,
@@ -21,6 +22,9 @@ static const struct mlx5_ib_profile rep_profile = {
2122
STAGE_CREATE(MLX5_IB_STAGE_ROCE,
2223
mlx5_ib_stage_rep_roce_init,
2324
mlx5_ib_stage_rep_roce_cleanup),
25+
STAGE_CREATE(MLX5_IB_STAGE_SRQ,
26+
mlx5_init_srq_table,
27+
mlx5_cleanup_srq_table),
2428
STAGE_CREATE(MLX5_IB_STAGE_DEVICE_RESOURCES,
2529
mlx5_ib_stage_dev_res_init,
2630
mlx5_ib_stage_dev_res_cleanup),

0 commit comments

Comments
 (0)