delete NIC from poll list in process_backlog()

lx lxlenovostar at gmail.com
Tue Dec 23 03:59:05 EST 2014


hi all:
     I read the function of process_backlog, and I found it don't delete
the NIC form poll list. the codes is:

4321 static int process_backlog(struct napi_struct *napi, int quota)
4322 {
4323     int work = 0;
4324     struct softnet_data *sd = container_of(napi, struct softnet_data,
backlog);
4325
4326     /* Check if we have pending ipi, its better to send them now,
4327      * not waiting net_rx_action() end.
4328      */
4329     if (sd_has_rps_ipi_waiting(sd)) {
4330         local_irq_disable();
4331         net_rps_action_and_irq_enable(sd);
4332     }
4333
4334     napi->weight = weight_p;
4335     local_irq_disable();
4336     while (1) {
4337         struct sk_buff *skb;
4338
4339         while ((skb = __skb_dequeue(&sd->process_queue))) {
4340             local_irq_enable();
4341             __netif_receive_skb(skb);
4342             local_irq_disable();
4343             input_queue_head_incr(sd);
4344             if (++work >= quota) {
4345                 local_irq_enable();
4346                 return work;
4347             }
4348         }
4349
4350         rps_lock(sd);
4351         if (skb_queue_empty(&sd->input_pkt_queue)) {
4352             /*
4353              * Inline a custom version of __napi_complete().
4354              * only current cpu owns and manipulates this napi,
4355              * and NAPI_STATE_SCHED is the only possible flag set
4356              * on backlog.
4357              * We can use a plain write instead of clear_bit(),
4358              * and we dont need an smp_mb() memory barrier.
4359              */
4360             napi->state = 0;
4361             rps_unlock(sd);
4362
4363             break;
4364         }
4365
4366         skb_queue_splice_tail_init(&sd->input_pkt_queue,
4367                        &sd->process_queue);
4368         rps_unlock(sd);
4369     }
4370     local_irq_enable();
4371
4372     return work;
4373 }

I think we should delete the NIC from the poll list by:
list_del(&napi->poll_list);

and my git repository infromation is:

[root at localhost linux]# git show
commit aa39477b5692611b91ac9455ae588738852b3f60
Merge: 48ec833 5164bec
Author: Linus Torvalds <torvalds at linux-foundation.org>
Date:   Mon Dec 22 14:47:17 2014 -0800

    Merge tag 'dm-3.19-fixes' of git://
git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
    Pull device mapper fixes from Mike Snitzer:
     "Thre stable fixes and one fix for a regression introduced during 3.19
      merge:
       - Fix inability to discard used space when the thin-pool target is in
         out-of-data-space mode and also transition the thin-pool back to
         write mode once free space is made available.
       - Fix DM core bio-based end_io bug that prevented proper
         post-processing of the error code returned from the block layer.
       - Fix crash in DM thin-pool due to thin device being added to the
         pool's active_thins list before properly initializing the thin
         device's refcount"
    * tag 'dm-3.19-fixes' of git://
git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
      dm: fix missed error code if .end_io isn't implemented by target_type
      dm thin: fix crash by initializing thin device's refcount and
completion earlier
      dm thin: fix missing out-of-data-space to write mode transition if
blocks are released
      dm thin: fix inability to discard blocks when in out-of-data-space
mode


Don't handle the list_del is right, or this is a bug?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141223/4ecae24e/attachment.html 


More information about the Kernelnewbies mailing list