public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
To: Honggang LI <honli@redhat.com>, Josh Hunt <joshhunt00@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	jjolly@suse.com, LKML <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org
Subject: RE: [PATCH] rds: Error on offset mismatch if not loopback
Date: Tue, 19 Nov 2013 15:33:06 -0800 (PST)	[thread overview]
Message-ID: <8744a6a4-d7a8-4e6f-8934-48a4fd4da0ce@default> (raw)
In-Reply-To: <528587D0.5060105@redhat.com>

We now have lot more information than we did before.
When sending a "congestion update" in rds_ib_xmit() we are now returning an incorrect number as bytes sent:

        BUG_ON(off % RDS_FRAG_SIZE);
        BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));

        /* 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 = sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
                ret = min_t(int, ret, scat->length - conn->c_xmit_data_off);
                return ret;
        }

It returns min(8240, 4096-0) i.e. 4096 bytes.
The caller rds_send_xmit() is made to think a partial message (4096 out of 8240) was sent.
It calls rds_ib_xmit() again with a data offset "off" of 4096-48 (rds header) (=4048 bytes). And we hit the BUG_ON.

The reason I didn't hit the panic on my test on Oracle UEK2 which is based on 2.6.39 kernel is it had it like this:
        BUG_ON(off % RDS_FRAG_SIZE);
        BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));

        /* 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;
        }
(So it wasn't 100% 2.6.39 ;-). )
It returned 8240 bytes. The caller rds_send_xmit decides the full message was sent (48 byte header + 4096 data + 4096 data).
And it worked.

Then I found this info on the change that was done upstream which now causes the panic:
http://marc.info/?l=linux-netdev&m=129908332903057
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6094628bfd94323fc1cea05ec2c6affd98c18f7f 

Will investigate more into which problem the above change addressed.

Venkat

  reply	other threads:[~2013-11-19 23:33 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 [this message]
2013-11-20 18:09                   ` Venkat Venkatsubra
2013-11-20 18:54                     ` David Miller
2013-11-20 21:28                       ` Venkat Venkatsubra
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=8744a6a4-d7a8-4e6f-8934-48a4fd4da0ce@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