Unverified Commit efcbd7d2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4632 [OLK-5.10] drivers: update yunsilicon drivers to version 1.1.0.375

Merge Pull Request from: @OGman 
 
https://gitee.com/openeuler/kernel/issues/I92KPS
Update yunsilicon drivers to version 1.1.0.375. 
 
Link:https://gitee.com/openeuler/kernel/pulls/4632

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 5a346290 23b8024e
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -2,10 +2,17 @@
# Copyright (C) 2021 - 2023, Shanghai Yunsilicon Technology Co., Ltd.
# All rights reserved.

ccflags-y := -I $(srctree)/drivers/net/ethernet/yunsilicon/xsc/
ccflags-y := -I$(srctree)/drivers/net/ethernet/yunsilicon/xsc
ccflags-y += -Wno-implicit-fallthrough
ifeq ($(USE_INTERNAL_IB_CORE), 1)
	ccflags-y += -include /usr/src/ofa_kernel/include/rdma/ib_umem.h
endif

obj-$(CONFIG_INFINIBAND_XSC) += xsc_ib.o

xsc_ib-y := main.o xsc_rdma_ctrl.o cq.o qp.o mem.o mr.o ah.o mad.o counters.o devx.o global.o private_dev.o ib_umem_ex.o rtt.o
xsc_ib-$(CONFIG_MLX_PEER_SUPPORT) := peer_mem.o
xsc_ib-y := main.o xsc_rdma_ctrl.o cq.o qp.o mem.o mr.o ah.o \
		counters.o devx.o global.o private_dev.o ib_umem_ex.o\
		rtt.o xsc_ib_sysfs.o

xsc_ib-$(CONFIG_XSC_PEER_SUPPORT) += peer_mem.o
+6 −6
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/random.h>
#include <rdma/ib_cache.h>

