From owner-freebsd-net@FreeBSD.ORG Tue Apr 2 18:33:20 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0DD2426C for ; Tue, 2 Apr 2013 18:33:20 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013:c01::22b]) by mx1.freebsd.org (Postfix) with ESMTP id A0093EE2 for ; Tue, 2 Apr 2013 18:33:19 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id b15so373863eae.16 for ; Tue, 02 Apr 2013 11:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=qe2w0IeIxO1nRA4TVhDdQUDgG+me2flqVxfM5BHyZP0=; b=BuPwWOOjJVQbkpZeNJDeaauUMvVLLz//dbvoN0GCBVYUhfV/kLyHhPLDIJOwoftyVz sgqcnMygKxCudAR7HDHMI0CWTrm5PJt4qsRHgdo7iylzXkeVxwhY+D9NHHLT0B/+4Lz0 Sd2jRzHwcILxtjQRvWntYZFgv8ADcx+EPCQdxhDjQSRknSpgteD/dxMtBmM4ssm0+kg3 iaWzNz3uuUwgs7h7Ma6fe/HCIA1UXjygNAEY8CIHXK2cYjCiCse3vOxD3McpPkgTVIBA SH3Y/BQUQ6oFonUO2Q9wtIzqykdImFtz+mYnS6GFMLsNrQFsMO+jU1aUmMhMK6ffh89v IT3g== MIME-Version: 1.0 X-Received: by 10.14.218.71 with SMTP id j47mr51407702eep.28.1364927598816; Tue, 02 Apr 2013 11:33:18 -0700 (PDT) Received: by 10.223.61.17 with HTTP; Tue, 2 Apr 2013 11:33:18 -0700 (PDT) Date: Tue, 2 Apr 2013 11:33:18 -0700 Message-ID: Subject: Small patch in OFED/sdp From: Vijay Singh To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 18:33:20 -0000 Hi, this is based on the the understanding that the SS_NBIO is a socket state, and not a state of the socket buffer. F9@[/u/vijay/bsd/CODE/cur/sys/ofed/drivers/infiniband/ulp/sdp]# svn diff Index: sdp_main.c =================================================================== --- sdp_main.c (revision 249029) +++ sdp_main.c (working copy) @@ -1267,7 +1267,7 @@ /* Socket buffer is empty and we shall not block. */ if (sb->sb_cc == 0 && - ((sb->sb_flags & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { + ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { error = EAGAIN; goto out; } @@ -1297,7 +1297,7 @@ /* Socket buffer got some data that we shall deliver now. */ if (sb->sb_cc > 0 && !(flags & MSG_WAITALL) && - ((sb->sb_flags & SS_NBIO) || + ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || sb->sb_cc >= sb->sb_lowat || sb->sb_cc >= uio->uio_resid ||