From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>,
Santosh Shilimkar <santosh.shilimkar@oracle.com>,
Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.9 007/104] RDS: RDMA: Fix the composite message user notification
Date: Fri, 6 Oct 2017 10:50:45 +0200 [thread overview]
Message-ID: <20171006083841.810570671@linuxfoundation.org> (raw)
In-Reply-To: <20171006083840.743659740@linuxfoundation.org>
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
[ Upstream commit 941f8d55f6d613a460a5e080d25a38509f45eb75 ]
When application sends an RDS RDMA composite message consist of
RDMA transfer to be followed up by non RDMA payload, it expect to
be notified *only* when the full message gets delivered. RDS RDMA
notification doesn't behave this way though.
Thanks to Venkat for debug and root casuing the issue
where only first part of the message(RDMA) was
successfully delivered but remainder payload delivery failed.
In that case, application should not be notified with
a false positive of message delivery success.
Fix this case by making sure the user gets notified only after
the full message delivery.
Reviewed-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/ib_send.c | 25 +++++++++++++++----------
net/rds/rdma.c | 10 ++++++++++
net/rds/rds.h | 1 +
net/rds/send.c | 4 +++-
4 files changed, 29 insertions(+), 11 deletions(-)
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -69,16 +69,6 @@ static void rds_ib_send_complete(struct
complete(rm, notify_status);
}
-static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
- struct rm_data_op *op,
- int wc_status)
-{
- if (op->op_nents)
- ib_dma_unmap_sg(ic->i_cm_id->device,
- op->op_sg, op->op_nents,
- DMA_TO_DEVICE);
-}
-
static void rds_ib_send_unmap_rdma(struct rds_ib_connection *ic,
struct rm_rdma_op *op,
int wc_status)
@@ -139,6 +129,21 @@ static void rds_ib_send_unmap_atomic(str
rds_ib_stats_inc(s_ib_atomic_fadd);
}
+static void rds_ib_send_unmap_data(struct rds_ib_connection *ic,
+ struct rm_data_op *op,
+ int wc_status)
+{
+ struct rds_message *rm = container_of(op, struct rds_message, data);
+
+ if (op->op_nents)
+ ib_dma_unmap_sg(ic->i_cm_id->device,
+ op->op_sg, op->op_nents,
+ DMA_TO_DEVICE);
+
+ if (rm->rdma.op_active && rm->data.op_notify)
+ rds_ib_send_unmap_rdma(ic, &rm->rdma, wc_status);
+}
+
/*
* Unmap the resources associated with a struct send_work.
*
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -626,6 +626,16 @@ int rds_cmsg_rdma_args(struct rds_sock *
}
op->op_notifier->n_user_token = args->user_token;
op->op_notifier->n_status = RDS_RDMA_SUCCESS;
+
+ /* Enable rmda notification on data operation for composite
+ * rds messages and make sure notification is enabled only
+ * for the data operation which follows it so that application
+ * gets notified only after full message gets delivered.
+ */
+ if (rm->data.op_sg) {
+ rm->rdma.op_notify = 0;
+ rm->data.op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME);
+ }
}
/* The cookie contains the R_Key of the remote memory region, and
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -414,6 +414,7 @@ struct rds_message {
} rdma;
struct rm_data_op {
unsigned int op_active:1;
+ unsigned int op_notify:1;
unsigned int op_nents;
unsigned int op_count;
unsigned int op_dmasg;
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -475,12 +475,14 @@ void rds_rdma_send_complete(struct rds_m
struct rm_rdma_op *ro;
struct rds_notifier *notifier;
unsigned long flags;
+ unsigned int notify = 0;
spin_lock_irqsave(&rm->m_rs_lock, flags);
+ notify = rm->rdma.op_notify | rm->data.op_notify;
ro = &rm->rdma;
if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) &&
- ro->op_active && ro->op_notify && ro->op_notifier) {
+ ro->op_active && notify && ro->op_notifier) {
notifier = ro->op_notifier;
rs = rm->m_rs;
sock_hold(rds_rs_to_sk(rs));
next prev parent reply other threads:[~2017-10-06 8:53 UTC|newest]
Thread overview: 143+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 8:50 [PATCH 4.9 000/104] 4.9.54-stable review Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 001/104] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 002/104] drm: bridge: add DT bindings for TI ths8135 Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 003/104] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 005/104] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 006/104] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Greg Kroah-Hartman
2017-10-06 8:50 ` Greg Kroah-Hartman [this message]
2017-10-06 8:50 ` [PATCH 4.9 008/104] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 009/104] MIPS: Ensure bss section ends on a long-aligned address Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 010/104] MIPS: fix mem=X@Y commandline processing Greg Kroah-Hartman
2017-10-06 9:10 ` Mathieu Malaterre
2017-10-06 9:18 ` Greg Kroah-Hartman
2017-10-06 9:21 ` Mathieu Malaterre
2017-10-06 8:50 ` [PATCH 4.9 011/104] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 012/104] MIPS: ralink: Fix a typo in the pinmux setup Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 013/104] MIPS: ralink: Fix incorrect assignment on ralink_soc Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 014/104] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 015/104] scsi: be2iscsi: Add checks to validate CID alloc/free Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 016/104] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 017/104] igb: re-assign hw address pointer on reset after PCI error Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 018/104] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 019/104] reset: ti_syscon: fix a ti_syscon_reset_status issue Greg Kroah-Hartman
2017-10-06 8:50 ` [PATCH 4.9 021/104] clk/axs10x: Clear init field in driver probe Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 022/104] usb: make the MTK XHCI driver compile for older MIPS SoCs Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 023/104] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 024/104] iio: adc: imx25-gcq: Fix module autoload Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 025/104] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 026/104] iio: adc: hx711: Add DT binding for avia,hx711 Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 027/104] IB/rxe: Add a runtime check in alloc_index() Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 028/104] IB/rxe: Fix a MR reference leak in check_rkey() Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 029/104] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 030/104] drm/i915/psr: disable psr2 for resolution greater than 32X20 Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 031/104] serial: 8250: moxa: Store num_ports in brd Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 032/104] tty: goldfish: Fix a parameter of a call to free_irq Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 033/104] serial: 8250_port: Remove dangerous pr_debug() Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 034/104] IB/ipoib: Fix deadlock over vlan_mutex Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 035/104] IB/ipoib: rtnl_unlock can not come after free_netdev Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 036/104] IB/ipoib: Replace list_del of the neigh->list with list_del_init Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 037/104] arm: dts: mt2701: Add subsystem clock controller device nodes Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 038/104] drm/amdkfd: fix improper return value on error Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 039/104] USB: serial: mos7720: fix control-message error handling Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 040/104] USB: serial: mos7840: " Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 041/104] sfc: get PIO buffer size from the NIC Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 042/104] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 043/104] partitions/efi: Fix integer overflow in GPT size calculation Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 044/104] ASoC: dapm: handle probe deferrals Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 045/104] audit: log 32-bit socketcalls Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 046/104] ath10k: prevent sta pointer rcu violation Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 047/104] spi: pxa2xx: Add support for Intel Gemini Lake Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 048/104] iommu/arm-smmu: Set privileged attribute to default instead of unprivileged Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 049/104] usb: chipidea: vbus event may exist before starting gadget Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 051/104] ASoC: dapm: fix some pointer error handling Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 052/104] drm: mali-dp: Fix destination size handling when rotating Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 053/104] drm: mali-dp: Fix transposed horizontal/vertical flip Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 054/104] HID: wacom: release the resources before leaving despite devm Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 055/104] MIPS: Lantiq: Fix another request_mem_region() return code check Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 056/104] mips: ath79: clock:- Unmap region obtained by of_iomap Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 057/104] lkdtm: Fix Oops when unloading the module Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 058/104] net: core: Prevent from dereferencing null pointer when releasing SKB Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 059/104] net/packet: check length in getsockopt() called with PACKET_HDRLEN Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 060/104] team: fix memory leaks Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 062/104] udp: disable inner UDP checksum offloads in IPsec case Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 063/104] net: dsa: b53: Include IMP/CPU port in dumb forwarding mode Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 064/104] qed: Fix possible system hang in the dcbnl-getdcbx() path Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 065/104] mmc: sdio: fix alignment issue in struct sdio_func Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 066/104] bridge: netlink: register netdevice before executing changelink Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 067/104] Btrfs: fix segmentation fault when doing dio read Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 068/104] Btrfs: fix potential use-after-free for cloned bio Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 069/104] sata_via: Enable hotplug only on VT6421 Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 070/104] hugetlbfs: initialize shared policy as part of inode allocation Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 071/104] kasan: do not sanitize kexec purgatory Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 073/104] netfilter: invoke synchronize_rcu after set the _hook_ to NULL Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 074/104] MIPS: IRQ Stack: Unwind IRQ stack onto task stack Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 075/104] iommu/exynos: Block SYSMMU while invalidating FLPD cache Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 076/104] [media] exynos-gsc: Do not swap cb/cr for semi planar formats Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 077/104] MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 078/104] nvme-rdma: handle cpu unplug when re-establishing the controller Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 079/104] netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 080/104] parisc: perf: Fix potential NULL pointer dereference Greg Kroah-Hartman
2017-10-06 8:51 ` [PATCH 4.9 081/104] nfs: make nfs4_cb_sv_ops static Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 082/104] ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 083/104] cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set() Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 084/104] x86/acpi: Restore the order of CPU IDs Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 085/104] iommu/io-pgtable-arm: Check for leaf entry before dereferencing it Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 086/104] arm64: kasan: avoid bad virt_to_pfn() Greg Kroah-Hartman
2017-10-06 18:13 ` Mark Rutland
2017-10-07 3:10 ` Levin, Alexander (Sasha Levin)
2017-10-08 15:20 ` Mark Rutland
2017-10-09 9:14 ` Mark Brown
2017-10-09 10:06 ` Will Deacon
2017-10-09 11:42 ` Greg Kroah-Hartman
2017-10-09 14:00 ` Levin, Alexander (Sasha Levin)
2017-10-09 15:47 ` Mark Brown
2017-10-09 16:23 ` Levin, Alexander (Sasha Levin)
2017-10-09 16:27 ` Will Deacon
2017-10-09 16:30 ` Mark Brown
2017-10-09 17:29 ` Levin, Alexander (Sasha Levin)
2017-10-09 14:10 ` Mark Brown
2017-10-09 16:33 ` Laura Abbott
2017-10-10 17:22 ` Levin, Alexander (Sasha Levin)
2017-10-10 17:31 ` Julia Lawall
2017-11-15 17:43 ` Josh Hunt
2017-11-16 23:13 ` alexander.levin
2017-11-16 23:24 ` Josh Hunt
2017-11-17 8:06 ` Greg Kroah-Hartman
2017-10-07 8:42 ` Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 087/104] mm/cgroup: avoid panic when init with low memory Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 088/104] rds: ib: add error handle Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 089/104] md/raid10: submit bio directly to replacement disk Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 090/104] netfilter: nf_tables: set pktinfo->thoff at AH header if found Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 091/104] i2c: meson: fix wrong variable usage in meson_i2c_put_data Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 092/104] xfs: remove kmem_zalloc_greedy Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 093/104] ASoC: wm_adsp: Return an error on write to a disabled volatile control Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 094/104] libata: transport: Remove circular dependency at free time Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 095/104] ARM: dts: BCM5301X: Fix memory start address Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 096/104] tools/power turbostat: bugfix: GFXMHz column not changing Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 097/104] IB/qib: fix false-postive maybe-uninitialized warning Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 099/104] ASoC: rt5514: fix gcc-7 warning Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 100/104] ASoC: rt5659: drop double const Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 101/104] ASoC: rt5660: remove " Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 102/104] ALSA: au88x0: avoid theoretical uninitialized access Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 103/104] [media] ttpci: address stringop overflow warning Greg Kroah-Hartman
2017-10-06 8:52 ` [PATCH 4.9 104/104] s390/mm: make pmdp_invalidate() do invalidation only Greg Kroah-Hartman
2017-10-06 14:08 ` [PATCH 4.9 000/104] 4.9.54-stable review Guenter Roeck
2017-10-07 9:38 ` Greg Kroah-Hartman
2017-10-06 18:06 ` Shuah Khan
2017-10-07 9:39 ` Greg Kroah-Hartman
2017-10-07 14:44 ` Guenter Roeck
2017-10-08 7:20 ` Greg Kroah-Hartman
2017-10-07 16:56 ` Tom Gall
2017-10-08 7:23 ` Greg Kroah-Hartman
2017-10-09 20:37 ` Tom Gall
2017-10-10 7:11 ` Greg Kroah-Hartman
2017-10-10 15:23 ` Dan Rue
2017-10-10 15:33 ` Greg Kroah-Hartman
2017-10-10 15:54 ` Dan Rue
2017-10-10 16:05 ` Greg Kroah-Hartman
2017-10-10 23:11 ` Mark Brown
2017-10-10 15:23 ` Tom Gall
2017-10-10 15:33 ` Greg Kroah-Hartman
2017-10-10 18:39 ` Guenter Roeck
2017-10-10 18:50 ` Greg Kroah-Hartman
2017-10-10 23:14 ` Mark Brown
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=20171006083841.810570671@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alexander.levin@verizon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=santosh.shilimkar@oracle.com \
--cc=stable@vger.kernel.org \
--cc=venkat.x.venkatsubra@oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).