#include "xsc_ib.h"
#include "user.h"
@@ -32,7 +33,7 @@ static u16 xsc_ah_get_udp_sport(const struct xsc_ib_dev *dev,
	u16 sport = 0;
	u32 fl = 0;

	if ((gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP) &&
	if (gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP &&
	    (rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH) &&
	    (ah_attr->grh.flow_label & IB_GRH_FLOWLABEL_MASK)) {
		fl = ah_attr->grh.flow_label;
@@ -88,11 +89,10 @@ xsc_ib_create_ah_def()
{
	struct xsc_ib_ah *ah = to_mah(ibah);
	struct xsc_ib_dev *dev = to_mdev(ibah->device);

	struct rdma_ah_attr *ah_attr = init_attr->ah_attr;
	enum rdma_ah_attr_type ah_type = ah_attr->type;

	if ((ah_type == RDMA_AH_ATTR_TYPE_ROCE) &&
	if (ah_type == RDMA_AH_ATTR_TYPE_ROCE &&
	    !(rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH))
		return RET_VALUE(-EINVAL);

+36 −29
Original line number Diff line number Diff line
@@ -5,11 +5,11 @@
 */

#include <linux/fs.h>
#include <common/xsc_core.h>
#include <common/xsc_hsi.h>
#include <common/driver.h>
#include <common/xsc_lag.h>
#include <common/xsc_cmd.h>
#include "common/xsc_core.h"
#include "common/xsc_hsi.h"
#include "common/driver.h"
#include "common/xsc_lag.h"
#include "common/xsc_cmd.h"
#include "counters.h"

#define COUNTERS_FILE_NAME         "counters"
@@ -74,7 +74,8 @@ static ssize_t counters_names_show(struct kobject *kobjs,
	const struct counter_desc *desc;

	xsc_counters_name_attr = container_of(attr,
		struct xsc_counters_attribute, attr);
					      struct xsc_counters_attribute,
					      attr);

	if (!xsc_counters_name_attr->dev ||
	    !xsc_counters_name_attr->desc ||
@@ -105,7 +106,8 @@ static ssize_t counters_show(struct kobject *kobjs,
	struct xsc_lag *ldev;

	xsc_counters_attr = container_of(attr,
		struct xsc_counters_attribute, attr);
					 struct xsc_counters_attribute,
					 attr);

	if (!xsc_counters_attr->dev ||
	    !xsc_counters_attr->desc ||
@@ -168,7 +170,8 @@ static ssize_t counters_value_read(struct file *file,
	const struct counter_desc *desc;

	xsc_counters_bin_attr = container_of(&bin_attr->attr,
		struct xsc_counters_bin_attribute, attr);
					     struct xsc_counters_bin_attribute,
					     attr);

	if (!xsc_counters_bin_attr->dev ||
	    !xsc_counters_bin_attr->desc ||
@@ -260,15 +263,19 @@ int xsc_counters_init(struct ib_device *ib_dev, struct xsc_core_device *dev)
	xsc_counters_bin->dev = dev;

	if (is_pf) {
		xsc_counters_name->desc = xsc_counters->desc =
		xsc_counters_name->desc = &hw_stats_desc[0];
		xsc_counters->desc = &hw_stats_desc[0];
		xsc_counters_bin->desc = &hw_stats_desc[0];
		xsc_counters_name->desc_size = xsc_counters->desc_size =
		xsc_counters_name->desc_size = ARRAY_SIZE(hw_stats_desc);
		xsc_counters->desc_size = ARRAY_SIZE(hw_stats_desc);
		xsc_counters_bin->desc_size = ARRAY_SIZE(hw_stats_desc);
		xsc_counters_bin->size = xsc_counters_bin->desc_size * sizeof(u64);
	} else {
		xsc_counters_name->desc = xsc_counters->desc =
		xsc_counters_name->desc = &vf_hw_stats_desc[0];
		xsc_counters->desc = &vf_hw_stats_desc[0];
		xsc_counters_bin->desc = &vf_hw_stats_desc[0];
		xsc_counters_name->desc_size = xsc_counters->desc_size =
		xsc_counters_name->desc_size = ARRAY_SIZE(vf_hw_stats_desc);
		xsc_counters->desc_size = ARRAY_SIZE(vf_hw_stats_desc);
		xsc_counters_bin->desc_size = ARRAY_SIZE(vf_hw_stats_desc);
		xsc_counters_bin->size = xsc_counters_bin->desc_size * sizeof(u64);
	}
@@ -283,7 +290,7 @@ int xsc_counters_init(struct ib_device *ib_dev, struct xsc_core_device *dev)

	dev->counters_priv = counters_attr_g;

	ret = sysfs_create_group(&(ib_dev->dev.kobj), counters_attr_g);
	ret = sysfs_create_group(&ib_dev->dev.kobj, counters_attr_g);
	if (ret)
		goto err_counters_create_group;

@@ -333,7 +340,7 @@ void xsc_counters_fini(struct ib_device *ib_dev, struct xsc_core_device *dev)
	xsc_counters = (struct xsc_counters_attribute *)counters_attrs[1];

	if (counters_attr_g) {
		sysfs_remove_group(&(ib_dev->dev.kobj), counters_attr_g);
		sysfs_remove_group(&ib_dev->dev.kobj, counters_attr_g);
		kfree(counters_attr_g);
		counters_attr_g = NULL;
	}
+17 −17
Original line number Diff line number Diff line
@@ -32,12 +32,12 @@ struct xsc_counters_bin_attribute {
	struct attribute  attr;
	ssize_t (*read)(struct file *file,
			struct kobject *kobj,
		struct bin_attribute *attr,
		char *buf, loff_t offset, size_t size);
			struct bin_attribute *bin_attr,
			char *buf, loff_t off, size_t size);
	ssize_t (*write)(struct file *file,
			 struct kobject *kobj,
		struct bin_attribute *attr,
		char *buf, loff_t offset, size_t size);
			 struct bin_attribute *bin_attr,
			 char *buf, loff_t off, size_t size);
	int (*mmap)(struct file *file,
		    struct kobject *kobj,
		    struct bin_attribute *attr,
+20 −23
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include <rdma/ib_umem.h>
#include "xsc_ib.h"
#include "user.h"
#include <common/xsc_hsi.h>
#include "common/xsc_hsi.h"
#include <linux/dma-direct.h>

enum {
@@ -129,7 +129,8 @@ static void *get_sw_cqe(struct xsc_ib_cq *cq, int n)
}

static inline void handle_good_req(struct ib_wc *wc,
	struct xsc_cqe *cqe, u8 opcode)
				   struct xsc_cqe *cqe,
				   u8 opcode)
{
	wc->opcode = xsc_cqe_opcode[opcode];
	if (opcode == XSC_OPCODE_RDMA_REQ_READ)
@@ -150,7 +151,6 @@ static void handle_responder(struct ib_wc *wc, struct xsc_cqe *cqe,
	idx = wq->tail & (wq->wqe_cnt - 1);
	wc->wr_id = wq->wrid[idx];
	++wq->tail;

}

struct ib_mad_list_head {
@@ -356,7 +356,6 @@ int xsc_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
	spin_unlock_irqrestore(&cq->lock, flags);

	return npolled;

}

int xsc_cqe_is_empty(struct xsc_ib_cq *cq)
@@ -454,12 +453,11 @@ static int create_cq_user(struct xsc_ib_dev *dev, struct ib_udata *udata,
	xsc_ib_cont_pages(cq->buf.umem, ucmd.buf_addr, &npages, &page_shift,
			  &ncont, NULL);
	if (ncont != npages) {
		xsc_ib_warn(dev, "bad page_shift:%d, ncont:%d\n", page_shift, ncont);
		xsc_ib_dbg(dev, "bad page_shift:%d, ncont:%d\n", page_shift, ncont);
		/* amber doesn't support compound pages */
		page_shift = PAGE_SHIFT;
		ncont = npages;
		xsc_ib_warn(dev, "overwrite to page_shift:%d, ncont:%d\n",
			     page_shift, ncont);
		xsc_ib_dbg(dev, "overwrite to page_shift:%d, ncont:%d\n", page_shift, ncont);
	}
	log_cq_sz = ilog2(entries);
	hw_npages = DIV_ROUND_UP((1 << log_cq_sz) * sizeof(struct xsc_cqe), PAGE_SIZE_4K);
@@ -613,8 +611,7 @@ xsc_ib_create_cq_def()
		destroy_cq_kernel(dev, cq);

err_create:
	kfree(cq);
	return err;
	return RET_VALUE(err);
}

xsc_ib_destroy_cq_def()
@@ -660,7 +657,7 @@ void __xsc_ib_cq_clean(struct xsc_ib_cq *cq, u32 rsn)
	/* Now sweep backwards through the CQ, removing CQ entries
	 * that match our QP by copying older entries on top of them.
	 */
	while ((int) --prod_index - (int) cq->xcq.cons_index >= 0) {
	while ((int)(--prod_index) - (int)cq->xcq.cons_index >= 0) {
		cqe = get_cqe(cq, prod_index & cq->ibcq.cqe);
		if (is_equal_rsn(cqe, rsn)) {
			++nfreed;
Loading