Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e404f945 authored by Parav Pandit's avatar Parav Pandit Committed by Doug Ledford
Browse files

IB/rxe: improved debug prints & code cleanup



1. Debugging qp state transitions and qp errors in loopback and
multiple QP tests is difficult without qp numbers in debug logs.
This patch adds qp number to important debug logs.

2. Instead of having rxe: prefix in few logs and not having in
few logs, using uniform module name prefix using pr_fmt macro.

3. Code cleanup for various warnings reported by checkpatch for
incomplete unsigned data type, line over 80 characters, return
statements.

Signed-off-by: default avatarParav Pandit <pandit.parav@gmail.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent b9fe856e
Loading
Loading
Loading
Loading
+6 −28
Original line number Diff line number Diff line
@@ -358,38 +358,16 @@ static int __init rxe_module_init(void)
	/* initialize slab caches for managed objects */
	err = rxe_cache_init();
	if (err) {
		pr_err("rxe: unable to init object pools\n");
		pr_err("unable to init object pools\n");
		return err;
	}

	err = rxe_net_ipv4_init();
	if (err) {
		pr_err("rxe: unable to init ipv4 tunnel\n");
		rxe_cache_exit();
		goto exit;
	}

	err = rxe_net_ipv6_init();
	if (err) {
		pr_err("rxe: unable to init ipv6 tunnel\n");
		rxe_cache_exit();
		goto exit;
	}

	err = register_netdevice_notifier(&rxe_net_notifier);
	if (err) {
		pr_err("rxe: Failed to rigister netdev notifier\n");
		goto exit;
	}

	pr_info("rxe: loaded\n");
	err = rxe_net_init();
	if (err)
		return err;

	pr_info("loaded\n");
	return 0;

exit:
	rxe_release_udp_tunnel(recv_sockets.sk4);
	rxe_release_udp_tunnel(recv_sockets.sk6);
	return err;
}

static void __exit rxe_module_exit(void)
@@ -398,7 +376,7 @@ static void __exit rxe_module_exit(void)
	rxe_net_exit();
	rxe_cache_exit();

	pr_info("rxe: unloaded\n");
	pr_info("unloaded\n");
}

late_initcall(rxe_module_init);
+5 −0
Original line number Diff line number Diff line
@@ -34,6 +34,11 @@
#ifndef RXE_H
#define RXE_H

#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/crc32.h>
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct ib_ah_attr *attr)
	struct rxe_port *port;

	if (attr->port_num != 1) {
		pr_info("rxe: invalid port_num = %d\n", attr->port_num);
		pr_info("invalid port_num = %d\n", attr->port_num);
		return -EINVAL;
	}

@@ -47,7 +47,7 @@ int rxe_av_chk_attr(struct rxe_dev *rxe, struct ib_ah_attr *attr)

	if (attr->ah_flags & IB_AH_GRH) {
		if (attr->grh.sgid_index > port->attr.gid_tbl_len) {
			pr_info("rxe: invalid sgid index = %d\n",
			pr_info("invalid sgid index = %d\n",
				attr->grh.sgid_index);
			return -EINVAL;
		}
+4 −2
Original line number Diff line number Diff line
@@ -567,7 +567,8 @@ int rxe_completer(void *arg)
	state = COMPST_GET_ACK;

	while (1) {
		pr_debug("state = %s\n", comp_state_name[state]);
		pr_debug("qp#%d state = %s\n", qp_num(qp),
			 comp_state_name[state]);
		switch (state) {
		case COMPST_GET_ACK:
			skb = skb_dequeue(&qp->resp_pkts);
@@ -709,7 +710,8 @@ int rxe_completer(void *arg)
					qp->comp.rnr_retry--;

				qp->req.need_retry = 1;
				pr_debug("set rnr nak timer\n");
				pr_debug("qp#%d set rnr nak timer\n",
					 qp_num(qp));
				mod_timer(&qp->rnr_nak_timer,
					  jiffies + rnrnak_jiffies(aeth_syn(pkt)
						& ~AETH_TYPE_MASK));
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ int rxe_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)

	ret = remap_vmalloc_range(vma, ip->obj, 0);
	if (ret) {
		pr_err("rxe: err %d from remap_vmalloc_range\n", ret);
		pr_err("err %d from remap_vmalloc_range\n", ret);
		goto done;
	}

Loading