Hi Prashant, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on net-next/master] [also build test ERROR on next-20191220] [cannot apply to net/master bpf-next/master bpf/master v5.5-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Prashant-Bhole/XDP-in-tx-path/20191226-103951 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 9f6cff995e98258b6b81cc864532f633e5b3a081 config: i386-randconfig-d001-20191225 (attached as .config) compiler: gcc-7 (Debian 7.5.0-3) 7.5.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot All errors (new ones prefixed by >>): ld: drivers/net/tap.o: in function `ptr_ring_unconsume': >> include/linux/ptr_ring.h:552: undefined reference to `tun_ptr_free' vim +552 include/linux/ptr_ring.h 2e0ab8ca83c122 Michael S. Tsirkin 2016-06-13 499 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 500 /* 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 501 * Return entries into ring. Destroy entries that don't fit. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 502 * 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 503 * Note: this is expected to be a rare slow path operation. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 504 * 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 505 * Note: producer lock is nested within consumer lock, so if you 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 506 * resize you must make sure all uses nest correctly. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 507 * In particular if you consume ring in interrupt or BH context, you must 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 508 * disable interrupts/BH when doing so. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 509 */ 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 510 static inline void ptr_ring_unconsume(struct ptr_ring *r, void **batch, int n, 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 511 void (*destroy)(void *)) 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 512 { 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 513 unsigned long flags; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 514 int head; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 515 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 516 spin_lock_irqsave(&r->consumer_lock, flags); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 517 spin_lock(&r->producer_lock); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 518 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 519 if (!r->size) 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 520 goto done; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 521 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 522 /* 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 523 * Clean out buffered entries (for simplicity). This way following code 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 524 * can test entries for NULL and if not assume they are valid. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 525 */ 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 526 head = r->consumer_head - 1; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 527 while (likely(head >= r->consumer_tail)) 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 528 r->queue[head--] = NULL; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 529 r->consumer_tail = r->consumer_head; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 530 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 531 /* 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 532 * Go over entries in batch, start moving head back and copy entries. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 533 * Stop when we run into previously unconsumed entries. 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 534 */ 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 535 while (n) { 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 536 head = r->consumer_head - 1; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 537 if (head < 0) 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 538 head = r->size - 1; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 539 if (r->queue[head]) { 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 540 /* This batch entry will have to be destroyed. */ 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 541 goto done; 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 542 } 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 543 r->queue[head] = batch[--n]; a259df36d1fbf2 Michael S. Tsirkin 2018-01-26 544 r->consumer_tail = head; a259df36d1fbf2 Michael S. Tsirkin 2018-01-26 545 /* matching READ_ONCE in __ptr_ring_empty for lockless tests */ a259df36d1fbf2 Michael S. Tsirkin 2018-01-26 546 WRITE_ONCE(r->consumer_head, head); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 547 } 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 548 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 549 done: 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 550 /* Destroy all entries left in the batch. */ 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 551 while (n) 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 @552 destroy(batch[--n]); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 553 spin_unlock(&r->producer_lock); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 554 spin_unlock_irqrestore(&r->consumer_lock, flags); 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 555 } 197a5212c3dd70 Michael S. Tsirkin 2017-05-17 556 :::::: The code at line 552 was first introduced by commit :::::: 197a5212c3dd70be267b5cd930be0fb68bb53018 ptr_ring: add ptr_ring_unconsume :::::: TO: Michael S. Tsirkin :::::: CC: David S. Miller --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation