[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210211420.ppBHDTBi-lkp@intel.com>
Date: Fri, 21 Oct 2022 15:03:08 +0800
From: kernel test robot <lkp@...el.com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [isilence:zc-filter-socket 10/11] io_uring/net.c:1059:14: error:
implicit declaration of function 'test_flag'
tree: https://github.com/isilence/linux zc-filter-socket
head: 914e55353240af9da430b1bef8f0d19c550ed972
commit: 4c66110ace4c079ba09ac53e4f04fd633f878883 [10/11] io_uring/net: fail zc send when unsupported by socket
config: x86_64-randconfig-a013
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/isilence/linux/commit/4c66110ace4c079ba09ac53e4f04fd633f878883
git remote add isilence https://github.com/isilence/linux
git fetch --no-tags isilence zc-filter-socket
git checkout 4c66110ace4c079ba09ac53e4f04fd633f878883
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
io_uring/net.c: In function 'io_send_zc':
>> io_uring/net.c:1059:14: error: implicit declaration of function 'test_flag' [-Werror=implicit-function-declaration]
1059 | if (!test_flag(SOCK_SUPPORT_ZC, &sock->flags))
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +/test_flag +1059 io_uring/net.c
1045
1046 int io_send_zc(struct io_kiocb *req, unsigned int issue_flags)
1047 {
1048 struct sockaddr_storage __address;
1049 struct io_sr_msg *zc = io_kiocb_to_cmd(req, struct io_sr_msg);
1050 struct msghdr msg;
1051 struct iovec iov;
1052 struct socket *sock;
1053 unsigned msg_flags;
1054 int ret, min_ret = 0;
1055
1056 sock = sock_from_file(req->file);
1057 if (unlikely(!sock))
1058 return -ENOTSOCK;
> 1059 if (!test_flag(SOCK_SUPPORT_ZC, &sock->flags))
1060 return -EOPNOTSUPP;
1061
1062 msg.msg_name = NULL;
1063 msg.msg_control = NULL;
1064 msg.msg_controllen = 0;
1065 msg.msg_namelen = 0;
1066
1067 if (zc->addr) {
1068 if (req_has_async_data(req)) {
1069 struct io_async_msghdr *io = req->async_data;
1070
1071 msg.msg_name = &io->addr;
1072 } else {
1073 ret = move_addr_to_kernel(zc->addr, zc->addr_len, &__address);
1074 if (unlikely(ret < 0))
1075 return ret;
1076 msg.msg_name = (struct sockaddr *)&__address;
1077 }
1078 msg.msg_namelen = zc->addr_len;
1079 }
1080
1081 if (!(req->flags & REQ_F_POLLED) &&
1082 (zc->flags & IORING_RECVSEND_POLL_FIRST))
1083 return io_setup_async_addr(req, &__address, issue_flags);
1084
1085 if (zc->flags & IORING_RECVSEND_FIXED_BUF) {
1086 ret = io_import_fixed(WRITE, &msg.msg_iter, req->imu,
1087 (u64)(uintptr_t)zc->buf, zc->len);
1088 if (unlikely(ret))
1089 return ret;
1090 msg.sg_from_iter = io_sg_from_iter;
1091 } else {
1092 ret = import_single_range(WRITE, zc->buf, zc->len, &iov,
1093 &msg.msg_iter);
1094 if (unlikely(ret))
1095 return ret;
1096 ret = io_notif_account_mem(zc->notif, zc->len);
1097 if (unlikely(ret))
1098 return ret;
1099 msg.sg_from_iter = io_sg_from_iter_iovec;
1100 }
1101
1102 msg_flags = zc->msg_flags | MSG_ZEROCOPY;
1103 if (issue_flags & IO_URING_F_NONBLOCK)
1104 msg_flags |= MSG_DONTWAIT;
1105 if (msg_flags & MSG_WAITALL)
1106 min_ret = iov_iter_count(&msg.msg_iter);
1107
1108 msg.msg_flags = msg_flags;
1109 msg.msg_ubuf = &io_notif_to_data(zc->notif)->uarg;
1110 ret = sock_sendmsg(sock, &msg);
1111
1112 if (unlikely(ret < min_ret)) {
1113 if (ret == -EAGAIN && (issue_flags & IO_URING_F_NONBLOCK))
1114 return io_setup_async_addr(req, &__address, issue_flags);
1115
1116 if (ret > 0 && io_net_retry(sock, msg.msg_flags)) {
1117 zc->len -= ret;
1118 zc->buf += ret;
1119 zc->done_io += ret;
1120 req->flags |= REQ_F_PARTIAL_IO;
1121 return io_setup_async_addr(req, &__address, issue_flags);
1122 }
1123 if (ret == -ERESTARTSYS)
1124 ret = -EINTR;
1125 req_set_fail(req);
1126 }
1127
1128 if (ret >= 0)
1129 ret += zc->done_io;
1130 else if (zc->done_io)
1131 ret = zc->done_io;
1132
1133 /*
1134 * If we're in io-wq we can't rely on tw ordering guarantees, defer
1135 * flushing notif to io_send_zc_cleanup()
1136 */
1137 if (!(issue_flags & IO_URING_F_UNLOCKED)) {
1138 io_notif_flush(zc->notif);
1139 req->flags &= ~REQ_F_NEED_CLEANUP;
1140 }
1141 io_req_set_res(req, ret, IORING_CQE_F_MORE);
1142 return IOU_OK;
1143 }
1144
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (115859 bytes)
Powered by blists - more mailing lists