[peterz-queue:locking/ww_rt_mutex 4/18] lib/test_lockup.c:505:43: error: 'raw_spinlock_t' {aka 'struct raw_spinlock'} has no member named 'rlock'; did you mean 'raw_lock'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/ww_rt_mutex
head: 401531ec0e4c84f3d26d07d1171f893fee6a08aa
commit: 511b1625b0aa486360862d240d93d54c005ccaf0 [4/18] locking/mutex: Make mutex::wait_lock raw
config: nios2-buildonly-randconfig-r003-20210718 (attached as .config)
compiler: nios2-linux-gcc (GCC) 10.3.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://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 locking/ww_rt_mutex
git checkout 511b1625b0aa486360862d240d93d54c005ccaf0
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash lib/
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 >>):
In file included from <command-line>:
lib/test_lockup.c: In function 'test_lockup_init':
>> lib/test_lockup.c:505:43: error: 'raw_spinlock_t' {aka 'struct raw_spinlock'} has no member named 'rlock'; did you mean 'raw_lock'?
505 | offsetof(struct mutex, wait_lock.rlock.magic),
| ^~~~~
include/linux/compiler_types.h:140:57: note: in definition of macro '__compiler_offsetof'
140 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
| ^
lib/test_lockup.c:505:10: note: in expansion of macro 'offsetof'
505 | offsetof(struct mutex, wait_lock.rlock.magic),
| ^~~~~~~~
vim +505 lib/test_lockup.c
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 448
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 449 static int __init test_lockup_init(void)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 450 {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 451 u64 test_start = local_clock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 452
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 453 main_task = current;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 454
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 455 switch (state[0]) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 456 case 'S':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 457 wait_state = TASK_INTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 458 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 459 case 'D':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 460 wait_state = TASK_UNINTERRUPTIBLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 461 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 462 case 'K':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 463 wait_state = TASK_KILLABLE;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 464 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 465 case 'R':
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 466 wait_state = TASK_RUNNING;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 467 break;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 468 default:
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 469 pr_err("unknown state=%s\n", state);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 470 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 471 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 472
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 473 if (alloc_pages_atomic)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 474 alloc_pages_gfp = GFP_ATOMIC;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 475
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 476 if (test_kernel_ptr(lock_spinlock_ptr, sizeof(spinlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 477 test_kernel_ptr(lock_rwlock_ptr, sizeof(rwlock_t)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 478 test_kernel_ptr(lock_mutex_ptr, sizeof(struct mutex)) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 479 test_kernel_ptr(lock_rwsem_ptr, sizeof(struct rw_semaphore)))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 480 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 481
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 482 #ifdef CONFIG_DEBUG_SPINLOCK
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 483 #ifdef CONFIG_PREEMPT_RT
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 484 if (test_magic(lock_spinlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 485 offsetof(spinlock_t, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 486 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 487 test_magic(lock_rwlock_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 488 offsetof(rwlock_t, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 489 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 490 test_magic(lock_mutex_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 491 offsetof(struct mutex, lock.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 492 SPINLOCK_MAGIC) ||
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 493 test_magic(lock_rwsem_ptr,
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 494 offsetof(struct rw_semaphore, rtmutex.wait_lock.magic),
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 495 SPINLOCK_MAGIC))
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 496 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 497 #else
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 498 if (test_magic(lock_spinlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 499 offsetof(spinlock_t, rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 500 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 501 test_magic(lock_rwlock_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 502 offsetof(rwlock_t, magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 503 RWLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 504 test_magic(lock_mutex_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @505 offsetof(struct mutex, wait_lock.rlock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 506 SPINLOCK_MAGIC) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 507 test_magic(lock_rwsem_ptr,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 508 offsetof(struct rw_semaphore, wait_lock.magic),
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 509 SPINLOCK_MAGIC))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 510 return -EINVAL;
45e3d5a2af1d53 Sebastian Andrzej Siewior 2020-12-15 511 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 512 #endif
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 513
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 514 if ((wait_state != TASK_RUNNING ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 515 (call_cond_resched && !reacquire_locks) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 516 (alloc_pages_nr && gfpflags_allow_blocking(alloc_pages_gfp))) &&
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 517 (test_disable_irq || disable_softirq || disable_preempt ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 518 lock_rcu || lock_spinlock_ptr || lock_rwlock_ptr)) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 519 pr_err("refuse to sleep in atomic context\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 520 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 521 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 522
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 523 if (lock_mmap_sem && !main_task->mm) {
c1e8d7c6a7a682 Michel Lespinasse 2020-06-08 524 pr_err("no mm to lock mmap_lock\n");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 525 return -EINVAL;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 526 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 527
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 528 if (test_file_path[0]) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 529 test_file = filp_open(test_file_path, O_RDONLY, 0);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 530 if (IS_ERR(test_file)) {
3adf3bae0d6123 Tiezhu Yang 2020-08-11 531 pr_err("failed to open %s: %ld\n", test_file_path, PTR_ERR(test_file));
3adf3bae0d6123 Tiezhu Yang 2020-08-11 532 return PTR_ERR(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 533 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 534 test_inode = file_inode(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 535 } else if (test_lock_inode ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 536 test_lock_mapping ||
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 537 test_lock_sb_umount) {
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 538 pr_err("no file to lock\n");
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 539 return -EINVAL;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 540 }
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 541
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 542 if (test_lock_inode && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 543 lock_rwsem_ptr = (unsigned long)&test_inode->i_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 544
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 545 if (test_lock_mapping && test_file && test_file->f_mapping)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 546 lock_rwsem_ptr = (unsigned long)&test_file->f_mapping->i_mmap_rwsem;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 547
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 548 if (test_lock_sb_umount && test_inode)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 549 lock_rwsem_ptr = (unsigned long)&test_inode->i_sb->s_umount;
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 550
ad3f434b87e7d2 Colin Ian King 2020-04-06 551 pr_notice("START pid=%d time=%u +%u ns cooldown=%u +%u ns iterations=%u state=%s %s%s%s%s%s%s%s%s%s%s%s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 552 main_task->pid, time_secs, time_nsecs,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 553 cooldown_secs, cooldown_nsecs, iterations, state,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 554 all_cpus ? "all_cpus " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 555 iowait ? "iowait " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 556 test_disable_irq ? "disable_irq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 557 disable_softirq ? "disable_softirq " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 558 disable_preempt ? "disable_preempt " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 559 lock_rcu ? "lock_rcu " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 560 lock_read ? "lock_read " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 561 touch_softlockup ? "touch_softlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 562 touch_hardlockup ? "touch_hardlockup " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 563 call_cond_resched ? "call_cond_resched " : "",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 564 reacquire_locks ? "reacquire_locks " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 565
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 566 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 567 pr_notice("ALLOCATE PAGES nr=%u order=%u gfp=%pGg %s\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 568 alloc_pages_nr, alloc_pages_order, &alloc_pages_gfp,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 569 reallocate_pages ? "reallocate_pages " : "");
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 570
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 571 if (all_cpus) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 572 unsigned int cpu;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 573
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 574 cpus_read_lock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 575
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 576 preempt_disable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 577 master_cpu = smp_processor_id();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 578 for_each_online_cpu(cpu) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 579 INIT_WORK(per_cpu_ptr(&test_works, cpu), test_work_fn);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 580 queue_work_on(cpu, system_highpri_wq,
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 581 per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 582 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 583 preempt_enable();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 584
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 585 for_each_online_cpu(cpu)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 586 flush_work(per_cpu_ptr(&test_works, cpu));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 587
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 588 cpus_read_unlock();
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 589 } else {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 590 test_lockup(true);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 591 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 592
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 593 if (measure_lock_wait)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 594 pr_notice("Maximum lock wait: %lld ns\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 595 atomic64_read(&max_lock_wait));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 596
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 597 if (alloc_pages_nr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 598 pr_notice("Page allocation failed %u times\n",
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 599 atomic_read(&alloc_pages_failed));
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 600
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 601 pr_notice("FINISH in %llu ns\n", local_clock() - test_start);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 602
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 603 if (test_file)
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 604 fput(test_file);
aecd42df6d3993 Konstantin Khlebnikov 2020-04-06 605
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 606 if (signal_pending(main_task))
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 607 return -EINTR;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 608
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 609 return -EAGAIN;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 610 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 611 module_init(test_lockup_init);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 612
:::::: The code at line 505 was first introduced by commit
:::::: 30428ef5d1e8caf78639cc70a802f1cb7b1cec04 lib/test_lockup: test module to generate lockups
:::::: TO: Konstantin Khlebnikov <khlebnikov(a)yandex-team.ru>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
drivers/net/ethernet/google/gve/gve_tx_dqo.c:753:25: warning: variable 'buf' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2734d6c1b1a089fb593ef6a23d4b70903526fe0c
commit: a57e5de476be0b4b7f42beb6a21c19ad9c577aa3 gve: DQO: Add TX path
date: 3 weeks ago
config: i386-randconfig-r035-20210719 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a57e5de476be0b4b7f42beb6a21c19ad9c577aa3
# save the attached .config to linux build tree
make W=1 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/ethernet/google/gve/gve_tx_dqo.c: In function 'gve_tx_clean_pending_packets':
drivers/net/ethernet/google/gve/gve_tx_dqo.c:88:27: warning: unused variable 'buf' [-Wunused-variable]
88 | struct gve_tx_dma_buf *buf = &cur_state->bufs[j];
| ^~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c: In function 'gve_tx_add_skb_no_copy_dqo':
drivers/net/ethernet/google/gve/gve_tx_dqo.c:496:26: warning: unused variable 'buf' [-Wunused-variable]
496 | struct gve_tx_dma_buf *buf =
| ^~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c:515:26: warning: unused variable 'buf' [-Wunused-variable]
515 | struct gve_tx_dma_buf *buf =
| ^~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c:556:26: warning: unused variable 'buf' [-Wunused-variable]
556 | struct gve_tx_dma_buf *buf = &pending_packet->bufs[i];
| ^~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c: In function 'remove_from_list':
drivers/net/ethernet/google/gve/gve_tx_dqo.c:730:6: warning: variable 'index' set but not used [-Wunused-but-set-variable]
730 | s16 index, prev_index, next_index;
| ^~~~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c: In function 'gve_unmap_packet':
>> drivers/net/ethernet/google/gve/gve_tx_dqo.c:753:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
753 | struct gve_tx_dma_buf *buf;
| ^~~
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:17,
from arch/x86/include/asm/percpu.h:27,
from arch/x86/include/asm/current.h:6,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from drivers/net/ethernet/google/gve/gve.h:10,
from drivers/net/ethernet/google/gve/gve_tx_dqo.c:7:
drivers/net/ethernet/google/gve/gve_tx_dqo.c: In function 'remove_miss_completions':
include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:343:9: note: in expansion of macro 'KERN_ERR'
343 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
include/linux/net.h:247:3: note: in expansion of macro 'pr_err'
247 | function(__VA_ARGS__); \
| ^~~~~~~~
include/linux/net.h:257:2: note: in expansion of macro 'net_ratelimited_function'
257 | net_ratelimited_function(pr_err, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/google/gve/gve_tx_dqo.c:893:3: note: in expansion of macro 'net_err_ratelimited'
893 | net_err_ratelimited("%s: No reinjection completion was received for: %ld.\n",
| ^~~~~~~~~~~~~~~~~~~
vim +/buf +753 drivers/net/ethernet/google/gve/gve_tx_dqo.c
749
750 static void gve_unmap_packet(struct device *dev,
751 struct gve_tx_pending_packet_dqo *pending_packet)
752 {
> 753 struct gve_tx_dma_buf *buf;
754 int i;
755
756 /* SKB linear portion is guaranteed to be mapped */
757 buf = &pending_packet->bufs[0];
758 dma_unmap_single(dev, dma_unmap_addr(buf, dma),
759 dma_unmap_len(buf, len), DMA_TO_DEVICE);
760 for (i = 1; i < pending_packet->num_bufs; i++) {
761 buf = &pending_packet->bufs[i];
762 dma_unmap_page(dev, dma_unmap_addr(buf, dma),
763 dma_unmap_len(buf, len), DMA_TO_DEVICE);
764 }
765 pending_packet->num_bufs = 0;
766 }
767
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-chenxing:mstar_v5_14_rebase_i2_drm 156/349] drivers/dma/mstar/mstar-msc313-cmdq.c:142:6: warning: no previous prototype for 'msc313_cmdq_issue_pending'
by kernel test robot
tree: git://github.com/linux-chenxing/linux.git mstar_v5_14_rebase_i2_drm
head: 93dfb2364436067bf34c6d4ddcd282496182cc0f
commit: 8104b59f2bd1ea881f923e9de519dfd639185995 [156/349] MSC313: CMDQ dma
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 10.3.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/linux-chenxing/linux/commit/8104b59f2bd1ea881f923e9de5...
git remote add linux-chenxing git://github.com/linux-chenxing/linux.git
git fetch --no-tags linux-chenxing mstar_v5_14_rebase_i2_drm
git checkout 8104b59f2bd1ea881f923e9de519dfd639185995
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=s390
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/dma/mstar/mstar-msc313-cmdq.c: In function 'msc313_cmdq_irq':
drivers/dma/mstar/mstar-msc313-cmdq.c:132:22: warning: unused variable 'cmdq' [-Wunused-variable]
132 | struct msc313_cmdq *cmdq = data;
| ^~~~
drivers/dma/mstar/mstar-msc313-cmdq.c: At top level:
>> drivers/dma/mstar/mstar-msc313-cmdq.c:142:6: warning: no previous prototype for 'msc313_cmdq_issue_pending' [-Wmissing-prototypes]
142 | void msc313_cmdq_issue_pending(struct dma_chan *chan){
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/mstar/mstar-msc313-cmdq.c: In function 'msc313_tx_submit':
>> drivers/dma/mstar/mstar-msc313-cmdq.c:148:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
148 | struct msc313_cmdq_desc *desc = to_desc(tx);
| ^~~~~~
vim +/msc313_cmdq_issue_pending +142 drivers/dma/mstar/mstar-msc313-cmdq.c
141
> 142 void msc313_cmdq_issue_pending(struct dma_chan *chan){
143 printk("cmdq issue pending\n");
144 }
145
146 static dma_cookie_t msc313_tx_submit(struct dma_async_tx_descriptor *tx){
147 struct msc313_cmdq_chan *chan = to_chan(tx->chan);
> 148 struct msc313_cmdq_desc *desc = to_desc(tx);
149 list_add_tail(&desc->queue_node, &chan->queue);
150 return chan->cookie++;
151 }
152
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[frank-w-bpi-r2-4.14:5.14-hdmilarb2 42/48] drivers/iommu/of_iommu.c:30:9: sparse: sparse: non size-preserving pointer to integer cast
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.14-hdmilarb2
head: 77b4c96140f9bec5bb54fc804b401af1c9a6b4b5
commit: a03e47787fdf1b8cf17dff02113ca385b4aaa131 [42/48] iommu, more debug
config: sparc-randconfig-s031-20210718 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/frank-w/BPI-R2-4.14/commit/a03e47787fdf1b8cf17dff02113...
git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.14-hdmilarb2
git checkout a03e47787fdf1b8cf17dff02113ca385b4aaa131
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc SHELL=/bin/bash drivers/iommu/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/iommu/of_iommu.c:30:9: sparse: sparse: non size-preserving pointer to integer cast
drivers/iommu/of_iommu.c:32:17: sparse: sparse: non size-preserving pointer to integer cast
vim +30 drivers/iommu/of_iommu.c
21
22 static int of_iommu_xlate(struct device *dev,
23 struct of_phandle_args *iommu_spec)
24 {
25 const struct iommu_ops *ops;
26 struct fwnode_handle *fwnode = &iommu_spec->np->fwnode;
27 int ret;
28
29 ops = iommu_ops_from_fwnode(fwnode);
> 30 dev_err(dev,"%s:%d ops:%08x",__FUNCTION__,__LINE__,(unsigned int)ops);
31 if (ops)
32 dev_err(dev,"%s:%d xlate:%08x",__FUNCTION__,__LINE__,(unsigned int)ops->of_xlate);
33
34 if ((ops && !ops->of_xlate) ||
35 !of_device_is_available(iommu_spec->np))
36 {
37 dev_err(dev,"no iommu");
38 return NO_IOMMU;
39 }
40 ret = iommu_fwspec_init(dev, &iommu_spec->np->fwnode, ops);
41 if (ret)
42 return ret;
43 /*
44 * The otherwise-empty fwspec handily serves to indicate the specific
45 * IOMMU device we're waiting for, which will be useful if we ever get
46 * a proper probe-ordering dependency mechanism in future.
47 */
48 if (!ops)
49 return driver_deferred_probe_check_state(dev);
50
51 if (!try_module_get(ops->owner))
52 return -ENODEV;
53
54 ret = ops->of_xlate(dev, iommu_spec);
55 module_put(ops->owner);
56 return ret;
57 }
58
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v2 01/12] KVM: x86: Report host tsc and realtime values in KVM_GET_CLOCK
by kernel test robot
Hi Oliver,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kvm/queue]
[also build test ERROR on vhost/linux-next v5.14-rc2 next-20210716]
[cannot apply to kvmarm/next]
[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/Oliver-Upton/KVM-Add-idempotent-...
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
config: i386-randconfig-a013-20210718 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/72b6d584e6ac692038a7d70e8782f0dfa...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Oliver-Upton/KVM-Add-idempotent-controls-for-migrating-system-counter-state/20210718-103407
git checkout 72b6d584e6ac692038a7d70e8782f0dfa179e5fb
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/kvm/x86.c: In function 'get_kvmclock_and_realtime':
>> arch/x86/kvm/x86.c:2818:7: error: implicit declaration of function 'kvm_get_walltime_and_clockread' [-Werror=implicit-function-declaration]
2818 | if (kvm_get_walltime_and_clockread(&ts, &tsc_val)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/kvm_get_walltime_and_clockread +2818 arch/x86/kvm/x86.c
2782
2783 /**
2784 * Returns true if realtime and TSC values were written back to the caller.
2785 * Returns false if a clock triplet cannot be obtained, such as if the host's
2786 * realtime clock is not based on the TSC.
2787 */
2788 static bool get_kvmclock_and_realtime(struct kvm *kvm, u64 *kvmclock_ns,
2789 u64 *realtime_ns, u64 *tsc)
2790 {
2791 struct kvm_arch *ka = &kvm->arch;
2792 struct pvclock_vcpu_time_info hv_clock;
2793 unsigned long flags;
2794 bool ret = false;
2795
2796 spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags);
2797 if (!ka->use_master_clock) {
2798 spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags);
2799 *kvmclock_ns = get_kvmclock_base_ns() + ka->kvmclock_offset;
2800 return false;
2801 }
2802
2803 hv_clock.tsc_timestamp = ka->master_cycle_now;
2804 hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
2805 spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags);
2806
2807 /* both __this_cpu_read() and rdtsc() should be on the same cpu */
2808 get_cpu();
2809
2810 if (__this_cpu_read(cpu_tsc_khz)) {
2811 struct timespec64 ts;
2812 u64 tsc_val;
2813
2814 kvm_get_time_scale(NSEC_PER_SEC, __this_cpu_read(cpu_tsc_khz) * 1000LL,
2815 &hv_clock.tsc_shift,
2816 &hv_clock.tsc_to_system_mul);
2817
> 2818 if (kvm_get_walltime_and_clockread(&ts, &tsc_val)) {
2819 *realtime_ns = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
2820 *tsc = tsc_val;
2821 ret = true;
2822 }
2823
2824 *kvmclock_ns = __pvclock_read_cycles(&hv_clock, tsc_val);
2825 } else
2826 *kvmclock_ns = get_kvmclock_base_ns() + ka->kvmclock_offset;
2827
2828 put_cpu();
2829
2830 return ret;
2831 }
2832
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[hare-scsi-devel:auth.v4 10/11] configfs.c:undefined reference to `nvme_auth_dhgroup_id'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v4
head: d22f44dbe36eb82041e9e28db6a767c55c8d790e
commit: 37535123b7f58ea4eecceb2bf236f12446672efd [10/11] nvmet-auth: implement support for augmented challenge
config: riscv-randconfig-c004-20210718 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 10.3.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://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v4
git checkout 37535123b7f58ea4eecceb2bf236f12446672efd
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=riscv 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 >>):
riscv64-linux-ld: drivers/nvme/target/configfs.o: in function `nvmet_host_dhchap_dhgroup_store':
>> configfs.c:(.text+0x28): undefined reference to `nvme_auth_dhgroup_id'
>> riscv64-linux-ld: configfs.c:(.text+0x60): undefined reference to `nvme_auth_dhgroup_kpp'
riscv64-linux-ld: drivers/nvme/target/configfs.o: in function `nvmet_host_dhchap_dhgroup_show':
>> configfs.c:(.text+0xa0): undefined reference to `nvme_auth_dhgroup_name'
riscv64-linux-ld: drivers/nvme/target/configfs.o: in function `nvmet_host_dhchap_hash_show':
configfs.c:(.text+0x5a0): undefined reference to `nvme_auth_hmac_name'
riscv64-linux-ld: drivers/nvme/target/configfs.o: in function `nvmet_host_dhchap_hash_store':
configfs.c:(.text+0x608): undefined reference to `nvme_auth_hmac_id'
riscv64-linux-ld: configfs.c:(.text+0x618): undefined reference to `nvme_auth_hmac_name'
riscv64-linux-ld: drivers/nvme/target/fabrics-cmd-auth.o: in function `.L36':
fabrics-cmd-auth.c:(.text+0xe0): undefined reference to `nvme_auth_hmac_id'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `nvmet_auth_augmented_challenge':
>> auth.c:(.text+0x8c): undefined reference to `nvme_auth_hmac_id'
>> riscv64-linux-ld: auth.c:(.text+0x98): undefined reference to `nvme_auth_digest_name'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `.L0 ':
auth.c:(.text+0x298): undefined reference to `nvme_auth_hmac_name'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `.L40':
>> auth.c:(.text+0x434): undefined reference to `nvme_auth_dhgroup_kpp'
>> riscv64-linux-ld: auth.c:(.text+0x46c): undefined reference to `nvme_auth_dhgroup_pubkey_size'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `.L61':
auth.c:(.text+0x538): undefined reference to `nvme_auth_hmac_name'
riscv64-linux-ld: auth.c:(.text+0x574): undefined reference to `nvme_auth_extract_secret'
riscv64-linux-ld: auth.c:(.text+0x590): undefined reference to `nvme_auth_hmac_name'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `nvmet_auth_ctrl_exponential':
>> auth.c:(.text+0xdc0): undefined reference to `nvme_auth_dhgroup_pubkey_size'
riscv64-linux-ld: drivers/nvme/target/auth.o: in function `nvmet_auth_ctrl_sesskey':
auth.c:(.text+0x1008): undefined reference to `nvme_auth_dhgroup_privkey_size'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v6 1/2] iio: frequency: adrf6780: add support for ADRF6780
by kernel test robot
Hi Antoniu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on iio/togreg]
[also build test ERROR on linux/master linus/master v5.14-rc1 next-20210716]
[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/Antoniu-Miclaus/iio-frequency-ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 10.3.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/59f8f05a22397c9b919c512d1e28cbad5...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Antoniu-Miclaus/iio-frequency-adrf6780-add-support-for-ADRF6780/20210718-104320
git checkout 59f8f05a22397c9b919c512d1e28cbad5caf78a7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arc
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/iio/frequency/adrf6780.c: In function 'adrf6780_read_voltage_raw':
>> drivers/iio/frequency/adrf6780.c:161:17: error: invalid operands to binary & (have 'unsigned int *' and 'long unsigned int')
161 | if (!(read_val & ADRF6780_ADC_STATUS_MSK)) {
| ^
vim +161 drivers/iio/frequency/adrf6780.c
138
139 static int adrf6780_read_voltage_raw(struct adrf6780_dev *dev, unsigned int *read_val)
140 {
141 int ret;
142
143 mutex_lock(&dev->lock);
144
145 ret = adrf6780_spi_update_bits(dev, ADRF6780_REG_ADC_CONTROL,
146 ADRF6780_ADC_EN_MSK |
147 ADRF6780_ADC_CLOCK_EN_MSK |
148 ADRF6780_ADC_START_MSK,
149 FIELD_PREP(ADRF6780_ADC_EN_MSK, 1) |
150 FIELD_PREP(ADRF6780_ADC_CLOCK_EN_MSK, 1) |
151 FIELD_PREP(ADRF6780_ADC_START_MSK, 1));
152 if (ret)
153 goto exit;
154
155 usleep_range(200, 250);
156
157 ret = adrf6780_spi_read(dev, ADRF6780_REG_ADC_OUTPUT, read_val);
158 if (ret)
159 goto exit;
160
> 161 if (!(read_val & ADRF6780_ADC_STATUS_MSK)) {
162 ret = -EINVAL;
163 goto exit;
164 }
165
166 ret = adrf6780_spi_update_bits(dev, ADRF6780_REG_ADC_CONTROL,
167 ADRF6780_ADC_START_MSK,
168 FIELD_PREP(ADRF6780_ADC_START_MSK, 0));
169 if (ret)
170 goto exit;
171
172 ret = adrf6780_spi_read(dev, ADRF6780_REG_ADC_OUTPUT, read_val);
173
174 exit:
175 mutex_unlock(&dev->lock);
176 return ret;
177 }
178
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used
by kernel test robot
Hi Catherine,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2734d6c1b1a089fb593ef6a23d4b70903526fe0c
commit: 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc gve: Add support for raw addressing in the tx path
date: 7 months ago
config: i386-randconfig-r035-20210719 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6f007c6486d69967ac1d9e67df9ae9c77d49f1cc
# save the attached .config to linux build tree
make W=1 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/ethernet/google/gve/gve_tx.c: In function 'gve_tx_add_skb_no_copy':
>> drivers/net/ethernet/google/gve/gve_tx.c:507:25: warning: variable 'buf' set but not used [-Wunused-but-set-variable]
507 | struct gve_tx_dma_buf *buf;
| ^~~
vim +/buf +507 drivers/net/ethernet/google/gve/gve_tx.c
497
498 static int gve_tx_add_skb_no_copy(struct gve_priv *priv, struct gve_tx_ring *tx,
499 struct sk_buff *skb)
500 {
501 const struct skb_shared_info *shinfo = skb_shinfo(skb);
502 int hlen, payload_nfrags, l4_hdr_offset;
503 union gve_tx_desc *pkt_desc, *seg_desc;
504 struct gve_tx_buffer_state *info;
505 bool is_gso = skb_is_gso(skb);
506 u32 idx = tx->req & tx->mask;
> 507 struct gve_tx_dma_buf *buf;
508 u64 addr;
509 u32 len;
510 int i;
511
512 info = &tx->info[idx];
513 pkt_desc = &tx->desc[idx];
514
515 l4_hdr_offset = skb_checksum_start_offset(skb);
516 /* If the skb is gso, then we want only up to the tcp header in the first segment
517 * to efficiently replicate on each segment otherwise we want the linear portion
518 * of the skb (which will contain the checksum because skb->csum_start and
519 * skb->csum_offset are given relative to skb->head) in the first segment.
520 */
521 hlen = is_gso ? l4_hdr_offset + tcp_hdrlen(skb) : skb_headlen(skb);
522 len = skb_headlen(skb);
523
524 info->skb = skb;
525
526 addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE);
527 if (unlikely(dma_mapping_error(tx->dev, addr))) {
528 tx->dma_mapping_error++;
529 goto drop;
530 }
531 buf = &info->buf;
532 dma_unmap_len_set(buf, len, len);
533 dma_unmap_addr_set(buf, dma, addr);
534
535 payload_nfrags = shinfo->nr_frags;
536 if (hlen < len) {
537 /* For gso the rest of the linear portion of the skb needs to
538 * be in its own descriptor.
539 */
540 payload_nfrags++;
541 gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
542 1 + payload_nfrags, hlen, addr);
543
544 len -= hlen;
545 addr += hlen;
546 idx = (tx->req + 1) & tx->mask;
547 seg_desc = &tx->desc[idx];
548 gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
549 } else {
550 gve_tx_fill_pkt_desc(pkt_desc, skb, is_gso, l4_hdr_offset,
551 1 + payload_nfrags, hlen, addr);
552 }
553
554 for (i = 0; i < shinfo->nr_frags; i++) {
555 const skb_frag_t *frag = &shinfo->frags[i];
556
557 idx = (idx + 1) & tx->mask;
558 seg_desc = &tx->desc[idx];
559 len = skb_frag_size(frag);
560 addr = skb_frag_dma_map(tx->dev, frag, 0, len, DMA_TO_DEVICE);
561 if (unlikely(dma_mapping_error(tx->dev, addr))) {
562 tx->dma_mapping_error++;
563 goto unmap_drop;
564 }
565 buf = &tx->info[idx].buf;
566 tx->info[idx].skb = NULL;
567 dma_unmap_len_set(buf, len, len);
568 dma_unmap_addr_set(buf, dma, addr);
569
570 gve_tx_fill_seg_desc(seg_desc, skb, is_gso, len, addr);
571 }
572
573 return 1 + payload_nfrags;
574
575 unmap_drop:
576 i += (payload_nfrags == shinfo->nr_frags ? 1 : 2);
577 while (i--) {
578 idx--;
579 gve_tx_unmap_buf(tx->dev, &tx->info[idx & tx->mask]);
580 }
581 drop:
582 tx->dropped_pkt++;
583 return 0;
584 }
585
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months