Skip to content

Commit 1b984e3

Browse files
William Kucharskivijay-suman
authored andcommitted
Revert "selftests/net: reap zerocopy completions passed up as ancillary data."
This reverts commit 6f3899e to remove test code related to a feature that is not supported in UEK's RDS. Orabug: 33863259 Signed-off-by: William Kucharski <[email protected]> Reviewed-by: Gerd Rausch <[email protected]> Orabug: 33863259 LUCI => v6.10-rc7 Conflict: tools/testing/selftests/net/msg_zerocopy.c - Upstream addition of line of code to do_recv_completions() prevented clean application of patch - Additional usage of do_recv_remaining_completions() needed to be reverted to UEK syntax Signed-off-by: William Kucharski <[email protected]> Reviewed-by: Gerd Rausch <[email protected]>
1 parent 5d72dcf commit 1b984e3

File tree

1 file changed

+9
-58
lines changed

1 file changed

+9
-58
lines changed

tools/testing/selftests/net/msg_zerocopy.c

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -346,53 +346,7 @@ static int do_setup_tx(int domain, int type, int protocol)
346346
return fd;
347347
}
348348

349-
static uint32_t do_process_zerocopy_cookies(struct rds_zcopy_cookies *ck)
350-
{
351-
int i;
352-
353-
if (ck->num > RDS_MAX_ZCOOKIES)
354-
error(1, 0, "Returned %d cookies, max expected %d\n",
355-
ck->num, RDS_MAX_ZCOOKIES);
356-
for (i = 0; i < ck->num; i++)
357-
if (cfg_verbose >= 2)
358-
fprintf(stderr, "%d\n", ck->cookies[i]);
359-
return ck->num;
360-
}
361-
362-
static bool do_recvmsg_completion(int fd)
363-
{
364-
char cmsgbuf[CMSG_SPACE(sizeof(struct rds_zcopy_cookies))];
365-
struct rds_zcopy_cookies *ck;
366-
struct cmsghdr *cmsg;
367-
struct msghdr msg;
368-
bool ret = false;
369-
370-
memset(&msg, 0, sizeof(msg));
371-
msg.msg_control = cmsgbuf;
372-
msg.msg_controllen = sizeof(cmsgbuf);
373-
374-
if (recvmsg(fd, &msg, MSG_DONTWAIT))
375-
return ret;
376-
377-
if (msg.msg_flags & MSG_CTRUNC)
378-
error(1, errno, "recvmsg notification: truncated");
379-
380-
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
381-
if (cmsg->cmsg_level == SOL_RDS &&
382-
cmsg->cmsg_type == RDS_CMSG_ZCOPY_COMPLETION) {
383-
384-
ck = (struct rds_zcopy_cookies *)CMSG_DATA(cmsg);
385-
completions += do_process_zerocopy_cookies(ck);
386-
ret = true;
387-
break;
388-
}
389-
error(0, 0, "ignoring cmsg at level %d type %d\n",
390-
cmsg->cmsg_level, cmsg->cmsg_type);
391-
}
392-
return ret;
393-
}
394-
395-
static bool do_recv_completion(int fd, int domain)
349+
static bool do_recv_completion(int fd)
396350
{
397351
struct sock_extended_err *serr;
398352
struct msghdr msg = {};
@@ -401,9 +355,6 @@ static bool do_recv_completion(int fd, int domain)
401355
int ret, zerocopy;
402356
char control[100];
403357

404-
if (domain == PF_RDS)
405-
return do_recvmsg_completion(fd);
406-
407358
msg.msg_control = control;
408359
msg.msg_controllen = sizeof(control);
409360

@@ -460,21 +411,21 @@ static bool do_recv_completion(int fd, int domain)
460411
}
461412

462413
/* Read all outstanding messages on the errqueue */
463-
static void do_recv_completions(int fd, int domain)
414+
static void do_recv_completions(int fd)
464415
{
465-
while (do_recv_completion(fd, domain)) {}
416+
while (do_recv_completion(fd)) {}
466417
sends_since_notify = 0;
467418
}
468419

469420
/* Wait for all remaining completions on the errqueue */
470-
static void do_recv_remaining_completions(int fd, int domain)
421+
static void do_recv_remaining_completions(int fd)
471422
{
472423
int64_t tstop = gettimeofday_ms() + cfg_waittime_ms;
473424

474425
while (completions < expected_completions &&
475426
gettimeofday_ms() < tstop) {
476-
if (do_poll(fd, domain == PF_RDS ? POLLIN : POLLERR))
477-
do_recv_completions(fd, domain);
427+
if (do_poll(fd, POLLERR))
428+
do_recv_completions(fd);
478429
}
479430

480431
if (completions < expected_completions)
@@ -554,17 +505,17 @@ static void do_tx(int domain, int type, int protocol)
554505
do_sendmsg(fd, &msg, cfg_zerocopy, domain);
555506

556507
if (cfg_zerocopy && sends_since_notify >= cfg_notification_limit)
557-
do_recv_completions(fd, domain);
508+
do_recv_completions(fd);
558509

559510
while (!do_poll(fd, POLLOUT)) {
560511
if (cfg_zerocopy)
561-
do_recv_completions(fd, domain);
512+
do_recv_completions(fd);
562513
}
563514

564515
} while (gettimeofday_ms() < tstop);
565516

566517
if (cfg_zerocopy)
567-
do_recv_remaining_completions(fd, domain);
518+
do_recv_remaining_completions(fd);
568519

569520
if (close(fd))
570521
error(1, errno, "close");

0 commit comments

Comments
 (0)