public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
To: David Miller <davem@davemloft.net>
Cc: honli@redhat.com, joshhunt00@gmail.com, jjolly@suse.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: RE: [PATCH] rds: Error on offset mismatch if not loopback
Date: Wed, 20 Nov 2013 13:28:24 -0800 (PST)	[thread overview]
Message-ID: <c4336a61-61bd-44bb-bd76-04171e387965@default> (raw)
In-Reply-To: <20131120.135457.154965902030101577.davem@davemloft.net>

> Why are you posting this message a second time?

Reposting just the contents of the second message in case it got missed the previous time.

Looks like the fix pointed to by the previous link is for a panic on a PPC system with a PAGE_SIZE of 64Kbytes.
I think the sequence it was going through before that fix was:
/* Do not send cong updates to IB loopback */
        if (conn->c_loopback
            && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
                rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
                return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
        }
rds_ib_xmit returns 8240
rds_send_xmit : c_xmit_data_off = 0 + 8240 - 48 (rds header the first time) = 8196
                c_xmit_data_off < 65536 (sg->length)
                calls rds_ib_xmit again
rds_ib_xmit returns 8240
rds_send_xmit: c_xmit_data_off = 8192+8240 = 16432 and calls rds_ib_xmit
rds_ib_xmit : returns 8240
rds_send_xmit: c_xmit_data_off 24672 and calls rds_ib_xmit ...
...
and so on till
rds_send_xmit: c_xmit_data_off 57632 and calls rds_ib_xmit
rds_ib_xmit: returns 8240

On the last iteration it hits the below BUG_ON in rds_send_xmit.
while (ret) {
    tmp = min_t(int, ret, sg->length -
                         conn->c_xmit_data_off);
 [tmp = 7904]
    conn->c_xmit_data_off += tmp;
[c_xmit_data_off = 65536]
    ret -= tmp;
[ret = 8240-7904 = 336]
    if (conn->c_xmit_data_off == sg->length) {
         conn->c_xmit_data_off = 0;
         sg++;
         conn->c_xmit_sg++;
         BUG_ON(ret != 0 &&
             conn->c_xmit_sg == rm->data.op_nents);
    }
}

Since the congestion update over loopback is not actually transmitted as a message,
the multiple iterations we see in the case of ppc is unnecessary.
All that rds_ib_xmit needs to do is return a number of bytes that will tell the caller
that we are done with this message.
  
This might fix the original problem without introducing the current panic:
/* Do not send cong updates to IB loopback */
        if (conn->c_loopback
            && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
                rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
                scat = &rm->data.op_sg[sg];
                ret = max_t(int, RDS_CONG_MAP_BYTES, scat->length);
                return ret + sizeof(struct rds_header);
        }
It will return 8240 when PAGE_SIZE is 4k and 64k+48 in case of ppc when scat->length is 64k and 
be done with one iteration of rds_send_xmit/rds_ib_xmit loop.

Venkat

  reply	other threads:[~2013-11-20 21:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 21:32 [PATCH] rds: Error on offset mismatch if not loopback John Jolly
2012-09-21 21:38 ` Venkat Venkatsubra
2012-09-22 19:25 ` David Miller
     [not found]   ` <CAKA=qzac9=UhLF_Z4FnnH+sR7xvkDux4oayC6dPYe=hMLsDxRg@mail.gmail.com>
2013-11-13  4:24     ` Josh Hunt
2013-11-13 15:16       ` Venkat Venkatsubra
2013-11-13 17:40         ` Josh Hunt
2013-11-14  0:55           ` Honggang LI
2013-11-14  1:27             ` Josh Hunt
2013-11-14 13:43             ` Venkat Venkatsubra
2013-11-15  2:32               ` Honggang LI
2013-11-19 23:33                 ` Venkat Venkatsubra
2013-11-20 18:09                   ` Venkat Venkatsubra
2013-11-20 18:54                     ` David Miller
2013-11-20 21:28                       ` Venkat Venkatsubra [this message]
2013-11-13  6:09     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-09-20  7:11 John Jolly
2012-09-21 17:20 ` David Miller
2012-09-21 21:28   ` John Jolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4336a61-61bd-44bb-bd76-04171e387965@default \
    --to=venkat.x.venkatsubra@oracle.com \
    --cc=davem@davemloft.net \
    --cc=honli@redhat.com \
    --cc=jjolly@suse.com \
    --cc=joshhunt00@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox