Hi Zhu, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.16-rc7] [cannot apply to next-20180329] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Zhu-Yanjun/IB-rxe-make-rxe_find_route6-compact/20180329-195707 config: x86_64-randconfig-s5-03301244 (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 >>): In file included from include/linux/kernel.h:10:0, from include/linux/skbuff.h:17, from drivers/infiniband/sw/rxe/rxe_net.c:34: drivers/infiniband/sw/rxe/rxe_net.c: In function 'rxe_find_route6': >> drivers/infiniband/sw/rxe/rxe_net.c:157:16: error: 'ipv6_stub' undeclared (first use in this function); did you mean 'ipv6_rcv'? if (unlikely(ipv6_stub->ipv6_dst_lookup( ^ include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ drivers/infiniband/sw/rxe/rxe_net.c:157:16: note: each undeclared identifier is reported only once for each function it appears in if (unlikely(ipv6_stub->ipv6_dst_lookup( ^ include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ vim +157 drivers/infiniband/sw/rxe/rxe_net.c > 34 #include <linux/skbuff.h> 35 #include <linux/if_arp.h> 36 #include <linux/netdevice.h> 37 #include <linux/if.h> 38 #include <linux/if_vlan.h> 39 #include <net/udp_tunnel.h> 40 #include <net/sch_generic.h> 41 #include <linux/netfilter.h> 42 #include <rdma/ib_addr.h> 43 44 #include "rxe.h" 45 #include "rxe_net.h" 46 #include "rxe_loc.h" 47 48 static LIST_HEAD(rxe_dev_list); 49 static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */ 50 51 struct rxe_dev *net_to_rxe(struct net_device *ndev) 52 { 53 struct rxe_dev *rxe; 54 struct rxe_dev *found = NULL; 55 56 spin_lock_bh(&dev_list_lock); 57 list_for_each_entry(rxe, &rxe_dev_list, list) { 58 if (rxe->ndev == ndev) { 59 found = rxe; 60 break; 61 } 62 } 63 spin_unlock_bh(&dev_list_lock); 64 65 return found; 66 } 67 68 struct rxe_dev *get_rxe_by_name(const char *name) 69 { 70 struct rxe_dev *rxe; 71 struct rxe_dev *found = NULL; 72 73 spin_lock_bh(&dev_list_lock); 74 list_for_each_entry(rxe, &rxe_dev_list, list) { 75 if (!strcmp(name, rxe->ib_dev.name)) { 76 found = rxe; 77 break; 78 } 79 } 80 spin_unlock_bh(&dev_list_lock); 81 return found; 82 } 83 84 85 static struct rxe_recv_sockets recv_sockets; 86 87 struct device *rxe_dma_device(struct rxe_dev *rxe) 88 { 89 struct net_device *ndev; 90 91 ndev = rxe->ndev; 92 93 if (is_vlan_dev(ndev)) 94 ndev = vlan_dev_real_dev(ndev); 95 96 return ndev->dev.parent; 97 } 98 99 int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid) 100 { 101 int err; 102 unsigned char ll_addr[ETH_ALEN]; 103 104 ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr); 105 err = dev_mc_add(rxe->ndev, ll_addr); 106 107 return err; 108 } 109 110 int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid) 111 { 112 int err; 113 unsigned char ll_addr[ETH_ALEN]; 114 115 ipv6_eth_mc_map((struct in6_addr *)mgid->raw, ll_addr); 116 err = dev_mc_del(rxe->ndev, ll_addr); 117 118 return err; 119 } 120 121 static struct dst_entry *rxe_find_route4(struct net_device *ndev, 122 struct in_addr *saddr, 123 struct in_addr *daddr) 124 { 125 struct rtable *rt; 126 struct flowi4 fl = { { 0 } }; 127 128 memset(&fl, 0, sizeof(fl)); 129 fl.flowi4_oif = ndev->ifindex; 130 memcpy(&fl.saddr, saddr, sizeof(*saddr)); 131 memcpy(&fl.daddr, daddr, sizeof(*daddr)); 132 fl.flowi4_proto = IPPROTO_UDP; 133 134 rt = ip_route_output_key(&init_net, &fl); 135 if (IS_ERR(rt)) { 136 pr_err_ratelimited("no route to %pI4\n", &daddr->s_addr); 137 return NULL; 138 } 139 140 return &rt->dst; 141 } 142 143 static struct dst_entry *rxe_find_route6(struct net_device *ndev, 144 struct in6_addr *saddr, 145 struct in6_addr *daddr) 146 { 147 if (IS_ENABLED(CONFIG_IPV6)) { 148 struct dst_entry *ndst; 149 struct flowi6 fl6 = { { 0 } }; 150 151 memset(&fl6, 0, sizeof(fl6)); 152 fl6.flowi6_oif = ndev->ifindex; 153 memcpy(&fl6.saddr, saddr, sizeof(*saddr)); 154 memcpy(&fl6.daddr, daddr, sizeof(*daddr)); 155 fl6.flowi6_proto = IPPROTO_UDP; 156 > 157 if (unlikely(ipv6_stub->ipv6_dst_lookup( 158 sock_net(recv_sockets.sk6->sk), 159 recv_sockets.sk6->sk, &ndst, &fl6))) { 160 pr_err_ratelimited("no route to %pI6\n", daddr); 161 goto put; 162 } 163 164 if (unlikely(ndst->error)) { 165 pr_err("no route to %pI6\n", daddr); 166 goto put; 167 } 168 169 return ndst; 170 put: 171 dst_release(ndst); 172 } 173 return NULL; 174 } 175 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip