RE: nes_store_flash_data() bugged?
Hi Alexey, You are right and the flash code is with 0[xX] and not starting with xX and p[0] checks are useless on marked line. This is from early development and did not get changed. Thanks Faisal -Original Message- From: Alexey Dobriyan [mailto:adobri...@gmail.com] Sent: Friday, July 17, 2015 7:02 AM To: gstre...@neteffect.com; Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: nes_store_flash_data() bugged? I've been converting nes.c driver and stumbled upon the following bit of code (below). What does marked line is supposed to mean? If it's usual 0[xX] check, then there are a lot of typos. If it is not and p[0] is, say, 'x', then simple_strtoul() will return 0 because 'x' is not valid start for hex integer. Can someone describe what the real format of this flash data is? Alexey -- static ssize_t nes_store_flash_data(struct device_driver *ddp, const char *buf, size_t count) { char *p = (char *)buf; u32 val; u32 i = 0; struct nes_device *nesdev; if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { val = simple_strtoul(p, p, 16); list_for_each_entry(nesdev, nes_dev_list, list) { if (i == ee_flsh_adapter) { nes_write32(nesdev-regs + NES_FLASH_DATA, val); break; } i++; } } return strnlen(buf, count); }
RE: [PATCH] RDMA/nes: Remove unused field sent_ts
From: Tina Ruchandani [mailto:ruchandani.t...@gmail.com] Sent: Tuesday, February 03, 2015 5:48 AM This patch removes the unused field sent_ts from struct nes_cm_tcp_context. This patch is part of an effort to clean up instances of timekeeping data-types like 'struct timeval' which will overflow on 32-bit systems in year 2038 and beyond. Signed-off-by: Tina Ruchandani ruchandani.t...@gmail.com --- -- 2.2.0.rc0.207.ga3a616c Acked-by: Faisal Latif faisal.la...@intel.com -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] IB: Fix potential mem leak in schedule_nes_timer()
I do not approve this patch. The type field is always set to either NES_TIMER_TYPE_SEND or NES_TIMER_TYPE_CLOSE when schedule_nes_timer() is called. Even if we wanted to make sure the value of type is one or the other, proper patch can be just a if stmt to check the type before new_send allocation. Thanks Faisal -Original Message- From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- ow...@vger.kernel.org] On Behalf Of Jesper Juhl Sent: Monday, February 20, 2012 2:56 PM To: linux-ker...@vger.kernel.org Cc: linux-rdma@vger.kernel.org; Hal Rosenstock; Hefty, Sean; Roland Dreier; Latif, Faisal Subject: [PATCH] IB: Fix potential mem leak in schedule_nes_timer() In drivers/infiniband/hw/nes/nes_cm.c::schedule_nes_timer(), if we do not take the true branch of either the (type == NES_TIMER_TYPE_SEND) or (type == NES_TIMER_TYPE_SEND) 'if' statements (which it looks like we potentially could since that enum can have other values), then we'll leak the memory allocated to 'new_send'. This (admittedly, rather clumsy) patch addresses that issue by turning the two 'if's into 'if' 'else if' and then adding a 'else' branch where we note that we need to free the mem and then later, when we are done with it, does a conditional kfree() based on the bool we set in the 'else' branch. I also removed a redundant variable ('was_timer_set'). Signed-off-by: Jesper Juhl j...@chaosbits.net --- drivers/infiniband/hw/nes/nes_cm.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) Compile tested only. diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index a4972ab..434a25b 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -663,8 +663,8 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, unsigned long flags; struct nes_cm_core *cm_core = cm_node-cm_core; struct nes_timer_entry *new_send; + bool free_new_send = false; int ret = 0; - u32 was_timer_set; new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); if (!new_send) @@ -688,9 +688,7 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, return -EINVAL; } cm_node-recv_entry = new_send; - } - - if (type == NES_TIMER_TYPE_SEND) { + } else if (type == NES_TIMER_TYPE_SEND) { new_send-seq_num = ntohl(tcp_hdr(skb)-seq); atomic_inc(new_send-skb-users); spin_lock_irqsave(cm_node-retrans_list_lock, flags); @@ -714,15 +712,18 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, return ret; } } + } else { + free_new_send = true; } - was_timer_set = timer_pending(cm_core-tcp_timer); - - if (!was_timer_set) { + if (!timer_pending(cm_core-tcp_timer)) { cm_core-tcp_timer.expires = new_send-timetosend; add_timer(cm_core-tcp_timer); } + if (free_new_send) + kfree(new_send); + return ret; } -- 1.7.9.1 -- Jesper Juhl j...@chaosbits.net http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please. -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [patch] RDMA/nes: silence compiler warning
-Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Tuesday, October 18, 2011 12:11 PM To: Latif, Faisal Cc: Dan Carpenter; Hefty, Sean; Hal Rosenstock; linux- r...@vger.kernel.org; kernel-janit...@vger.kernel.org Subject: Re: [patch] RDMA/nes: silence compiler warning On Mon, Oct 17, 2011 at 11:28 AM, Latif, Faisal faisal.la...@intel.com wrote: Yes, We should have used %pI4 for this also. Any chance of you guys going through and converting IP printing to %pI4 in the whole driver? - R. I will get patch out to you to convert the IP printing. Thanks for pointing it out. Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [patch] RDMA/nes: silence compiler warning
Dan Carpenter Wrote: Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 16667c7..b96ec43 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -3189,7 +3189,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) nes_debug(NES_DBG_CM, QP%u, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X, rcv_nxt=0x%08X, snd_nxt=0x%08X, mpa + - private data length=%zu.\n, nesqp-hwqp.qp_id, + private data length=%d.\n, nesqp-hwqp.qp_id, ntohl(cm_id-remote_addr.sin_addr.s_addr), ntohs(cm_id-remote_addr.sin_port), ntohl(cm_id-local_addr.sin_addr.s_addr), Acked-by: Faisal Latif faisal.la...@intel.com N�r��yb�X��ǧv�^�){.n�+{��ٚ�{ay�ʇڙ�,j��f���h���z��w��� ���j:+v���w�j�mzZ+�ݢj��!�i
RE: [patch] RDMA/nes: silence compiler warning
-Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Monday, October 17, 2011 1:15 PM To: Dan Carpenter Cc: Latif, Faisal; Hefty, Sean; Hal Rosenstock; linux- r...@vger.kernel.org; kernel-janit...@vger.kernel.org Subject: Re: [patch] RDMA/nes: silence compiler warning On Mon, Oct 17, 2011 at 12:28 AM, Dan Carpenter dan.carpen...@oracle.com wrote: nes_debug(NES_DBG_CM, QP%u, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X, rcv_nxt=0x%08X, snd_nxt=0x%08X, mpa + - private data length=%zu.\n, nesqp-hwqp.qp_id, + private data length=%d.\n, nesqp-hwqp.qp_id, ntohl(cm_id-remote_addr.sin_addr.s_addr), ntohs(cm_id-remote_addr.sin_port), ntohl(cm_id-local_addr.sin_addr.s_addr), By the way, could this debug message be using %pI4 instead of %08X to print IP addresses? - R. Yes, We should have used %pI4 for this also. Thanks Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/3] RDMA/nes: Support for Packed And Unaligned fpdus
Sorry, we missed it in the patch. Just need to add #define NES_DBG_PAU 0x20 Thanks! Faisal -Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Tuesday, October 11, 2011 11:40 AM To: Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCH 3/3] RDMA/nes: Support for Packed And Unaligned fpdus So as linux-next testing showed, this patch adds uses of NES_DBG_PAU but doesn't define it. Should I add something in drivers/infiniband/hw/nes/nes.h like: #define NES_DBG_PAU0x0010 ? Thanks, Roland -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/3] RDMA/nes: Support for Packed And Unaligned fpdus
Thanks, I will test it again to make sure. Faisal -Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Monday, October 10, 2011 1:05 PM To: Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCH 3/3] RDMA/nes: Support for Packed And Unaligned fpdus Applied, but... --- /dev/null +++ b/drivers/infiniband/hw/nes/nes_mgt.c +void nes_replenish_mgt_rq(struct nes_vnic_mgt *mgtvnic) Most of these functions are only used in nes_mgt.c and can be made static. I fixed that up. + barrier(); barrier() is only a compiler optimization barrier. Does this need to be a full memory barrier to make sure that the CPU and NES see the same thing? (ie wmb() or something?) + u32tmp = (fpdu_info-frags[1].frag_len 16) | fpdu_info-frags[0].frag_len; + set_wqe_32bit_value(cqp_wqe-wqe_words, NES_NIC_SQ_WQE_LENGTH_2_1_IDX, + cpu_to_le32(u32tmp)); set_wqe_32bit_value does the cpu_to_le32() internally -- I assume this will swap twice on big-endian (which I'm sure you never tested). I got rid of this superfluous call here. Please retest my for-next tree and make sure I didn't break anything in my cleanups. - R. -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/3] RDMA/nes: Print ip address for critcal errors
Hi Roland, Sorry for late reply. Yes %pI4 would be a lot cleaner. Do you want me to resubmit this patch again? Thanks Faisal -Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Thursday, October 06, 2011 2:54 PM To: Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCH 2/3] RDMA/nes: Print ip address for critcal errors + printk(KERN_ERR PFX Remote ip addr = %u.%u.%u.%u\n, + rem_addr[3], rem_addr[2], rem_addr[1], rem_addr[0]); Any reason this couldn't use %pI4 and be a lot cleaner? - R. -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/9] IB: nes: convert to SKB paged frag API.
Acked-by: Faisal Latif faisal.la...@intel.com Thanks. --- drivers/infiniband/hw/nes/nes_nic.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH/libnes] Fix build against upstream libibverbs
-Original Message- From: rol...@purestorage.com [mailto:rol...@purestorage.com] On Behalf Of Roland Dreier Sent: Friday, May 06, 2011 1:06 AM To: Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCH/libnes] Fix build against upstream libibverbs On Thu, May 5, 2011 at 3:15 PM, Latif, Faisal faisal.la...@intel.com wrote: Acked-by: Faisal Latif faisal.la...@intel.com Thanks... does this mean you're going to merge it? (I'm assuming that git://git.openfabrics.org/~flatif/libnes.git is the upstream tree for libnes, and that you are the owner -- if someone else is handling libnes, let me know and I will send the patch on to them) I will apply the patch. Thanks, Roland Thanks Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH/libnes] Fix build against upstream libibverbs
Roland Dreier wrote Upstream libibverbs has not merged support for IBV_QPT_RAW_ETH yet. Add a test for the identifier to the configure script, and add #ifdefs to compile raw Ethernet QP support only if libibverbs supports it. Signed-off-by: Roland Dreier rol...@purestorage.com Acked-by: Faisal Latif faisal.la...@intel.com -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[ANNOUNCE] libnes-1.1.1 release
New version of libnes v1.1.1 is available at: http://www.openfabrics.org/downloads/nes/libnes-1.1.1.tar.gz Changes since last release: - Check # of sge posted for posting rcv buffers - Fix for frames too long - Fix handling of RAW QP Error state - Fix handling of frames with VLAN flag set libnes provides a device-specific userspace library for NetEffect Ethernet Server Cluster Adapter for use with the libibverbs library. Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [patch] infiniband: nes_cm: remove unneeded variable
-Original Message- From: Dan Carpenter [mailto:erro...@gmail.com] Sent: Wednesday, September 15, 2010 11:33 AM To: Latif, Faisal Cc: Tung, Chien Tin; Roland Dreier; Or Gerlitz; linux- r...@vger.kernel.org; kernel-janit...@vger.kernel.org Subject: [patch] infiniband: nes_cm: remove unneeded variable Just a small cleanup. The passive_state variable isn't used any more after: dae58728dc RDMA/nes: Fix double CLOSE event indication crash Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 61e0efd..5c8d34c 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -1424,7 +1424,6 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, This is fine. Thanks Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] RDMA/nes: double CLOSE event indication crash
-Original Message- From: Or Gerlitz [mailto:ogerl...@voltaire.com] Sent: Sunday, August 15, 2010 12:41 AM To: Latif, Faisal Cc: Roland Dreier; linux-rdma@vger.kernel.org Subject: Re: [PATCH] RDMA/nes: double CLOSE event indication crash Faisal Latif wrote: During a stress testing in a large cluster, multiple close event is detected and BUG() is hit in core. The cause is [...] Do you refer to the core of the IB stack? if not, to whose core? Or. Hi Or BUG() was in iw_cm.ko in its close handler mentioned as core in my email and caused by iw_nes.ko. Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics
-Original Message- From: Roland Dreier [mailto:rdre...@cisco.com] Sent: Wednesday, July 14, 2010 3:31 PM To: Latif, Faisal; Tung, Chien Tin; linux-rdma@vger.kernel.org Subject: [PATCH/RFC] RDMA/nes: Rewrite expression to avoid undefined semantics Change code like x = expr(++x) that assigns to x twice without a sequence point in between to the intended (and well-defined) x = expr(x + 1) Signed-off-by: Roland Dreier rola...@cisco.com --- I'll queue this for 2.6.36 unless someone objects. This is fine. Thanks Faisal -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] rdma/nes: set assume_alligned_header bit
That will be fine. Thanks Faisal -Original Message- From: Roland Dreier [mailto:rdre...@cisco.com] Sent: Friday, February 19, 2010 3:18 PM To: Latif, Faisal Cc: linux-rdma@vger.kernel.org Subject: Re: [PATCH] rdma/nes: set assume_alligned_header bit nesqp-nesqp_context-ird_ord_sizes = cpu_to_le32(NES_QPCONTEXT_ORDIRD_ALSMM | u32)nesadapter-max_irrq_wr) NES_QPCONTEXT_ORDIRD_IRDSIZE_SHIFT) NES_QPCONTEXT_ORDIRD_IRDSIZE_MASK)); + nesqp-nesqp_context-ird_ord_sizes |= cpu_to_le32(NES_QPCONTEXT_ORDIRD_AAH); I think I would just combine this into the existing assignment (which could also probably be formatted better but I'm not worrying about this), and write the whole thing as: nesqp-nesqp_context-ird_ord_sizes = cpu_to_le32(NES_QPCONTEXT_ORDIRD_ALSMM | NES_QPCONTEXT_ORDIRD_AAH | u32)nesadapter-max_irrq_wr) NES_QPCONTEXT_ORDIRD_IRDSIZE_SHIFT) NES_QPCONTEXT_ORDIRD_IRDSIZE_MASK)); -- Roland Dreier rola...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/index.html -- To unsubscribe from this list: send the line unsubscribe linux-rdma in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html