From patchwork Thu Nov 9 11:10:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 10050793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 38ECD60381 for ; Thu, 9 Nov 2017 11:11:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A46B2AA56 for ; Thu, 9 Nov 2017 11:11:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F3292AA55; Thu, 9 Nov 2017 11:11:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE9DC2AA55 for ; Thu, 9 Nov 2017 11:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753972AbdKILLG (ORCPT ); Thu, 9 Nov 2017 06:11:06 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:47858 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbdKILLG (ORCPT ); Thu, 9 Nov 2017 06:11:06 -0500 Received: by mail-wm0-f65.google.com with SMTP id b14so1008260wme.2 for ; Thu, 09 Nov 2017 03:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z6+1EZazLSwpR9t94Y1MAxAuxKHIsE7pFSyCWcJLH+Q=; b=cIXXktPTFaZofjly6nduW7UqUwkaZIAM2T6nQ7rf1ok3aG2uCqJMKktrRMbsI3437s G2ans1AkCRhByqC6TXbFwvMouPSMNINDPiQXrCzqHBBHz4prUJ8Za3Qsi64Ttu4yUH1T k6kdlM1Qmm2vhSydQA3+GLQ1/lbEWrDcLozcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z6+1EZazLSwpR9t94Y1MAxAuxKHIsE7pFSyCWcJLH+Q=; b=H6+QwYTQgbLcdIoVLAMfqb4BZKH6du1chNHwDfajScvte3uM3SRQXA4z6L/CMeZ/RZ d1N0WrYfKcVIlO268Z87HZOFsdIsXjOSoyYDyUsY8jTStTUFbhAKqEfaYtmJAvB+Hetv jpNUptPlfpmb3HmXhtLSG8Wh8iab05cE9mSpW5TmQh3J7JExOm5UxQLUSJ2p/BkQnRyM gEkb3Jj9scfjecd4a5D6C7zMnRi7ZJiGT40Ry+v5J4i3eIt88u96r60TFmCUXjf8w7iI aqaG5S3Cvrmjn2s/jZGG7l4ipIayu6gg+YAmwXrS8kVPPrgcDXafYOSrWyQA2sIdBFhQ cfFA== X-Gm-Message-State: AJaThX5ty7hX9bD02NO6B54gSvyqLj1iKeZC1dedgorOxaAOn48ZQIJ5 T3TGQz4UI/ZMavQgl2wyQjwYE3Rr X-Google-Smtp-Source: AGs4zMa5Q5NL7JArJt8Z+LjzBaj1In9fT5xc6fvLsJe2MYbLAiplYqIb5x41O8O3SIjDAW7SNNc3Ow== X-Received: by 10.28.141.211 with SMTP id p202mr34222wmd.61.1510225864847; Thu, 09 Nov 2017 03:11:04 -0800 (PST) Received: from neo00-el73.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t14sm5841718wmc.46.2017.11.09.03.11.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 03:11:04 -0800 (PST) From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, leon@kernel.org, Devesh Sharma Subject: [PATCH v1 rdma-core 2/2] bnxt_re/lib: increment psn in case of 0 length packets Date: Thu, 9 Nov 2017 06:10:40 -0500 Message-Id: <1510225840-20034-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1510225840-20034-1-git-send-email-devesh.sharma@broadcom.com> References: <1510225840-20034-1-git-send-email-devesh.sharma@broadcom.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If application posts a 0 length packet, post send routine is skipping to increment the psn number. This will cause PSN number to go out of sync and eventually connection would terminate due to sequence error. post_send routine must increment the psn number by 1 even for zero length packets. Signed-off-by: Devesh Sharma --- providers/bnxt_re/verbs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 4d9b044..9d4e02b 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -1048,6 +1048,8 @@ static void bnxt_re_fill_psns(struct bnxt_re_qp *qp, struct bnxt_re_psns *psns, pkt_cnt = (len / qp->mtu); if (len % qp->mtu) pkt_cnt++; + if (len == 0) + pkt_cnt = 1; nxt_psn = ((qp->sq_psn + pkt_cnt) & BNXT_RE_PSNS_NPSN_MASK); psns->flg_npsn = htole32(nxt_psn); qp->sq_psn = nxt_psn;