Hi Eric,

I love your patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    
https://github.com/0day-ci/linux/commits/Eric-Dumazet/net-remove-unsafe-skb_insert/20181126-061342
config: x86_64-randconfig-x009-201847 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/infiniband//hw/nes/nes_mgt.c: In function 'queue_fpdus':
>> drivers/infiniband//hw/nes/nes_mgt.c:561:29: error: passing argument 3 of 
>> '__skb_insert' from incompatible pointer type 
>> [-Werror=incompatible-pointer-types]
      __skb_insert(tmpskb, skb, &nesqp->pau_list);
                                ^
   In file included from drivers/infiniband//hw/nes/nes_mgt.c:34:0:
   include/linux/skbuff.h:1752:20: note: expected 'struct sk_buff *' but 
argument is of type 'struct sk_buff_head *'
    static inline void __skb_insert(struct sk_buff *newsk,
                       ^~~~~~~~~~~~
>> drivers/infiniband//hw/nes/nes_mgt.c:561:3: error: too few arguments to 
>> function '__skb_insert'
      __skb_insert(tmpskb, skb, &nesqp->pau_list);
      ^~~~~~~~~~~~
   In file included from drivers/infiniband//hw/nes/nes_mgt.c:34:0:
   include/linux/skbuff.h:1752:20: note: declared here
    static inline void __skb_insert(struct sk_buff *newsk,
                       ^~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/__skb_insert +561 drivers/infiniband//hw/nes/nes_mgt.c

   503  
   504  /**
   505   * queue_fpdus - Handle fpdu's that hw passed up to sw
   506   */
   507  static void queue_fpdus(struct sk_buff *skb, struct nes_vnic *nesvnic, 
struct nes_qp *nesqp)
   508  {
   509          struct sk_buff *tmpskb;
   510          struct nes_rskb_cb *cb;
   511          struct iphdr *iph;
   512          struct tcphdr *tcph;
   513          unsigned char *tcph_end;
   514          u32 rcv_nxt;
   515          u32 rcv_wnd;
   516          u32 seqnum;
   517          u32 len;
   518          bool process_it = false;
   519          unsigned long flags;
   520  
   521          /* Move data ptr to after tcp header */
   522          iph = (struct iphdr *)skb->data;
   523          tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl));
   524          seqnum = be32_to_cpu(tcph->seq);
   525          tcph_end = (((char *)tcph) + (4 * tcph->doff));
   526  
   527          len = be16_to_cpu(iph->tot_len);
   528          if (skb->len > len)
   529                  skb_trim(skb, len);
   530          skb_pull(skb, tcph_end - skb->data);
   531  
   532          /* Initialize tracking values */
   533          cb = (struct nes_rskb_cb *)&skb->cb[0];
   534          cb->seqnum = seqnum;
   535  
   536          /* Make sure data is in the receive window */
   537          rcv_nxt = nesqp->pau_rcv_nxt;
   538          rcv_wnd = le32_to_cpu(nesqp->nesqp_context->rcv_wnd);
   539          if (!between(seqnum, rcv_nxt, (rcv_nxt + rcv_wnd))) {
   540                  nes_mgt_free_skb(nesvnic->nesdev, skb, 
PCI_DMA_TODEVICE);
   541                  nes_rem_ref_cm_node(nesqp->cm_node);
   542                  return;
   543          }
   544  
   545          spin_lock_irqsave(&nesqp->pau_lock, flags);
   546  
   547          if (nesqp->pau_busy)
   548                  nesqp->pau_pending = 1;
   549          else
   550                  nesqp->pau_busy = 1;
   551  
   552          /* Queue skb by sequence number */
   553          if (skb_queue_len(&nesqp->pau_list) == 0) {
   554                  __skb_queue_head(&nesqp->pau_list, skb);
   555          } else {
   556                  skb_queue_walk(&nesqp->pau_list, tmpskb) {
   557                          cb = (struct nes_rskb_cb *)&tmpskb->cb[0];
   558                          if (before(seqnum, cb->seqnum))
   559                                  break;
   560                  }
 > 561                  __skb_insert(tmpskb, skb, &nesqp->pau_list);
   562          }
   563          if (nesqp->pau_state == PAU_READY)
   564                  process_it = true;
   565          spin_unlock_irqrestore(&nesqp->pau_lock, flags);
   566  
   567          if (process_it)
   568                  process_fpdus(nesvnic, nesqp);
   569  
   570          return;
   571  }
   572  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to