ib_recv.c (5fd5c44d3f27c93685d4a036565245f3cdb8c033) ib_recv.c (6114eab535ab49239e0a6ce08eb9243664aef993)
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:

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

758
759 while (copied < RDS_CONG_MAP_BYTES) {
760 uint64_t *src, *dst;
761 unsigned int k;
762
763 to_copy = min(RDS_FRAG_SIZE - frag_off, PAGE_SIZE - map_off);
764 BUG_ON(to_copy & 7); /* Must be 64bit aligned. */
765
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:

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

758
759 while (copied < RDS_CONG_MAP_BYTES) {
760 uint64_t *src, *dst;
761 unsigned int k;
762
763 to_copy = min(RDS_FRAG_SIZE - frag_off, PAGE_SIZE - map_off);
764 BUG_ON(to_copy & 7); /* Must be 64bit aligned. */
765
766 addr = kmap_atomic(sg_page(&frag->f_sg), KM_SOFTIRQ0);
766 addr = kmap_atomic(sg_page(&frag->f_sg));
767
768 src = addr + frag_off;
769 dst = (void *)map->m_page_addrs[map_page] + map_off;
770 for (k = 0; k < to_copy; k += 8) {
771 /* Record ports that became uncongested, ie
772 * bits that changed from 0 to 1. */
773 uncongested |= ~(*src) & *dst;
774 *dst++ = *src++;
775 }
767
768 src = addr + frag_off;
769 dst = (void *)map->m_page_addrs[map_page] + map_off;
770 for (k = 0; k < to_copy; k += 8) {
771 /* Record ports that became uncongested, ie
772 * bits that changed from 0 to 1. */
773 uncongested |= ~(*src) & *dst;
774 *dst++ = *src++;
775 }
776 kunmap_atomic(addr, KM_SOFTIRQ0);
776 kunmap_atomic(addr);
777
778 copied += to_copy;
779
780 map_off += to_copy;
781 if (map_off == PAGE_SIZE) {
782 map_off = 0;
783 map_page++;
784 }

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

821
822 /* XXX shut down the connection if port 0,0 are seen? */
823
824 rdsdebug("ic %p ibinc %p recv %p byte len %u\n", ic, ibinc, recv,
825 data_len);
826
827 if (data_len < sizeof(struct rds_header)) {
828 rds_ib_conn_error(conn, "incoming message "
777
778 copied += to_copy;
779
780 map_off += to_copy;
781 if (map_off == PAGE_SIZE) {
782 map_off = 0;
783 map_page++;
784 }

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

821
822 /* XXX shut down the connection if port 0,0 are seen? */
823
824 rdsdebug("ic %p ibinc %p recv %p byte len %u\n", ic, ibinc, recv,
825 data_len);
826
827 if (data_len < sizeof(struct rds_header)) {
828 rds_ib_conn_error(conn, "incoming message "
829 "from %pI4 didn't include a "
829 "from %pI4 didn't inclue a "
830 "header, disconnecting and "
831 "reconnecting\n",
832 &conn->c_faddr);
833 return;
834 }
835 data_len -= sizeof(struct rds_header);
836
837 ihdr = &ic->i_recv_hdrs[recv - ic->i_recvs];

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

914 else {
915 ic->i_recv_data_rem = 0;
916 ic->i_ibinc = NULL;
917
918 if (ibinc->ii_inc.i_hdr.h_flags == RDS_FLAG_CONG_BITMAP)
919 rds_ib_cong_recv(conn, ibinc);
920 else {
921 rds_recv_incoming(conn, conn->c_faddr, conn->c_laddr,
830 "header, disconnecting and "
831 "reconnecting\n",
832 &conn->c_faddr);
833 return;
834 }
835 data_len -= sizeof(struct rds_header);
836
837 ihdr = &ic->i_recv_hdrs[recv - ic->i_recvs];

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

914 else {
915 ic->i_recv_data_rem = 0;
916 ic->i_ibinc = NULL;
917
918 if (ibinc->ii_inc.i_hdr.h_flags == RDS_FLAG_CONG_BITMAP)
919 rds_ib_cong_recv(conn, ibinc);
920 else {
921 rds_recv_incoming(conn, conn->c_faddr, conn->c_laddr,
922 &ibinc->ii_inc, GFP_ATOMIC,
923 KM_SOFTIRQ0);
922 &ibinc->ii_inc, GFP_ATOMIC);
924 state->ack_next = be64_to_cpu(hdr->h_sequence);
925 state->ack_next_valid = 1;
926 }
927
928 /* Evaluate the ACK_REQUIRED flag *after* we received
929 * the complete frame, and after bumping the next_rx
930 * sequence. */
931 if (hdr->h_flags & RDS_FLAG_ACK_REQUIRED) {

--- 145 unchanged lines hidden ---
923 state->ack_next = be64_to_cpu(hdr->h_sequence);
924 state->ack_next_valid = 1;
925 }
926
927 /* Evaluate the ACK_REQUIRED flag *after* we received
928 * the complete frame, and after bumping the next_rx
929 * sequence. */
930 if (hdr->h_flags & RDS_FLAG_ACK_REQUIRED) {

--- 145 unchanged lines hidden ---