Re: [RFC PATCH 3/3] drivers/net/virtio_net: Added RSS hash report.
by kernel test robot
Hi Andrew,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on net-next/master net/master linus/master v5.14-rc6 next-20210818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Andrew-Melnychenko/drivers-net-v...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: i386-randconfig-a015-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/2205ca0b751f734cf3ea53258d9b8e3f3...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andrew-Melnychenko/drivers-net-virtio_net-Added-RSS-support/20210819-015744
git checkout 2205ca0b751f734cf3ea53258d9b8e3f3849fe16
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/virtio_net.c:2278:6: warning: no previous prototype for function 'virtnet_get_hashflow' [-Wmissing-prototypes]
void virtnet_get_hashflow(const struct virtnet_info *vi, struct ethtool_rxnfc *info)
^
drivers/net/virtio_net.c:2278:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void virtnet_get_hashflow(const struct virtnet_info *vi, struct ethtool_rxnfc *info)
^
static
>> drivers/net/virtio_net.c:2330:6: warning: no previous prototype for function 'virtnet_set_hashflow' [-Wmissing-prototypes]
bool virtnet_set_hashflow(struct virtnet_info *vi, struct ethtool_rxnfc *info)
^
drivers/net/virtio_net.c:2330:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool virtnet_set_hashflow(struct virtnet_info *vi, struct ethtool_rxnfc *info)
^
static
drivers/net/virtio_net.c:2627:5: warning: no previous prototype for function 'virtnet_get_rxfh_key_size' [-Wmissing-prototypes]
u32 virtnet_get_rxfh_key_size(struct net_device *dev)
^
drivers/net/virtio_net.c:2627:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 virtnet_get_rxfh_key_size(struct net_device *dev)
^
static
drivers/net/virtio_net.c:2632:5: warning: no previous prototype for function 'virtnet_get_rxfh_indir_size' [-Wmissing-prototypes]
u32 virtnet_get_rxfh_indir_size(struct net_device *dev)
^
drivers/net/virtio_net.c:2632:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 virtnet_get_rxfh_indir_size(struct net_device *dev)
^
static
drivers/net/virtio_net.c:2637:5: warning: no previous prototype for function 'virtnet_get_rxfh' [-Wmissing-prototypes]
int virtnet_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, u8 *hfunc)
^
drivers/net/virtio_net.c:2637:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, u8 *hfunc)
^
static
drivers/net/virtio_net.c:2656:5: warning: no previous prototype for function 'virtnet_set_rxfh' [-Wmissing-prototypes]
int virtnet_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc)
^
drivers/net/virtio_net.c:2656:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc)
^
static
drivers/net/virtio_net.c:2676:5: warning: no previous prototype for function 'virtnet_get_rxnfc' [-Wmissing-prototypes]
int virtnet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs)
^
drivers/net/virtio_net.c:2676:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs)
^
static
7 warnings generated.
vim +/virtnet_get_hashflow +2278 drivers/net/virtio_net.c
2277
> 2278 void virtnet_get_hashflow(const struct virtnet_info *vi, struct ethtool_rxnfc *info)
2279 {
2280 info->data = 0;
2281 switch (info->flow_type) {
2282 case TCP_V4_FLOW:
2283 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_TCPv4) {
2284 info->data = RXH_IP_SRC | RXH_IP_DST |
2285 RXH_L4_B_0_1 | RXH_L4_B_2_3;
2286 } else if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv4) {
2287 info->data = RXH_IP_SRC | RXH_IP_DST;
2288 }
2289 break;
2290 case TCP_V6_FLOW:
2291 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_TCPv6) {
2292 info->data = RXH_IP_SRC | RXH_IP_DST |
2293 RXH_L4_B_0_1 | RXH_L4_B_2_3;
2294 } else if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv6) {
2295 info->data = RXH_IP_SRC | RXH_IP_DST;
2296 }
2297 break;
2298 case UDP_V4_FLOW:
2299 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_UDPv4) {
2300 info->data = RXH_IP_SRC | RXH_IP_DST |
2301 RXH_L4_B_0_1 | RXH_L4_B_2_3;
2302 } else if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv4) {
2303 info->data = RXH_IP_SRC | RXH_IP_DST;
2304 }
2305 break;
2306 case UDP_V6_FLOW:
2307 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_UDPv6) {
2308 info->data = RXH_IP_SRC | RXH_IP_DST |
2309 RXH_L4_B_0_1 | RXH_L4_B_2_3;
2310 } else if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv6) {
2311 info->data = RXH_IP_SRC | RXH_IP_DST;
2312 }
2313 break;
2314 case IPV4_FLOW:
2315 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv4)
2316 info->data = RXH_IP_SRC | RXH_IP_DST;
2317
2318 break;
2319 case IPV6_FLOW:
2320 if (vi->rss_hash_types_saved & VIRTIO_NET_RSS_HASH_TYPE_IPv4)
2321 info->data = RXH_IP_SRC | RXH_IP_DST;
2322
2323 break;
2324 default:
2325 info->data = 0;
2326 break;
2327 }
2328 }
2329
> 2330 bool virtnet_set_hashflow(struct virtnet_info *vi, struct ethtool_rxnfc *info)
2331 {
2332 u64 is_iphash = info->data & (RXH_IP_SRC | RXH_IP_DST);
2333 u64 is_porthash = info->data & (RXH_L4_B_0_1 | RXH_L4_B_2_3);
2334 u32 new_hashtypes = vi->rss_hash_types_saved;
2335
2336 if ((is_iphash && (is_iphash != (RXH_IP_SRC | RXH_IP_DST))) ||
2337 (is_porthash && (is_porthash != (RXH_L4_B_0_1 | RXH_L4_B_2_3)))) {
2338 return false;
2339 }
2340
2341 if (!is_iphash && is_porthash)
2342 return false;
2343
2344 switch (info->flow_type) {
2345 case TCP_V4_FLOW:
2346 case UDP_V4_FLOW:
2347 case IPV4_FLOW:
2348 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_IPv4;
2349 if (is_iphash)
2350 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_IPv4;
2351
2352 break;
2353 case TCP_V6_FLOW:
2354 case UDP_V6_FLOW:
2355 case IPV6_FLOW:
2356 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_IPv6;
2357 if (is_iphash)
2358 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_IPv6;
2359
2360 break;
2361 default:
2362 break;
2363 }
2364
2365 switch (info->flow_type) {
2366 case TCP_V4_FLOW:
2367 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_TCPv4;
2368 if (is_porthash)
2369 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_TCPv4;
2370
2371 break;
2372 case UDP_V4_FLOW:
2373 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_UDPv4;
2374 if (is_porthash)
2375 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_UDPv4;
2376
2377 break;
2378 case TCP_V6_FLOW:
2379 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_TCPv6;
2380 if (is_porthash)
2381 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_TCPv6;
2382
2383 break;
2384 case UDP_V6_FLOW:
2385 new_hashtypes &= ~VIRTIO_NET_RSS_HASH_TYPE_UDPv6;
2386 if (is_porthash)
2387 new_hashtypes |= VIRTIO_NET_RSS_HASH_TYPE_UDPv6;
2388
2389 break;
2390 default:
2391 break;
2392 }
2393
2394 if (new_hashtypes != vi->rss_hash_types_saved) {
2395 vi->rss_hash_types_saved = new_hashtypes;
2396 vi->ctrl->rss.table_info.hash_types = vi->rss_hash_types_saved;
2397 if (vi->dev->features & NETIF_F_RXHASH)
2398 return virtnet_commit_rss_command(vi);
2399 }
2400
2401 return true;
2402 }
2403
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [RFC PATCH net-next 04/20] net: switchdev: move SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE to the blocking notifier chain
by kernel test robot
Hi Vladimir,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Vladimir-Oltean/DSA-FDB-isolatio...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git ab44035d308227723b490487ff0feba521e87029
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c3f584a3a5fcbaf747a1c754720afa897...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vladimir-Oltean/DSA-FDB-isolation/20210818-200630
git checkout c3f584a3a5fcbaf747a1c754720afa897885c9a7
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/ti/am65-cpsw-switchdev.c: In function 'am65_cpsw_switchdev_fdb_event':
>> drivers/net/ethernet/ti/am65-cpsw-switchdev.c:461:43: error: 'ptr' undeclared (first use in this function)
461 | memcpy(&switchdev_work->fdb_info, ptr,
| ^~~
drivers/net/ethernet/ti/am65-cpsw-switchdev.c:461:43: note: each undeclared identifier is reported only once for each function it appears in
vim +/ptr +461 drivers/net/ethernet/ti/am65-cpsw-switchdev.c
c3f584a3a5fcba Vladimir Oltean 2021-08-18 442
c3f584a3a5fcba Vladimir Oltean 2021-08-18 443 static int am65_cpsw_switchdev_fdb_event(struct net_device *ndev,
c3f584a3a5fcba Vladimir Oltean 2021-08-18 444 unsigned long event,
c3f584a3a5fcba Vladimir Oltean 2021-08-18 445 struct switchdev_notifier_fdb_info *fdb_info)
c3f584a3a5fcba Vladimir Oltean 2021-08-18 446 {
c3f584a3a5fcba Vladimir Oltean 2021-08-18 447 struct am65_cpsw_switchdev_event_work *switchdev_work;
c3f584a3a5fcba Vladimir Oltean 2021-08-18 448 struct am65_cpsw_port *port = am65_ndev_to_port(ndev);
c3f584a3a5fcba Vladimir Oltean 2021-08-18 449
c3f584a3a5fcba Vladimir Oltean 2021-08-18 450 if (!am65_cpsw_port_dev_check(ndev))
c3f584a3a5fcba Vladimir Oltean 2021-08-18 451 return 0;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 452
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 453 switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 454 if (WARN_ON(!switchdev_work))
c3f584a3a5fcba Vladimir Oltean 2021-08-18 455 return -ENOMEM;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 456
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 457 INIT_WORK(&switchdev_work->work, am65_cpsw_switchdev_event_work);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 458 switchdev_work->port = port;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 459 switchdev_work->event = event;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 460
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 @461 memcpy(&switchdev_work->fdb_info, ptr,
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 462 sizeof(switchdev_work->fdb_info));
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 463 switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 464 if (!switchdev_work->fdb_info.addr)
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 465 goto err_addr_alloc;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 466 ether_addr_copy((u8 *)switchdev_work->fdb_info.addr,
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 467 fdb_info->addr);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 468 dev_hold(ndev);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 469
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 470 queue_work(system_long_wq, &switchdev_work->work);
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 471
c3f584a3a5fcba Vladimir Oltean 2021-08-18 472 return 0;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 473
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 474 err_addr_alloc:
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 475 kfree(switchdev_work);
c3f584a3a5fcba Vladimir Oltean 2021-08-18 476 return -ENOMEM;
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 477 }
86e8b070b25e3c Vignesh Raghavendra 2021-02-11 478
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[mcgrof-next:20210817-add-disk-error-handling-next 2/89] drivers/scsi/st.c:3830:40: error: no member named 'disk' in 'struct scsi_tape'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210817-add-disk-error-handling-next
head: 3d00c210d7fd616243af9cf41829f4a56f116ba8
commit: 7692839b26192b737a64c87970b6589e6a909d38 [2/89] st: do not allocate a gendisk
config: i386-randconfig-a011-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20210817-add-disk-error-handling-next
git checkout 7692839b26192b737a64c87970b6589e6a909d38
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/scsi/st.c:3830:40: error: no member named 'disk' in 'struct scsi_tape'
retval = scsi_ioctl(STp->device, STp->disk, file->f_mode, cmd_in, p);
~~~ ^
1 error generated.
vim +3830 drivers/scsi/st.c
8038e6456a3e6f Kai Makisara 2016-02-09 3348
8038e6456a3e6f Kai Makisara 2016-02-09 3349
^1da177e4c3f41 Linus Torvalds 2005-04-16 3350 /* Partition the tape into two partitions if size > 0 or one partition if
^1da177e4c3f41 Linus Torvalds 2005-04-16 3351 size == 0.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3352
^1da177e4c3f41 Linus Torvalds 2005-04-16 3353 The block descriptors are read and written because Sony SDT-7000 does not
^1da177e4c3f41 Linus Torvalds 2005-04-16 3354 work without this (suggestion from Michael Schaefer <Michael.Schaefer(a)dlr.de>).
^1da177e4c3f41 Linus Torvalds 2005-04-16 3355
^1da177e4c3f41 Linus Torvalds 2005-04-16 3356 My HP C1533A drive returns only one partition size field. This is used to
^1da177e4c3f41 Linus Torvalds 2005-04-16 3357 set the size of partition 1. There is no size field for the default partition.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3358 Michael Schaefer's Sony SDT-7000 returns two descriptors and the second is
^1da177e4c3f41 Linus Torvalds 2005-04-16 3359 used to set the size of partition 1 (this is what the SCSI-3 standard specifies).
^1da177e4c3f41 Linus Torvalds 2005-04-16 3360 The following algorithm is used to accommodate both drives: if the number of
^1da177e4c3f41 Linus Torvalds 2005-04-16 3361 partition size fields is greater than the maximum number of additional partitions
^1da177e4c3f41 Linus Torvalds 2005-04-16 3362 in the mode page, the second field is used. Otherwise the first field is used.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3363
^1da177e4c3f41 Linus Torvalds 2005-04-16 3364 For Seagate DDS drives the page length must be 8 when no partitions is defined
^1da177e4c3f41 Linus Torvalds 2005-04-16 3365 and 10 when 1 partition is defined (information from Eric Lee Green). This is
^1da177e4c3f41 Linus Torvalds 2005-04-16 3366 is acceptable also to some other old drives and enforced if the first partition
^1da177e4c3f41 Linus Torvalds 2005-04-16 3367 size field is used for the first additional partition size.
8038e6456a3e6f Kai Makisara 2016-02-09 3368
8038e6456a3e6f Kai Makisara 2016-02-09 3369 For drives that advertize SCSI-3 or newer, use the SSC-3 methods.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3370 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3371 static int partition_tape(struct scsi_tape *STp, int size)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3372 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3373 int result;
8038e6456a3e6f Kai Makisara 2016-02-09 3374 int target_partition;
8038e6456a3e6f Kai Makisara 2016-02-09 3375 bool scsi3 = STp->device->scsi_level >= SCSI_3, needs_format = false;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3376 int pgo, psd_cnt, psdo;
8038e6456a3e6f Kai Makisara 2016-02-09 3377 int psum = PP_MSK_PSUM_MB, units = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3378 unsigned char *bp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3379
^1da177e4c3f41 Linus Torvalds 2005-04-16 3380 result = read_mode_page(STp, PART_PAGE, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3381 if (result) {
b30d8bca5b525b Hannes Reinecke 2014-06-25 3382 DEBC_printk(STp, "Can't read partition mode page.\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3383 return result;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3384 }
8038e6456a3e6f Kai Makisara 2016-02-09 3385 target_partition = 1;
8038e6456a3e6f Kai Makisara 2016-02-09 3386 if (size < 0) {
8038e6456a3e6f Kai Makisara 2016-02-09 3387 target_partition = 0;
8038e6456a3e6f Kai Makisara 2016-02-09 3388 size = -size;
8038e6456a3e6f Kai Makisara 2016-02-09 3389 }
8038e6456a3e6f Kai Makisara 2016-02-09 3390
^1da177e4c3f41 Linus Torvalds 2005-04-16 3391 /* The mode page is in the buffer. Let's modify it and write it. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3392 bp = (STp->buffer)->b_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3393 pgo = MODE_HEADER_LENGTH + bp[MH_OFF_BDESCS_LENGTH];
b30d8bca5b525b Hannes Reinecke 2014-06-25 3394 DEBC_printk(STp, "Partition page length is %d bytes.\n",
b30d8bca5b525b Hannes Reinecke 2014-06-25 3395 bp[pgo + MP_OFF_PAGE_LENGTH] + 2);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3396
^1da177e4c3f41 Linus Torvalds 2005-04-16 3397 psd_cnt = (bp[pgo + MP_OFF_PAGE_LENGTH] + 2 - PART_PAGE_FIXED_LENGTH) / 2;
8038e6456a3e6f Kai Makisara 2016-02-09 3398
8038e6456a3e6f Kai Makisara 2016-02-09 3399 if (scsi3) {
8038e6456a3e6f Kai Makisara 2016-02-09 3400 needs_format = (bp[pgo + PP_OFF_FLAGS] & PP_MSK_POFM) != 0;
8038e6456a3e6f Kai Makisara 2016-02-09 3401 if (needs_format && size == 0) {
8038e6456a3e6f Kai Makisara 2016-02-09 3402 /* No need to write the mode page when clearing
8038e6456a3e6f Kai Makisara 2016-02-09 3403 * partitioning
8038e6456a3e6f Kai Makisara 2016-02-09 3404 */
8038e6456a3e6f Kai Makisara 2016-02-09 3405 DEBC_printk(STp, "Formatting tape with one partition.\n");
8038e6456a3e6f Kai Makisara 2016-02-09 3406 result = format_medium(STp, 0);
8038e6456a3e6f Kai Makisara 2016-02-09 3407 goto out;
8038e6456a3e6f Kai Makisara 2016-02-09 3408 }
8038e6456a3e6f Kai Makisara 2016-02-09 3409 if (needs_format) /* Leave the old value for HP DATs claiming SCSI_3 */
8038e6456a3e6f Kai Makisara 2016-02-09 3410 psd_cnt = 2;
8038e6456a3e6f Kai Makisara 2016-02-09 3411 if ((bp[pgo + PP_OFF_FLAGS] & PP_MSK_PSUM_UNITS) == PP_MSK_PSUM_UNITS) {
8038e6456a3e6f Kai Makisara 2016-02-09 3412 /* Use units scaling for large partitions if the device
8038e6456a3e6f Kai Makisara 2016-02-09 3413 * suggests it and no precision lost. Required for IBM
8038e6456a3e6f Kai Makisara 2016-02-09 3414 * TS1140/50 drives that don't support MB units.
8038e6456a3e6f Kai Makisara 2016-02-09 3415 */
8038e6456a3e6f Kai Makisara 2016-02-09 3416 if (size >= 1000 && (size % 1000) == 0) {
8038e6456a3e6f Kai Makisara 2016-02-09 3417 size /= 1000;
8038e6456a3e6f Kai Makisara 2016-02-09 3418 psum = PP_MSK_PSUM_UNITS;
8038e6456a3e6f Kai Makisara 2016-02-09 3419 units = 9; /* GB */
8038e6456a3e6f Kai Makisara 2016-02-09 3420 }
8038e6456a3e6f Kai Makisara 2016-02-09 3421 }
8038e6456a3e6f Kai Makisara 2016-02-09 3422 /* Try it anyway if too large to specify in MB */
8038e6456a3e6f Kai Makisara 2016-02-09 3423 if (psum == PP_MSK_PSUM_MB && size >= 65534) {
8038e6456a3e6f Kai Makisara 2016-02-09 3424 size /= 1000;
8038e6456a3e6f Kai Makisara 2016-02-09 3425 psum = PP_MSK_PSUM_UNITS;
8038e6456a3e6f Kai Makisara 2016-02-09 3426 units = 9; /* GB */
8038e6456a3e6f Kai Makisara 2016-02-09 3427 }
8038e6456a3e6f Kai Makisara 2016-02-09 3428 }
8038e6456a3e6f Kai Makisara 2016-02-09 3429
8038e6456a3e6f Kai Makisara 2016-02-09 3430 if (size >= 65535 || /* Does not fit into two bytes */
8038e6456a3e6f Kai Makisara 2016-02-09 3431 (target_partition == 0 && psd_cnt < 2)) {
8038e6456a3e6f Kai Makisara 2016-02-09 3432 result = -EINVAL;
8038e6456a3e6f Kai Makisara 2016-02-09 3433 goto out;
8038e6456a3e6f Kai Makisara 2016-02-09 3434 }
8038e6456a3e6f Kai Makisara 2016-02-09 3435
^1da177e4c3f41 Linus Torvalds 2005-04-16 3436 psdo = pgo + PART_PAGE_FIXED_LENGTH;
8038e6456a3e6f Kai Makisara 2016-02-09 3437 /* The second condition is for HP DDS which use only one partition size
8038e6456a3e6f Kai Makisara 2016-02-09 3438 * descriptor
8038e6456a3e6f Kai Makisara 2016-02-09 3439 */
8038e6456a3e6f Kai Makisara 2016-02-09 3440 if (target_partition > 0 &&
8038e6456a3e6f Kai Makisara 2016-02-09 3441 (psd_cnt > bp[pgo + PP_OFF_MAX_ADD_PARTS] ||
8038e6456a3e6f Kai Makisara 2016-02-09 3442 bp[pgo + PP_OFF_MAX_ADD_PARTS] != 1)) {
8038e6456a3e6f Kai Makisara 2016-02-09 3443 bp[psdo] = bp[psdo + 1] = 0xff; /* Rest to partition 0 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3444 psdo += 2;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3445 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3446 memset(bp + psdo, 0, bp[pgo + PP_OFF_NBR_ADD_PARTS] * 2);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3447
b30d8bca5b525b Hannes Reinecke 2014-06-25 3448 DEBC_printk(STp, "psd_cnt %d, max.parts %d, nbr_parts %d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 3449 psd_cnt, bp[pgo + PP_OFF_MAX_ADD_PARTS],
b30d8bca5b525b Hannes Reinecke 2014-06-25 3450 bp[pgo + PP_OFF_NBR_ADD_PARTS]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3451
8038e6456a3e6f Kai Makisara 2016-02-09 3452 if (size == 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3453 bp[pgo + PP_OFF_NBR_ADD_PARTS] = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3454 if (psd_cnt <= bp[pgo + PP_OFF_MAX_ADD_PARTS])
^1da177e4c3f41 Linus Torvalds 2005-04-16 3455 bp[pgo + MP_OFF_PAGE_LENGTH] = 6;
b30d8bca5b525b Hannes Reinecke 2014-06-25 3456 DEBC_printk(STp, "Formatting tape with one partition.\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3457 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3458 bp[psdo] = (size >> 8) & 0xff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3459 bp[psdo + 1] = size & 0xff;
8038e6456a3e6f Kai Makisara 2016-02-09 3460 if (target_partition == 0)
8038e6456a3e6f Kai Makisara 2016-02-09 3461 bp[psdo + 2] = bp[psdo + 3] = 0xff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3462 bp[pgo + 3] = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3463 if (bp[pgo + MP_OFF_PAGE_LENGTH] < 8)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3464 bp[pgo + MP_OFF_PAGE_LENGTH] = 8;
8038e6456a3e6f Kai Makisara 2016-02-09 3465 DEBC_printk(STp,
8038e6456a3e6f Kai Makisara 2016-02-09 3466 "Formatting tape with two partitions (%i = %d MB).\n",
8038e6456a3e6f Kai Makisara 2016-02-09 3467 target_partition, units > 0 ? size * 1000 : size);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3468 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3469 bp[pgo + PP_OFF_PART_UNITS] = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3470 bp[pgo + PP_OFF_RESERVED] = 0;
8038e6456a3e6f Kai Makisara 2016-02-09 3471 if (size != 1 || units != 0) {
8038e6456a3e6f Kai Makisara 2016-02-09 3472 bp[pgo + PP_OFF_FLAGS] = PP_BIT_IDP | psum |
8038e6456a3e6f Kai Makisara 2016-02-09 3473 (bp[pgo + PP_OFF_FLAGS] & 0x07);
8038e6456a3e6f Kai Makisara 2016-02-09 3474 bp[pgo + PP_OFF_PART_UNITS] = units;
8038e6456a3e6f Kai Makisara 2016-02-09 3475 } else
8038e6456a3e6f Kai Makisara 2016-02-09 3476 bp[pgo + PP_OFF_FLAGS] = PP_BIT_FDP |
8038e6456a3e6f Kai Makisara 2016-02-09 3477 (bp[pgo + PP_OFF_FLAGS] & 0x1f);
8038e6456a3e6f Kai Makisara 2016-02-09 3478 bp[pgo + MP_OFF_PAGE_LENGTH] = 6 + psd_cnt * 2;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3479
^1da177e4c3f41 Linus Torvalds 2005-04-16 3480 result = write_mode_page(STp, PART_PAGE, 1);
8038e6456a3e6f Kai Makisara 2016-02-09 3481
8038e6456a3e6f Kai Makisara 2016-02-09 3482 if (!result && needs_format)
8038e6456a3e6f Kai Makisara 2016-02-09 3483 result = format_medium(STp, 1);
8038e6456a3e6f Kai Makisara 2016-02-09 3484
^1da177e4c3f41 Linus Torvalds 2005-04-16 3485 if (result) {
b30d8bca5b525b Hannes Reinecke 2014-06-25 3486 st_printk(KERN_INFO, STp, "Partitioning of tape failed.\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3487 result = (-EIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3488 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3489
8038e6456a3e6f Kai Makisara 2016-02-09 3490 out:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3491 return result;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3492 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3493
^1da177e4c3f41 Linus Torvalds 2005-04-16 3494
^1da177e4c3f41 Linus Torvalds 2005-04-16 3495
^1da177e4c3f41 Linus Torvalds 2005-04-16 3496 /* The ioctl command */
dba7688fc9037c Christoph Hellwig 2021-07-24 3497 static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3498 {
dba7688fc9037c Christoph Hellwig 2021-07-24 3499 void __user *p = (void __user *)arg;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3500 int i, cmd_nr, cmd_type, bt;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3501 int retval = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3502 unsigned int blk;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3503 struct scsi_tape *STp = file->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3504 struct st_modedef *STm;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3505 struct st_partstat *STps;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3506
28f85009e0cf6a Matthias Kaehlcke 2007-07-29 3507 if (mutex_lock_interruptible(&STp->lock))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3508 return -ERESTARTSYS;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3509
^1da177e4c3f41 Linus Torvalds 2005-04-16 3510 DEB(
^1da177e4c3f41 Linus Torvalds 2005-04-16 3511 if (debugging && !STp->in_use) {
b30d8bca5b525b Hannes Reinecke 2014-06-25 3512 st_printk(ST_DEB_MSG, STp, "Incorrect device.\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3513 retval = (-EIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3514 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3515 } ) /* end DEB */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3516
^1da177e4c3f41 Linus Torvalds 2005-04-16 3517 STm = &(STp->modes[STp->current_mode]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3518 STps = &(STp->ps[STp->partition]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3519
^1da177e4c3f41 Linus Torvalds 2005-04-16 3520 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 3521 * If we are in the middle of error recovery, don't let anyone
^1da177e4c3f41 Linus Torvalds 2005-04-16 3522 * else try and use this device. Also, if error recovery fails, it
^1da177e4c3f41 Linus Torvalds 2005-04-16 3523 * may try and take the device offline, in which case all further
^1da177e4c3f41 Linus Torvalds 2005-04-16 3524 * access to the device is prohibited.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3525 */
906d15fbd23c12 Christoph Hellwig 2014-10-11 3526 retval = scsi_ioctl_block_when_processing_errors(STp->device, cmd_in,
83ff6fe8580a7c Al Viro 2008-03-02 3527 file->f_flags & O_NDELAY);
906d15fbd23c12 Christoph Hellwig 2014-10-11 3528 if (retval)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3529 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3530
^1da177e4c3f41 Linus Torvalds 2005-04-16 3531 cmd_type = _IOC_TYPE(cmd_in);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3532 cmd_nr = _IOC_NR(cmd_in);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3533
^1da177e4c3f41 Linus Torvalds 2005-04-16 3534 if (cmd_type == _IOC_TYPE(MTIOCTOP) && cmd_nr == _IOC_NR(MTIOCTOP)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3535 struct mtop mtc;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3536
^1da177e4c3f41 Linus Torvalds 2005-04-16 3537 if (_IOC_SIZE(cmd_in) != sizeof(mtc)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3538 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3539 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3540 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3541
^1da177e4c3f41 Linus Torvalds 2005-04-16 3542 i = copy_from_user(&mtc, p, sizeof(struct mtop));
^1da177e4c3f41 Linus Torvalds 2005-04-16 3543 if (i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3544 retval = (-EFAULT);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3545 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3546 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3547
^1da177e4c3f41 Linus Torvalds 2005-04-16 3548 if (mtc.mt_op == MTSETDRVBUFFER && !capable(CAP_SYS_ADMIN)) {
b30d8bca5b525b Hannes Reinecke 2014-06-25 3549 st_printk(KERN_WARNING, STp,
b30d8bca5b525b Hannes Reinecke 2014-06-25 3550 "MTSETDRVBUFFER only allowed for root.\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3551 retval = (-EPERM);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3552 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3553 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3554 if (!STm->defined &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3555 (mtc.mt_op != MTSETDRVBUFFER &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3556 (mtc.mt_count & MT_ST_OPTIONS) == 0)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3557 retval = (-ENXIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3558 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3559 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3560
^1da177e4c3f41 Linus Torvalds 2005-04-16 3561 if (!STp->pos_unknown) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3562
^1da177e4c3f41 Linus Torvalds 2005-04-16 3563 if (STps->eof == ST_FM_HIT) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3564 if (mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3565 mtc.mt_op == MTEOM) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3566 mtc.mt_count -= 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3567 if (STps->drv_file >= 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3568 STps->drv_file += 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3569 } else if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3570 mtc.mt_count += 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3571 if (STps->drv_file >= 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3572 STps->drv_file += 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3573 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3574 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3575
^1da177e4c3f41 Linus Torvalds 2005-04-16 3576 if (mtc.mt_op == MTSEEK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3577 /* Old position must be restored if partition will be
^1da177e4c3f41 Linus Torvalds 2005-04-16 3578 changed */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3579 i = !STp->can_partitions ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3580 (STp->new_partition != STp->partition);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3581 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3582 i = mtc.mt_op == MTREW || mtc.mt_op == MTOFFL ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3583 mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3584 mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3585 mtc.mt_op == MTFSF || mtc.mt_op == MTFSFM ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3586 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3587 mtc.mt_op == MTCOMPRESSION;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3588 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3589 i = flush_buffer(STp, i);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3590 if (i < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3591 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3592 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3593 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3594 if (STps->rw == ST_WRITING &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3595 (mtc.mt_op == MTREW || mtc.mt_op == MTOFFL ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3596 mtc.mt_op == MTSEEK ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3597 mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3598 i = st_int_ioctl(STp, MTWEOF, 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3599 if (i < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3600 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3601 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3602 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3603 if (mtc.mt_op == MTBSF || mtc.mt_op == MTBSFM)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3604 mtc.mt_count++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3605 STps->rw = ST_IDLE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3606 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3607
^1da177e4c3f41 Linus Torvalds 2005-04-16 3608 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3609 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 3610 * If there was a bus reset, block further access
^1da177e4c3f41 Linus Torvalds 2005-04-16 3611 * to this device. If the user wants to rewind the tape,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3612 * then reset the flag and allow access again.
^1da177e4c3f41 Linus Torvalds 2005-04-16 3613 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3614 if (mtc.mt_op != MTREW &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3615 mtc.mt_op != MTOFFL &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3616 mtc.mt_op != MTRETEN &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3617 mtc.mt_op != MTERASE &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3618 mtc.mt_op != MTSEEK &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3619 mtc.mt_op != MTEOM) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3620 retval = (-EIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3621 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3622 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3623 reset_state(STp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3624 /* remove this when the midlevel properly clears was_reset */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3625 STp->device->was_reset = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3626 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3627
^1da177e4c3f41 Linus Torvalds 2005-04-16 3628 if (mtc.mt_op != MTNOP && mtc.mt_op != MTSETBLK &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3629 mtc.mt_op != MTSETDENSITY && mtc.mt_op != MTWSM &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3630 mtc.mt_op != MTSETDRVBUFFER && mtc.mt_op != MTSETPART)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3631 STps->rw = ST_IDLE; /* Prevent automatic WEOF and fsf */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3632
^1da177e4c3f41 Linus Torvalds 2005-04-16 3633 if (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3634 do_door_lock(STp, 0); /* Ignore result! */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3635
^1da177e4c3f41 Linus Torvalds 2005-04-16 3636 if (mtc.mt_op == MTSETDRVBUFFER &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3637 (mtc.mt_count & MT_ST_OPTIONS) != 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3638 retval = st_set_options(STp, mtc.mt_count);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3639 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3640 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3641
^1da177e4c3f41 Linus Torvalds 2005-04-16 3642 if (mtc.mt_op == MTSETPART) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3643 if (!STp->can_partitions ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3644 mtc.mt_count < 0 || mtc.mt_count >= ST_NBR_PARTITIONS) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3645 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3646 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3647 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3648 if (mtc.mt_count >= STp->nbr_partitions &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3649 (STp->nbr_partitions = nbr_partitions(STp)) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3650 retval = (-EIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3651 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3652 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3653 if (mtc.mt_count >= STp->nbr_partitions) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3654 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3655 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3656 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3657 STp->new_partition = mtc.mt_count;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3658 retval = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3659 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3660 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3661
^1da177e4c3f41 Linus Torvalds 2005-04-16 3662 if (mtc.mt_op == MTMKPART) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3663 if (!STp->can_partitions) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3664 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3665 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3666 }
8038e6456a3e6f Kai Makisara 2016-02-09 3667 i = do_load_unload(STp, file, 1);
8038e6456a3e6f Kai Makisara 2016-02-09 3668 if (i < 0) {
8038e6456a3e6f Kai Makisara 2016-02-09 3669 retval = i;
8038e6456a3e6f Kai Makisara 2016-02-09 3670 goto out;
8038e6456a3e6f Kai Makisara 2016-02-09 3671 }
8038e6456a3e6f Kai Makisara 2016-02-09 3672 i = partition_tape(STp, mtc.mt_count);
8038e6456a3e6f Kai Makisara 2016-02-09 3673 if (i < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3674 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3675 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3676 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3677 for (i = 0; i < ST_NBR_PARTITIONS; i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3678 STp->ps[i].rw = ST_IDLE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3679 STp->ps[i].at_sm = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3680 STp->ps[i].last_block_valid = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3681 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3682 STp->partition = STp->new_partition = 0;
8038e6456a3e6f Kai Makisara 2016-02-09 3683 STp->nbr_partitions = mtc.mt_count != 0 ? 2 : 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3684 STps->drv_block = STps->drv_file = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3685 retval = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3686 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3687 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3688
^1da177e4c3f41 Linus Torvalds 2005-04-16 3689 if (mtc.mt_op == MTSEEK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3690 i = set_location(STp, mtc.mt_count, STp->new_partition, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3691 if (!STp->can_partitions)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3692 STp->ps[0].rw = ST_IDLE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3693 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3694 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3695 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3696
^1da177e4c3f41 Linus Torvalds 2005-04-16 3697 if (mtc.mt_op == MTUNLOAD || mtc.mt_op == MTOFFL) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3698 retval = do_load_unload(STp, file, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3699 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3700 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3701
^1da177e4c3f41 Linus Torvalds 2005-04-16 3702 if (mtc.mt_op == MTLOAD) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3703 retval = do_load_unload(STp, file, max(1, mtc.mt_count));
^1da177e4c3f41 Linus Torvalds 2005-04-16 3704 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3705 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3706
^1da177e4c3f41 Linus Torvalds 2005-04-16 3707 if (mtc.mt_op == MTLOCK || mtc.mt_op == MTUNLOCK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3708 retval = do_door_lock(STp, (mtc.mt_op == MTLOCK));
^1da177e4c3f41 Linus Torvalds 2005-04-16 3709 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3710 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3711
^1da177e4c3f41 Linus Torvalds 2005-04-16 3712 if (STp->can_partitions && STp->ready == ST_READY &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3713 (i = switch_partition(STp)) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3714 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3715 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3716 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3717
^1da177e4c3f41 Linus Torvalds 2005-04-16 3718 if (mtc.mt_op == MTCOMPRESSION)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3719 retval = st_compression(STp, (mtc.mt_count & 1));
^1da177e4c3f41 Linus Torvalds 2005-04-16 3720 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 3721 retval = st_int_ioctl(STp, mtc.mt_op, mtc.mt_count);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3722 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3723 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3724 if (!STm->defined) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3725 retval = (-ENXIO);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3726 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3727 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3728
^1da177e4c3f41 Linus Torvalds 2005-04-16 3729 if ((i = flush_buffer(STp, 0)) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3730 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3731 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3732 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3733 if (STp->can_partitions &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 3734 (i = switch_partition(STp)) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3735 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3736 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3737 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3738
^1da177e4c3f41 Linus Torvalds 2005-04-16 3739 if (cmd_type == _IOC_TYPE(MTIOCGET) && cmd_nr == _IOC_NR(MTIOCGET)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3740 struct mtget mt_status;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3741
^1da177e4c3f41 Linus Torvalds 2005-04-16 3742 if (_IOC_SIZE(cmd_in) != sizeof(struct mtget)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3743 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3744 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3745 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3746
^1da177e4c3f41 Linus Torvalds 2005-04-16 3747 mt_status.mt_type = STp->tape_type;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3748 mt_status.mt_dsreg =
^1da177e4c3f41 Linus Torvalds 2005-04-16 3749 ((STp->block_size << MT_ST_BLKSIZE_SHIFT) & MT_ST_BLKSIZE_MASK) |
^1da177e4c3f41 Linus Torvalds 2005-04-16 3750 ((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3751 mt_status.mt_blkno = STps->drv_block;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3752 mt_status.mt_fileno = STps->drv_file;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3753 if (STp->block_size != 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3754 if (STps->rw == ST_WRITING)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3755 mt_status.mt_blkno +=
^1da177e4c3f41 Linus Torvalds 2005-04-16 3756 (STp->buffer)->buffer_bytes / STp->block_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3757 else if (STps->rw == ST_READING)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3758 mt_status.mt_blkno -=
^1da177e4c3f41 Linus Torvalds 2005-04-16 3759 ((STp->buffer)->buffer_bytes +
^1da177e4c3f41 Linus Torvalds 2005-04-16 3760 STp->block_size - 1) / STp->block_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3761 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3762
^1da177e4c3f41 Linus Torvalds 2005-04-16 3763 mt_status.mt_gstat = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3764 if (STp->drv_write_prot)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3765 mt_status.mt_gstat |= GMT_WR_PROT(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3766 if (mt_status.mt_blkno == 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3767 if (mt_status.mt_fileno == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3768 mt_status.mt_gstat |= GMT_BOT(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3769 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 3770 mt_status.mt_gstat |= GMT_EOF(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3771 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3772 mt_status.mt_erreg = (STp->recover_reg << MT_ST_SOFTERR_SHIFT);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3773 mt_status.mt_resid = STp->partition;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3774 if (STps->eof == ST_EOM_OK || STps->eof == ST_EOM_ERROR)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3775 mt_status.mt_gstat |= GMT_EOT(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3776 else if (STps->eof >= ST_EOM_OK)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3777 mt_status.mt_gstat |= GMT_EOD(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3778 if (STp->density == 1)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3779 mt_status.mt_gstat |= GMT_D_800(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3780 else if (STp->density == 2)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3781 mt_status.mt_gstat |= GMT_D_1600(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3782 else if (STp->density == 3)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3783 mt_status.mt_gstat |= GMT_D_6250(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3784 if (STp->ready == ST_READY)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3785 mt_status.mt_gstat |= GMT_ONLINE(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3786 if (STp->ready == ST_NO_TAPE)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3787 mt_status.mt_gstat |= GMT_DR_OPEN(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3788 if (STps->at_sm)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3789 mt_status.mt_gstat |= GMT_SM(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3790 if (STm->do_async_writes ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3791 (STm->do_buffer_writes && STp->block_size != 0) ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 3792 STp->drv_buffer != 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3793 mt_status.mt_gstat |= GMT_IM_REP_EN(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3794 if (STp->cleaning_req)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3795 mt_status.mt_gstat |= GMT_CLN(0xffffffff);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3796
1207045da5a7c9 Arnd Bergmann 2018-09-07 3797 retval = put_user_mtget(p, &mt_status);
1207045da5a7c9 Arnd Bergmann 2018-09-07 3798 if (retval)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3799 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3800
^1da177e4c3f41 Linus Torvalds 2005-04-16 3801 STp->recover_reg = 0; /* Clear after read */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3802 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3803 } /* End of MTIOCGET */
^1da177e4c3f41 Linus Torvalds 2005-04-16 3804 if (cmd_type == _IOC_TYPE(MTIOCPOS) && cmd_nr == _IOC_NR(MTIOCPOS)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3805 struct mtpos mt_pos;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3806 if (_IOC_SIZE(cmd_in) != sizeof(struct mtpos)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3807 retval = (-EINVAL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3808 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3809 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3810 if ((i = get_location(STp, &blk, &bt, 0)) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3811 retval = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3812 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3813 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3814 mt_pos.mt_blkno = blk;
1207045da5a7c9 Arnd Bergmann 2018-09-07 3815 retval = put_user_mtpos(p, &mt_pos);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3816 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3817 }
28f85009e0cf6a Matthias Kaehlcke 2007-07-29 3818 mutex_unlock(&STp->lock);
d320a9551e394c Arnd Bergmann 2019-03-15 3819
dba7688fc9037c Christoph Hellwig 2021-07-24 3820 switch (cmd_in) {
dba7688fc9037c Christoph Hellwig 2021-07-24 3821 case SG_IO:
dba7688fc9037c Christoph Hellwig 2021-07-24 3822 case SCSI_IOCTL_SEND_COMMAND:
dba7688fc9037c Christoph Hellwig 2021-07-24 3823 case CDROM_SEND_PACKET:
dba7688fc9037c Christoph Hellwig 2021-07-24 3824 if (!capable(CAP_SYS_RAWIO))
dba7688fc9037c Christoph Hellwig 2021-07-24 3825 return -EPERM;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3826 default:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3827 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3828 }
dba7688fc9037c Christoph Hellwig 2021-07-24 3829
2e27f576abc6f0 Christoph Hellwig 2021-07-24 @3830 retval = scsi_ioctl(STp->device, STp->disk, file->f_mode, cmd_in, p);
dba7688fc9037c Christoph Hellwig 2021-07-24 3831 if (!retval && cmd_in == SCSI_IOCTL_STOP_UNIT) {
dba7688fc9037c Christoph Hellwig 2021-07-24 3832 /* unload */
dba7688fc9037c Christoph Hellwig 2021-07-24 3833 STp->rew_at_close = 0;
dba7688fc9037c Christoph Hellwig 2021-07-24 3834 STp->ready = ST_NO_TAPE;
dba7688fc9037c Christoph Hellwig 2021-07-24 3835 }
dba7688fc9037c Christoph Hellwig 2021-07-24 3836 return retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3837
^1da177e4c3f41 Linus Torvalds 2005-04-16 3838 out:
28f85009e0cf6a Matthias Kaehlcke 2007-07-29 3839 mutex_unlock(&STp->lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3840 return retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3841 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3842
:::::: The code at line 3830 was first introduced by commit
:::::: 2e27f576abc6f056e63ef207b9911b1a04d07020 scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Martin K. Petersen <martin.petersen(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [Intel-wired-lan] [PATCH v6 intel-next 3/9] ice: split ice_ring onto Tx/Rx separate structs
by kernel test robot
Hi Maciej,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tnguy-next-queue/dev-queue]
[cannot apply to v5.14-rc6 next-20210818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Maciej-Fijalkowski/XDP_TX-improv...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8efea0970271c16b9bab35cf49ce219c1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Maciej-Fijalkowski/XDP_TX-improvements-for-ice/20210818-221906
git checkout 8efea0970271c16b9bab35cf49ce219c16a7479b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/intel/ice/ice_eswitch.c: In function 'ice_eswitch_remap_rings_to_vectors':
drivers/net/ethernet/intel/ice/ice_eswitch.c:97:30: error: 'struct ice_ring_container' has no member named 'ring'; did you mean 'rx_ring'?
97 | q_vector->tx.ring = tx_ring;
| ^~~~
| rx_ring
drivers/net/ethernet/intel/ice/ice_eswitch.c:100:35: error: 'netdev' undeclared (first use in this function); did you mean 'net_eq'?
100 | tx_ring->netdev = netdev;
| ^~~~~~
| net_eq
drivers/net/ethernet/intel/ice/ice_eswitch.c:100:35: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ethernet/intel/ice/ice_eswitch.c:107:30: error: 'struct ice_ring_container' has no member named 'ring'; did you mean 'rx_ring'?
107 | q_vector->rx.ring = rx_ring;
| ^~~~
| rx_ring
drivers/net/ethernet/intel/ice/ice_eswitch.c: In function 'ice_eswitch_set_rxdid':
drivers/net/ethernet/intel/ice/ice_eswitch.c:382:41: error: initialization of 'struct ice_ring *' from incompatible pointer type 'struct ice_rx_ring *' [-Werror=incompatible-pointer-types]
382 | struct ice_ring *ring = vsi->rx_rings[i];
| ^~~
>> drivers/net/ethernet/intel/ice/ice_eswitch.c:383:45: error: invalid use of undefined type 'struct ice_ring'
383 | u16 pf_q = vsi->rxq_map[ring->q_index];
| ^~
cc1: some warnings being treated as errors
vim +383 drivers/net/ethernet/intel/ice/ice_eswitch.c
bc0412448da587 Grzegorz Nitka 2021-08-03 370
bc0412448da587 Grzegorz Nitka 2021-08-03 371 /**
bc0412448da587 Grzegorz Nitka 2021-08-03 372 * ice_eswitch_set_rxdid - configure rxdid on all rx queues from VSI
bc0412448da587 Grzegorz Nitka 2021-08-03 373 * @vsi: VSI to setup rxdid on
bc0412448da587 Grzegorz Nitka 2021-08-03 374 * @rxdid: flex descriptor id
bc0412448da587 Grzegorz Nitka 2021-08-03 375 */
bc0412448da587 Grzegorz Nitka 2021-08-03 376 static void ice_eswitch_set_rxdid(struct ice_vsi *vsi, u32 rxdid)
bc0412448da587 Grzegorz Nitka 2021-08-03 377 {
bc0412448da587 Grzegorz Nitka 2021-08-03 378 struct ice_hw *hw = &vsi->back->hw;
bc0412448da587 Grzegorz Nitka 2021-08-03 379 int i;
bc0412448da587 Grzegorz Nitka 2021-08-03 380
bc0412448da587 Grzegorz Nitka 2021-08-03 381 ice_for_each_rxq(vsi, i) {
bc0412448da587 Grzegorz Nitka 2021-08-03 382 struct ice_ring *ring = vsi->rx_rings[i];
bc0412448da587 Grzegorz Nitka 2021-08-03 @383 u16 pf_q = vsi->rxq_map[ring->q_index];
bc0412448da587 Grzegorz Nitka 2021-08-03 384
bc0412448da587 Grzegorz Nitka 2021-08-03 385 ice_write_qrxflxp_cntxt(hw, pf_q, rxdid, 0x3, true);
bc0412448da587 Grzegorz Nitka 2021-08-03 386 }
bc0412448da587 Grzegorz Nitka 2021-08-03 387 }
bc0412448da587 Grzegorz Nitka 2021-08-03 388
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[mcgrof:20210818-add-disk-error-handling-v2 137/160] drivers/block/rsxx/dev.c:200:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git 20210818-add-disk-error-handling-v2
head: 0517c8bf82eb7da58caada94869afb0957f57c81
commit: 75577f3e8b2f2a343829cb35edbdf0f138fc9000 [137/160] block/rsxx: add error handling support for add_disk()
config: i386-randconfig-r022-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?...
git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git fetch --no-tags mcgrof 20210818-add-disk-error-handling-v2
git checkout 75577f3e8b2f2a343829cb35edbdf0f138fc9000
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/block/rsxx/dev.c:200:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (enable_blkdev) {
^~~~~~~~~~~~~
drivers/block/rsxx/dev.c:212:6: note: uninitialized use occurs here
if (err)
^~~
drivers/block/rsxx/dev.c:200:2: note: remove the 'if' if its condition is always true
if (enable_blkdev) {
^~~~~~~~~~~~~~~~~~~
drivers/block/rsxx/dev.c:195:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
1 warning generated.
vim +200 drivers/block/rsxx/dev.c
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 192
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 193 int rsxx_attach_dev(struct rsxx_cardinfo *card)
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 194 {
75577f3e8b2f2a Luis Chamberlain 2021-07-13 195 int err;
75577f3e8b2f2a Luis Chamberlain 2021-07-13 196
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 197 mutex_lock(&card->dev_lock);
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 198
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 199 /* The block device requires the stripe size from the config. */
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 @200 if (enable_blkdev) {
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 201 if (card->config_valid)
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 202 set_capacity(card->gendisk, card->size8 >> 9);
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 203 else
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 204 set_capacity(card->gendisk, 0);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 205 err = device_add_disk(CARD_TO_DEV(card), card->gendisk, NULL);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 206 if (err == 0)
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 207 card->bdev_attached = 1;
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 208 }
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 209
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 210 mutex_unlock(&card->dev_lock);
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 211
75577f3e8b2f2a Luis Chamberlain 2021-07-13 212 if (err)
75577f3e8b2f2a Luis Chamberlain 2021-07-13 213 blk_cleanup_disk(card->gendisk);
75577f3e8b2f2a Luis Chamberlain 2021-07-13 214
75577f3e8b2f2a Luis Chamberlain 2021-07-13 215 return err;
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 216 }
8722ff8cdbfac9 josh.h.morris(a)us.ibm.com 2013-02-05 217
:::::: The code at line 200 was first introduced by commit
:::::: 8722ff8cdbfac9c1b20e67bb067b455c48cb8e93 block: IBM RamSan 70/80 device driver
:::::: TO: josh.h.morris(a)us.ibm.com <josh.h.morris(a)us.ibm.com>
:::::: CC: Jens Axboe <axboe(a)kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [Intel-wired-lan] [PATCH v6 intel-next 3/9] ice: split ice_ring onto Tx/Rx separate structs
by kernel test robot
Hi Maciej,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tnguy-next-queue/dev-queue]
[cannot apply to v5.14-rc6 next-20210818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Maciej-Fijalkowski/XDP_TX-improv...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/8efea0970271c16b9bab35cf49ce219c1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Maciej-Fijalkowski/XDP_TX-improvements-for-ice/20210818-221906
git checkout 8efea0970271c16b9bab35cf49ce219c16a7479b
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/intel/ice/ice_eswitch.c: In function 'ice_eswitch_remap_rings_to_vectors':
>> drivers/net/ethernet/intel/ice/ice_eswitch.c:97:16: error: 'struct ice_ring_container' has no member named 'ring'; did you mean 'rx_ring'?
97 | q_vector->tx.ring = tx_ring;
| ^~~~
| rx_ring
>> drivers/net/ethernet/intel/ice/ice_eswitch.c:100:21: error: 'netdev' undeclared (first use in this function); did you mean 'net_eq'?
100 | tx_ring->netdev = netdev;
| ^~~~~~
| net_eq
drivers/net/ethernet/intel/ice/ice_eswitch.c:100:21: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/ethernet/intel/ice/ice_eswitch.c:107:16: error: 'struct ice_ring_container' has no member named 'ring'; did you mean 'rx_ring'?
107 | q_vector->rx.ring = rx_ring;
| ^~~~
| rx_ring
drivers/net/ethernet/intel/ice/ice_eswitch.c: In function 'ice_eswitch_set_rxdid':
>> drivers/net/ethernet/intel/ice/ice_eswitch.c:382:27: error: initialization of 'struct ice_ring *' from incompatible pointer type 'struct ice_rx_ring *' [-Werror=incompatible-pointer-types]
382 | struct ice_ring *ring = vsi->rx_rings[i];
| ^~~
>> drivers/net/ethernet/intel/ice/ice_eswitch.c:383:31: error: dereferencing pointer to incomplete type 'struct ice_ring'
383 | u16 pf_q = vsi->rxq_map[ring->q_index];
| ^~
cc1: some warnings being treated as errors
vim +97 drivers/net/ethernet/intel/ice/ice_eswitch.c
bc0412448da587 Grzegorz Nitka 2021-08-03 70
bc0412448da587 Grzegorz Nitka 2021-08-03 71 /**
bc0412448da587 Grzegorz Nitka 2021-08-03 72 * ice_eswitch_remap_rings_to_vectors - reconfigure rings of switchdev ctrl VSI
bc0412448da587 Grzegorz Nitka 2021-08-03 73 * @pf: pointer to PF struct
bc0412448da587 Grzegorz Nitka 2021-08-03 74 *
bc0412448da587 Grzegorz Nitka 2021-08-03 75 * In switchdev number of allocated Tx/Rx rings is equal.
bc0412448da587 Grzegorz Nitka 2021-08-03 76 *
bc0412448da587 Grzegorz Nitka 2021-08-03 77 * This function fills q_vectors structures associated with representator and
bc0412448da587 Grzegorz Nitka 2021-08-03 78 * move each ring pairs to port representator netdevs. Each port representor
bc0412448da587 Grzegorz Nitka 2021-08-03 79 * will have dedicated 1 Tx/Rx ring pair, so number of rings pair is equal to
bc0412448da587 Grzegorz Nitka 2021-08-03 80 * number of VFs.
bc0412448da587 Grzegorz Nitka 2021-08-03 81 */
bc0412448da587 Grzegorz Nitka 2021-08-03 82 static void ice_eswitch_remap_rings_to_vectors(struct ice_pf *pf)
bc0412448da587 Grzegorz Nitka 2021-08-03 83 {
bc0412448da587 Grzegorz Nitka 2021-08-03 84 struct ice_vsi *vsi = pf->switchdev.control_vsi;
bc0412448da587 Grzegorz Nitka 2021-08-03 85 int q_id;
bc0412448da587 Grzegorz Nitka 2021-08-03 86
bc0412448da587 Grzegorz Nitka 2021-08-03 87 ice_for_each_txq(vsi, q_id) {
bc0412448da587 Grzegorz Nitka 2021-08-03 88 struct ice_repr *repr = pf->vf[q_id].repr;
bc0412448da587 Grzegorz Nitka 2021-08-03 89 struct ice_q_vector *q_vector = repr->q_vector;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 90 struct ice_tx_ring *tx_ring = vsi->tx_rings[q_id];
8efea0970271c1 Maciej Fijalkowski 2021-08-18 91 struct ice_rx_ring *rx_ring = vsi->rx_rings[q_id];
bc0412448da587 Grzegorz Nitka 2021-08-03 92
bc0412448da587 Grzegorz Nitka 2021-08-03 93 q_vector->vsi = vsi;
bc0412448da587 Grzegorz Nitka 2021-08-03 94 q_vector->reg_idx = vsi->q_vectors[0]->reg_idx;
bc0412448da587 Grzegorz Nitka 2021-08-03 95
bc0412448da587 Grzegorz Nitka 2021-08-03 96 q_vector->num_ring_tx = 1;
bc0412448da587 Grzegorz Nitka 2021-08-03 @97 q_vector->tx.ring = tx_ring;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 98 tx_ring->q_vector = q_vector;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 99 tx_ring->next = NULL;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 @100 tx_ring->netdev = netdev;
bc0412448da587 Grzegorz Nitka 2021-08-03 101 /* In switchdev mode, from OS stack perspective, there is only
bc0412448da587 Grzegorz Nitka 2021-08-03 102 * one queue for given netdev, so it needs to be indexed as 0.
bc0412448da587 Grzegorz Nitka 2021-08-03 103 */
bc0412448da587 Grzegorz Nitka 2021-08-03 104 tx_ring->q_index = 0;
bc0412448da587 Grzegorz Nitka 2021-08-03 105
bc0412448da587 Grzegorz Nitka 2021-08-03 106 q_vector->num_ring_rx = 1;
bc0412448da587 Grzegorz Nitka 2021-08-03 107 q_vector->rx.ring = rx_ring;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 108 rx_ring->q_vector = q_vector;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 109 rx_ring->next = NULL;
8efea0970271c1 Maciej Fijalkowski 2021-08-18 110 rx_ring->netdev = netdev;
bc0412448da587 Grzegorz Nitka 2021-08-03 111 }
bc0412448da587 Grzegorz Nitka 2021-08-03 112 }
bc0412448da587 Grzegorz Nitka 2021-08-03 113
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [RFC PATCH 2/3] drivers/net/virtio_net: Added basic RSS support.
by kernel test robot
Hi Andrew,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on net-next/master net/master linus/master v5.14-rc6 next-20210818]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Andrew-Melnychenko/drivers-net-v...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: i386-randconfig-a015-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/e731fc592ef2151e3a1fe044fa182517a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andrew-Melnychenko/drivers-net-virtio_net-Added-RSS-support/20210819-015744
git checkout e731fc592ef2151e3a1fe044fa182517adb1e47e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/virtio_net.c:2476:5: warning: no previous prototype for function 'virtnet_get_rxfh_key_size' [-Wmissing-prototypes]
u32 virtnet_get_rxfh_key_size(struct net_device *dev)
^
drivers/net/virtio_net.c:2476:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 virtnet_get_rxfh_key_size(struct net_device *dev)
^
static
>> drivers/net/virtio_net.c:2481:5: warning: no previous prototype for function 'virtnet_get_rxfh_indir_size' [-Wmissing-prototypes]
u32 virtnet_get_rxfh_indir_size(struct net_device *dev)
^
drivers/net/virtio_net.c:2481:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 virtnet_get_rxfh_indir_size(struct net_device *dev)
^
static
>> drivers/net/virtio_net.c:2486:5: warning: no previous prototype for function 'virtnet_get_rxfh' [-Wmissing-prototypes]
int virtnet_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, u8 *hfunc)
^
drivers/net/virtio_net.c:2486:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, u8 *hfunc)
^
static
>> drivers/net/virtio_net.c:2505:5: warning: no previous prototype for function 'virtnet_set_rxfh' [-Wmissing-prototypes]
int virtnet_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc)
^
drivers/net/virtio_net.c:2505:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc)
^
static
drivers/net/virtio_net.c:2535:2: error: 'default' statement not in switch statement
default:
^
>> drivers/net/virtio_net.c:2525:5: warning: no previous prototype for function 'virtnet_get_rxnfc' [-Wmissing-prototypes]
int virtnet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs)
^
drivers/net/virtio_net.c:2525:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int virtnet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs)
^
static
drivers/net/virtio_net.c:2539:2: error: expected identifier or '('
return rc;
^
drivers/net/virtio_net.c:2540:1: error: extraneous closing brace ('}')
}
^
5 warnings and 3 errors generated.
vim +/virtnet_get_rxfh_key_size +2476 drivers/net/virtio_net.c
2475
> 2476 u32 virtnet_get_rxfh_key_size(struct net_device *dev)
2477 {
2478 return ((struct virtnet_info *)netdev_priv(dev))->rss_key_size;
2479 }
2480
> 2481 u32 virtnet_get_rxfh_indir_size(struct net_device *dev)
2482 {
2483 return ((struct virtnet_info *)netdev_priv(dev))->rss_indir_table_size;
2484 }
2485
> 2486 int virtnet_get_rxfh(struct net_device *dev, u32 *indir, u8 *key, u8 *hfunc)
2487 {
2488 struct virtnet_info *vi = netdev_priv(dev);
2489 int i;
2490
2491 if (indir) {
2492 for (i = 0; i < vi->rss_indir_table_size; ++i)
2493 indir[i] = vi->ctrl->rss.indirection_table[i];
2494 }
2495
2496 if (key)
2497 memcpy(key, vi->ctrl->rss.key, vi->rss_key_size);
2498
2499 if (hfunc)
2500 *hfunc = ETH_RSS_HASH_TOP;
2501
2502 return 0;
2503 }
2504
> 2505 int virtnet_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, const u8 hfunc)
2506 {
2507 struct virtnet_info *vi = netdev_priv(dev);
2508 int i;
2509
2510 if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
2511 return -EOPNOTSUPP;
2512
2513 if (indir) {
2514 for (i = 0; i < vi->rss_indir_table_size; ++i)
2515 vi->ctrl->rss.indirection_table[i] = indir[i];
2516 }
2517 if (key)
2518 memcpy(vi->ctrl->rss.key, key, vi->rss_key_size);
2519
2520 virtnet_commit_rss_command(vi);
2521
2522 return 0;
2523 }
2524
> 2525 int virtnet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs)
2526 {
2527 struct virtnet_info *vi = netdev_priv(dev);
2528 int rc = 0;
2529
2530 switch (info->cmd) {
2531 case ETHTOOL_GRXRINGS:
2532 info->data = vi->curr_queue_pairs;
2533 rc = -EOPNOTSUPP;
2534 }
2535 default:
2536 rc = -EOPNOTSUPP;
2537 }
2538
2539 return rc;
2540 }
2541
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
[peterz-queue:perf/core 7/8] arch/x86/events/amd/ibs.c:829:5: error: redefinition of 'get_ibs_caps'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head: 0b8f94ea282357a79781d10024708c2cf0ff5305
commit: 10684f2b277c733c018c5d07ddb4aa980ba4fcc5 [7/8] perf/amd/uncore: Allow the driver to be built as a module
config: i386-randconfig-a011-20210818 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue perf/core
git checkout 10684f2b277c733c018c5d07ddb4aa980ba4fcc5
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/events/amd/ibs.c:829:5: error: redefinition of 'get_ibs_caps'
u32 get_ibs_caps(void)
^
arch/x86/include/asm/perf_event.h:426:19: note: previous definition is here
static inline u32 get_ibs_caps(void) { return 0; }
^
>> arch/x86/events/amd/ibs.c:838:10: error: implicit declaration of function 'setup_APIC_eilvt' [-Werror,-Wimplicit-function-declaration]
return !setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_NMI, 1);
^
arch/x86/events/amd/ibs.c:843:10: error: implicit declaration of function 'setup_APIC_eilvt' [-Werror,-Wimplicit-function-declaration]
return !setup_APIC_eilvt(offset, 0, 0, 1);
^
arch/x86/events/amd/ibs.c:987:7: error: implicit declaration of function 'setup_APIC_eilvt' [-Werror,-Wimplicit-function-declaration]
if (!setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_NMI, 0))
^
arch/x86/events/amd/ibs.c:1000:3: error: implicit declaration of function 'setup_APIC_eilvt' [-Werror,-Wimplicit-function-declaration]
setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_FIX, 1);
^
5 errors generated.
vim +/get_ibs_caps +829 arch/x86/events/amd/ibs.c
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 828
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 @829 u32 get_ibs_caps(void)
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 830 {
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 831 return ibs_caps;
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 832 }
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 833
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 834 EXPORT_SYMBOL(get_ibs_caps);
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 835
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 836 static inline int get_eilvt(int offset)
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 837 {
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 @838 return !setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_NMI, 1);
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 839 }
b716916679e720 arch/x86/kernel/cpu/perf_event_amd_ibs.c Robert Richter 2011-09-21 840
:::::: The code at line 829 was first introduced by commit
:::::: b716916679e72054d436afadce2f94dcad71cfad perf, x86: Implement IBS initialization
:::::: TO: Robert Richter <robert.richter(a)amd.com>
:::::: CC: Ingo Molnar <mingo(a)elte.hu>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] misc/pvpanic: fix set driver data
by kernel test robot
Hi Mihai,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linus/master v5.14-rc6 next-20210818]
[cannot apply to linux/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mihai-Carabas/misc-pvpanic-fix-s...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 09cbd1df7d2615c19e40facbe31fdcb5f1ebfa96
config: riscv-randconfig-r042-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d2b574a4dea5b718e4386bf2e26af0126e5978ce)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/d0d6a877210c6d9ac4505c8864294dbd9...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mihai-Carabas/misc-pvpanic-fix-set-driver-data/20210819-003204
git checkout d0d6a877210c6d9ac4505c8864294dbd975f31b1
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=riscv SHELL=/bin/bash drivers/misc/pvpanic/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/misc/pvpanic/pvpanic-pci.c:99:18: error: use of undeclared identifier 'dev'; did you mean 'pdev'?
dev_set_drvdata(dev, pi);
^~~
pdev
drivers/misc/pvpanic/pvpanic-pci.c:73:46: note: 'pdev' declared here
static int pvpanic_pci_probe(struct pci_dev *pdev,
^
1 error generated.
vim +99 drivers/misc/pvpanic/pvpanic-pci.c
72
73 static int pvpanic_pci_probe(struct pci_dev *pdev,
74 const struct pci_device_id *ent)
75 {
76 struct pvpanic_instance *pi;
77 void __iomem *base;
78 int ret;
79
80 ret = pcim_enable_device(pdev);
81 if (ret < 0)
82 return ret;
83
84 base = pcim_iomap(pdev, 0, 0);
85 if (!base)
86 return -ENOMEM;
87
88 pi = devm_kmalloc(&pdev->dev, sizeof(*pi), GFP_KERNEL);
89 if (!pi)
90 return -ENOMEM;
91
92 pi->base = base;
93 pi->capability = PVPANIC_PANICKED | PVPANIC_CRASH_LOADED;
94
95 /* initlize capability by RDPT */
96 pi->capability &= ioread8(base);
97 pi->events = pi->capability;
98
> 99 dev_set_drvdata(dev, pi);
100
101 return devm_pvpanic_probe(&pdev->dev, pi);
102 }
103
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month