ib_cm.c (27fd38c5226ed0f1712d071880fa8e739eb78650) ib_cm.c (0cb43965d42a21a7af41f88f1021b478dc102425)
1/*
2 * Copyright (c) 2006 Oracle. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 22 unchanged lines hidden (view full) ---

31 *
32 */
33#include <linux/kernel.h>
34#include <linux/in.h>
35#include <linux/slab.h>
36#include <linux/vmalloc.h>
37#include <linux/ratelimit.h>
38
1/*
2 * Copyright (c) 2006 Oracle. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 22 unchanged lines hidden (view full) ---

31 *
32 */
33#include <linux/kernel.h>
34#include <linux/in.h>
35#include <linux/slab.h>
36#include <linux/vmalloc.h>
37#include <linux/ratelimit.h>
38
39#include "rds_single_path.h"
39#include "rds.h"
40#include "ib.h"
41
42/*
43 * Set the selected protocol version
44 */
45static void rds_ib_set_protocol(struct rds_connection *conn, unsigned int version)
46{

--- 142 unchanged lines hidden (view full) ---

189
190 if (dp) {
191 memset(dp, 0, sizeof(*dp));
192 dp->dp_saddr = conn->c_laddr;
193 dp->dp_daddr = conn->c_faddr;
194 dp->dp_protocol_major = RDS_PROTOCOL_MAJOR(protocol_version);
195 dp->dp_protocol_minor = RDS_PROTOCOL_MINOR(protocol_version);
196 dp->dp_protocol_minor_mask = cpu_to_be16(RDS_IB_SUPPORTED_PROTOCOLS);
40#include "rds.h"
41#include "ib.h"
42
43/*
44 * Set the selected protocol version
45 */
46static void rds_ib_set_protocol(struct rds_connection *conn, unsigned int version)
47{

--- 142 unchanged lines hidden (view full) ---

190
191 if (dp) {
192 memset(dp, 0, sizeof(*dp));
193 dp->dp_saddr = conn->c_laddr;
194 dp->dp_daddr = conn->c_faddr;
195 dp->dp_protocol_major = RDS_PROTOCOL_MAJOR(protocol_version);
196 dp->dp_protocol_minor = RDS_PROTOCOL_MINOR(protocol_version);
197 dp->dp_protocol_minor_mask = cpu_to_be16(RDS_IB_SUPPORTED_PROTOCOLS);
197 dp->dp_ack_seq = rds_ib_piggyb_ack(ic);
198 dp->dp_ack_seq = cpu_to_be64(rds_ib_piggyb_ack(ic));
198
199 /* Advertise flow control */
200 if (ic->i_flowctl) {
201 unsigned int credits;
202
203 credits = IB_GET_POST_CREDITS(atomic_read(&ic->i_credits));
204 dp->dp_credit = cpu_to_be32(credits);
205 atomic_sub(IB_SET_POST_CREDITS(credits), &ic->i_credits);

--- 739 unchanged lines hidden ---
199
200 /* Advertise flow control */
201 if (ic->i_flowctl) {
202 unsigned int credits;
203
204 credits = IB_GET_POST_CREDITS(atomic_read(&ic->i_credits));
205 dp->dp_credit = cpu_to_be32(credits);
206 atomic_sub(IB_SET_POST_CREDITS(credits), &ic->i_credits);

--- 739 unchanged lines hidden ---