tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: fdf62dff2537450d438667d817333e17ec71148a commit: d4353bc94d9a5d1fb044185ee8162f0cc3e48f90 [1411/1411] net: wangxun: fix resolving ipv6 pakets extension header errors config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250122/202501220126.4njU5YRX-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250122/202501220126.4njU5YRX-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202501220126.4njU5YRX-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/netswift/ngbe/ngbe_main.c:38: drivers/net/ethernet/netswift/ngbe/ngbe.h:764:6: warning: variable 'cur_diff' set but not used [-Wunused-but-set-variable] 764 | u32 cur_diff = 0; | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:170:6: warning: no previous prototype for function 'ngbe_service_event_schedule' [-Wmissing-prototypes] 170 | void ngbe_service_event_schedule(struct ngbe_adapter *adapter) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:170:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 170 | void ngbe_service_event_schedule(struct ngbe_adapter *adapter) | ^ | static drivers/net/ethernet/netswift/ngbe/ngbe_main.c:433:7: warning: variable 'real_tx_hang' set but not used [-Wunused-but-set-variable] 433 | bool real_tx_hang = false; | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3223:6: warning: no previous prototype for function 'ngbe_configure_isb' [-Wmissing-prototypes] 3223 | void ngbe_configure_isb(struct ngbe_adapter *adapter) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3223:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 3223 | void ngbe_configure_isb(struct ngbe_adapter *adapter) | ^ | static drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3233:6: warning: no previous prototype for function 'ngbe_configure_port' [-Wmissing-prototypes] 3233 | void ngbe_configure_port(struct ngbe_adapter *adapter) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 3233 | void ngbe_configure_port(struct ngbe_adapter *adapter) | ^ | static drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3592:6: warning: no previous prototype for function 'ngbe_disable_device' [-Wmissing-prototypes] 3592 | void ngbe_disable_device(struct ngbe_adapter *adapter) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3592:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 3592 | void ngbe_disable_device(struct ngbe_adapter *adapter) | ^ | static drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3693:5: warning: no previous prototype for function 'ngbe_init_shared_code' [-Wmissing-prototypes] 3693 | s32 ngbe_init_shared_code(struct ngbe_hw *hw) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3693:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 3693 | s32 ngbe_init_shared_code(struct ngbe_hw *hw) | ^ | static
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5164:6: warning: unused variable 'len' [-Wunused-variable]
5164 | u32 len = 0; | ^~~ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5833:5: warning: no previous prototype for function 'ngbe_skb_pad_nonzero' [-Wmissing-prototypes] 5833 | int ngbe_skb_pad_nonzero(struct sk_buff *skb, int pad) | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5833:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 5833 | int ngbe_skb_pad_nonzero(struct sk_buff *skb, int pad) | ^ | static drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6033:6: warning: variable 'prtad' set but not used [-Wunused-but-set-variable] 6033 | int prtad, devad, ret = 0; | ^ drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6033:13: warning: variable 'devad' set but not used [-Wunused-but-set-variable] 6033 | int prtad, devad, ret = 0; | ^ 11 warnings generated. drivers/net/ethernet/netswift/ngbe/ngbe_main.c:257: warning: Function parameter or member 'quiet' not described in 'ngbe_read_reg' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:1644: warning: Function parameter or member 'queues' not described in 'ngbe_irq_enable' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:1644: warning: Function parameter or member 'flush' not described in 'ngbe_irq_enable' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:2035: warning: Function parameter or member 'adapter' not described in 'ngbe_configure_msi_and_legacy' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:2449: warning: Function parameter or member 'adapter' not described in 'ngbe_configure_bridge_mode' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:2913: warning: Function parameter or member 'pool' not described in 'ngbe_write_uc_addr_list' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3722: warning: cannot understand function prototype: 'const u32 def_rss_key[10] = ' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4583: warning: Function parameter or member 'adapter' not described in 'ngbe_check_hang_subtask' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4648: warning: Function parameter or member 'adapter' not described in 'ngbe_watchdog_update_link_status' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4744: warning: Function parameter or member 'adapter' not described in 'ngbe_watchdog_link_is_up' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4789: warning: Function parameter or member 'adapter' not described in 'ngbe_watchdog_link_is_down' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4856: warning: Function parameter or member 'adapter' not described in 'ngbe_watchdog_flush_tx' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4928: warning: Function parameter or member 'adapter' not described in 'ngbe_watchdog_subtask' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4957: warning: Function parameter or member 't' not described in 'ngbe_service_timer' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:4957: warning: Excess function parameter 'data' description in 'ngbe_service_timer' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6066: warning: Function parameter or member 'dev' not described in 'ngbe_setup_tc' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6066: warning: Excess function parameter 'netdev' description in 'ngbe_setup_tc' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6320: warning: Excess function parameter 'device_id' description in 'ngbe_wol_supported' drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6320: warning: Excess function parameter 'subdev_id' description in 'ngbe_wol_supported'
vim +/len +5164 drivers/net/ethernet/netswift/ngbe/ngbe_main.c
5154 5155 static ngbe_dptype encode_tx_desc_ptype(const struct ngbe_tx_buffer *first) 5156 { 5157 struct sk_buff *skb = first->skb; 5158 u8 tun_prot = 0; 5159 u8 l4_prot = 0; 5160 u8 ptype = 0; 5161 unsigned char *exthdr; 5162 unsigned char *l4_hdr; 5163 __be16 frag_off;
5164 u32 len = 0;
5165 5166 if (skb->encapsulation) { 5167 union network_header hdr; 5168 5169 switch (first->protocol) { 5170 case __constant_htons(ETH_P_IP): 5171 tun_prot = ip_hdr(skb)->protocol; 5172 if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) 5173 goto encap_frag; 5174 ptype = NGBE_PTYPE_TUN_IPV4; 5175 break; 5176 case htons(ETH_P_IPV6): 5177 l4_hdr = skb_transport_header(skb); 5178 exthdr = skb_network_header(skb) + 5179 sizeof(struct ipv6hdr); 5180 tun_prot = ipv6_hdr(skb)->nexthdr; 5181 if (l4_hdr != exthdr) 5182 ipv6_skip_exthdr(skb, exthdr - skb->data, 5183 &tun_prot, &frag_off); 5184 5185 if (tun_prot == NEXTHDR_FRAGMENT) 5186 goto encap_frag; 5187 ptype = NGBE_PTYPE_TUN_IPV6; 5188 break; 5189 default: 5190 goto exit; 5191 } 5192 5193 if (tun_prot == IPPROTO_IPIP || 5194 tun_prot == IPPROTO_IPV6) { 5195 hdr.raw = (void *)inner_ip_hdr(skb); 5196 ptype |= NGBE_PTYPE_PKT_IPIP; 5197 } else if (tun_prot == IPPROTO_UDP) { 5198 hdr.raw = (void *)inner_ip_hdr(skb); 5199 } else { 5200 goto exit; 5201 } 5202 5203 switch (hdr.ipv4->version) { 5204 case IPVERSION: 5205 l4_prot = hdr.ipv4->protocol; 5206 if (hdr.ipv4->frag_off & htons(IP_MF | IP_OFFSET)) { 5207 ptype |= NGBE_PTYPE_TYP_IPFRAG; 5208 goto exit; 5209 } 5210 break; 5211 case 6: 5212 l4_hdr = skb_inner_transport_header(skb); 5213 exthdr = skb_inner_network_header(skb) + 5214 sizeof(struct ipv6hdr); 5215 l4_prot = inner_ipv6_hdr(skb)->nexthdr; 5216 if (l4_hdr != exthdr) 5217 ipv6_skip_exthdr(skb, exthdr - skb->data, 5218 &l4_prot, &frag_off); 5219 5220 ptype |= NGBE_PTYPE_PKT_IPV6; 5221 if (l4_prot == NEXTHDR_FRAGMENT) { 5222 ptype |= NGBE_PTYPE_TYP_IPFRAG; 5223 goto exit; 5224 } 5225 break; 5226 default: 5227 goto exit; 5228 } 5229 } else { 5230 encap_frag: 5231 switch (first->protocol) { 5232 case __constant_htons(ETH_P_IP): 5233 l4_prot = ip_hdr(skb)->protocol; 5234 ptype = NGBE_PTYPE_PKT_IP; 5235 if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) { 5236 ptype |= NGBE_PTYPE_TYP_IPFRAG; 5237 goto exit; 5238 } 5239 break; 5240 #ifdef NETIF_F_IPV6_CSUM 5241 case htons(ETH_P_IPV6): 5242 l4_hdr = skb_transport_header(skb); 5243 exthdr = skb_network_header(skb) + 5244 sizeof(struct ipv6hdr); 5245 l4_prot = ipv6_hdr(skb)->nexthdr; 5246 if (l4_hdr != exthdr) 5247 ipv6_skip_exthdr(skb, exthdr - skb->data, 5248 &l4_prot, &frag_off); 5249 5250 ptype = NGBE_PTYPE_PKT_IP | NGBE_PTYPE_PKT_IPV6; 5251 if (l4_prot == NEXTHDR_FRAGMENT) { 5252 ptype |= NGBE_PTYPE_TYP_IPFRAG; 5253 goto exit; 5254 } 5255 break; 5256 #endif /* NETIF_F_IPV6_CSUM */ 5257 case __constant_htons(ETH_P_1588): 5258 ptype = NGBE_PTYPE_L2_TS; 5259 goto exit; 5260 case __constant_htons(ETH_P_FIP): 5261 ptype = NGBE_PTYPE_L2_FIP; 5262 goto exit; 5263 case __constant_htons(NGBE_ETH_P_LLDP): 5264 ptype = NGBE_PTYPE_L2_LLDP; 5265 goto exit; 5266 case __constant_htons(NGBE_ETH_P_CNM): 5267 ptype = NGBE_PTYPE_L2_CNM; 5268 goto exit; 5269 case __constant_htons(ETH_P_PAE): 5270 ptype = NGBE_PTYPE_L2_EAPOL; 5271 goto exit; 5272 case __constant_htons(ETH_P_ARP): 5273 ptype = NGBE_PTYPE_L2_ARP; 5274 goto exit; 5275 default: 5276 ptype = NGBE_PTYPE_L2_MAC; 5277 goto exit; 5278 } 5279 } 5280 5281 switch (l4_prot) { 5282 case IPPROTO_TCP: 5283 ptype |= NGBE_PTYPE_TYP_TCP; 5284 break; 5285 case IPPROTO_UDP: 5286 ptype |= NGBE_PTYPE_TYP_UDP; 5287 break; 5288 case IPPROTO_SCTP: 5289 ptype |= NGBE_PTYPE_TYP_SCTP; 5290 break; 5291 default: 5292 ptype |= NGBE_PTYPE_TYP_IP; 5293 break; 5294 } 5295 5296 exit: 5297 return ngbe_decode_ptype(ptype); 5298 } 5299