From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: Re: [PATCH for-next 03/10] IB/iser: Don't register memory for all immediatedata writes Date: Tue, 17 Nov 2015 12:15:16 +0200 Message-ID: <564AFE34.5090500@dev.mellanox.co.il> References: <1447691861-3796-1-git-send-email-sagig@mellanox.com> <1447691861-3796-4-git-send-email-sagig@mellanox.com> <564ADB7D.20806@mellanox.com> <564AF653.6060401@dev.mellanox.co.il> <564AFD4A.4030300@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <564AFD4A.4030300-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Or Gerlitz , Sagi Grimberg , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: "Nicholas A. Bellinger" , Steve Wise , Jenny Derzhavetz List-Id: linux-rdma@vger.kernel.org >> It's because device->mr might not be allocated at all if >> always_register=Y, however in this case for all-immediatedata writes >> I don't need memory registration and I can use pd->local_dma_lkey. >> >> This hunk prevents a NULL dereference (as I mentioned, device->mr might >> not be allocated at all). > > I am not sure to follow, but can't you put this fix into a separate > patch to make things more clearer? I don't know how to split this patch any further. Before this patch in case always_register=Y we *always registered* and never allocated the global mr. This patch allows us not to do it ifor all-immediatedata writes. So in order not to hit a NULL deref we use this conditional. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html