* [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
@ 2019-11-14 18:59 Jan Kiszka
2019-11-15 9:37 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2019-11-14 18:59 UTC (permalink / raw)
To: Xenomai
From: Jan Kiszka <jan.kiszka@siemens.com>
This is in line with Linux behavior.
We likely still miss an equivalent to sk_err in recvmmsg, though.
Reported-by: Lange Norbert <norbert.lange@andritz.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
kernel/cobalt/rtdm/fd.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/kernel/cobalt/rtdm/fd.c b/kernel/cobalt/rtdm/fd.c
index 0a1c6e44ed..5b2c3834da 100644
--- a/kernel/cobalt/rtdm/fd.c
+++ b/kernel/cobalt/rtdm/fd.c
@@ -734,14 +734,12 @@ int __rtdm_fd_recvmmsg(int ufd, void __user *u_msgvec, unsigned int vlen,
xnlock_put_irqrestore(&nklock, s);
}
- if (datagrams > 0 &&
- (ret == 0 || ret == -ETIMEDOUT || ret == -EWOULDBLOCK)) {
- /* NOTE: SO_ERROR should be honored for other errors. */
- rtdm_fd_put(fd);
- return datagrams;
- }
fail:
rtdm_fd_put(fd);
+
+ if (datagrams > 0)
+ ret = datagrams;
+
out:
trace_cobalt_fd_recvmmsg_status(current, fd, ufd, ret);
@@ -826,13 +824,11 @@ int __rtdm_fd_sendmmsg(int ufd, void __user *u_msgvec, unsigned int vlen,
datagrams++;
}
- if (datagrams > 0 && (ret == 0 || ret == -EWOULDBLOCK)) {
- /* NOTE: SO_ERROR should be honored for other errors. */
- rtdm_fd_put(fd);
- return datagrams;
- }
-
rtdm_fd_put(fd);
+
+ if (datagrams > 0)
+ ret = datagrams;
+
out:
trace_cobalt_fd_sendmmsg_status(current, fd, ufd, ret);
--
2.16.4
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
2019-11-14 18:59 [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets Jan Kiszka
@ 2019-11-15 9:37 ` Philippe Gerum
2019-11-15 9:39 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2019-11-15 9:37 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
On 11/14/19 7:59 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This is in line with Linux behavior.
>
> We likely still miss an equivalent to sk_err in recvmmsg, though.
Ack. Tracing on early exit due to null vlen in sendmmsg() is still missing; having this might help in debugging issue(s) at call site.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
2019-11-15 9:37 ` Philippe Gerum
@ 2019-11-15 9:39 ` Philippe Gerum
2019-11-15 9:42 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2019-11-15 9:39 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
On 11/15/19 10:37 AM, Philippe Gerum via Xenomai wrote:
> On 11/14/19 7:59 PM, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> This is in line with Linux behavior.
>>
>> We likely still miss an equivalent to sk_err in recvmmsg, though.
>
> Ack. Tracing on early exit due to null vlen in sendmmsg() is still missing; having this might help in debugging issue(s) at call site.
>
Likewise in recvmmsg().
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
2019-11-15 9:39 ` Philippe Gerum
@ 2019-11-15 9:42 ` Jan Kiszka
2019-11-15 12:42 ` Lange Norbert
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2019-11-15 9:42 UTC (permalink / raw)
To: Philippe Gerum, Xenomai
On 15.11.19 10:39, Philippe Gerum wrote:
> On 11/15/19 10:37 AM, Philippe Gerum via Xenomai wrote:
>> On 11/14/19 7:59 PM, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> This is in line with Linux behavior.
>>>
>>> We likely still miss an equivalent to sk_err in recvmmsg, though.
>>
>> Ack. Tracing on early exit due to null vlen in sendmmsg() is still missing; having this might help in debugging issue(s) at call site.
>>
>
> Likewise in recvmmsg().
>
Yes, I'll simply remove the "vlan == 0" optimization.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
2019-11-15 9:42 ` Jan Kiszka
@ 2019-11-15 12:42 ` Lange Norbert
2019-11-15 12:44 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Lange Norbert @ 2019-11-15 12:42 UTC (permalink / raw)
To: Jan Kiszka, Philippe Gerum, Xenomai (xenomai@xenomai.org)
Hello,
Just for consideration, If you can pass both error value and # of successfully sent packets out of the kernel function,
perhaps you could return the # (if > 0) and still set errno in case of an (real) error?
It would be somewhat different to Linux, but that would not be the only difference (like theres no way to block until all msgs are sent/received).
Norbert
> -----Original Message-----
> From: Xenomai <xenomai-bounces@xenomai.org> On Behalf Of Jan Kiszka
> via Xenomai
> Sent: Freitag, 15. November 2019 10:43
> To: Philippe Gerum <rpm@xenomai.org>; Xenomai
> <xenomai@xenomai.org>
> Subject: Re: [PATCH] rtdm: Do not return an error from send/recvmmsg if
> there are packets
>
> NON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR
> ATTACHMENTS.
>
>
> On 15.11.19 10:39, Philippe Gerum wrote:
> > On 11/15/19 10:37 AM, Philippe Gerum via Xenomai wrote:
> >> On 11/14/19 7:59 PM, Jan Kiszka wrote:
> >>> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>>
> >>> This is in line with Linux behavior.
> >>>
> >>> We likely still miss an equivalent to sk_err in recvmmsg, though.
> >>
> >> Ack. Tracing on early exit due to null vlen in sendmmsg() is still missing;
> having this might help in debugging issue(s) at call site.
> >>
> >
> > Likewise in recvmmsg().
> >
>
> Yes, I'll simply remove the "vlan == 0" optimization.
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate
> Competence Center Embedded Linux
________________________________
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
ANDRITZ HYDRO GmbH
Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation
Firmensitz/ Registered seat: Wien
Firmenbuchgericht/ Court of registry: Handelsgericht Wien
Firmenbuchnummer/ Company registration: FN 61833 g
DVR: 0605077
UID-Nr.: ATU14756806
Thank You
________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets
2019-11-15 12:42 ` Lange Norbert
@ 2019-11-15 12:44 ` Jan Kiszka
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2019-11-15 12:44 UTC (permalink / raw)
To: Lange Norbert, Philippe Gerum, Xenomai (xenomai@xenomai.org)
On 15.11.19 13:42, Lange Norbert wrote:
> Hello,
>
> Just for consideration, If you can pass both error value and # of successfully sent packets out of the kernel function,
> perhaps you could return the # (if > 0) and still set errno in case of an (real) error?
>
> It would be somewhat different to Linux, but that would not be the only difference (like theres no way to block until all msgs are sent/received).
I rather prefer finding and fixing what differentiates us from the kernel.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-11-15 12:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 18:59 [PATCH] rtdm: Do not return an error from send/recvmmsg if there are packets Jan Kiszka
2019-11-15 9:37 ` Philippe Gerum
2019-11-15 9:39 ` Philippe Gerum
2019-11-15 9:42 ` Jan Kiszka
2019-11-15 12:42 ` Lange Norbert
2019-11-15 12:44 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.