1 /* 2 * QEMU RX packets abstractions 3 * 4 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) 5 * 6 * Developed by Daynix Computing LTD (http://www.daynix.com) 7 * 8 * Authors: 9 * Dmitry Fleytman <dmitry@daynix.com> 10 * Tamir Shomer <tamirs@daynix.com> 11 * Yan Vugenfirer <yan@daynix.com> 12 * 13 * This work is licensed under the terms of the GNU GPL, version 2 or later. 14 * See the COPYING file in the top-level directory. 15 * 16 */ 17 18 #include "qemu/osdep.h" 19 #include "trace.h" 20 #include "net_rx_pkt.h" 21 #include "net/checksum.h" 22 #include "net/tap.h" 23 24 struct NetRxPkt { 25 struct virtio_net_hdr virt_hdr; 26 uint8_t ehdr_buf[sizeof(struct eth_header) + sizeof(struct vlan_header)]; 27 struct iovec *vec; 28 uint16_t vec_len_total; 29 uint16_t vec_len; 30 uint32_t tot_len; 31 uint16_t tci; 32 size_t ehdr_buf_len; 33 eth_pkt_types_e packet_type; 34 35 /* Analysis results */ 36 bool hasip4; 37 bool hasip6; 38 39 size_t l3hdr_off; 40 size_t l4hdr_off; 41 size_t l5hdr_off; 42 43 eth_ip6_hdr_info ip6hdr_info; 44 eth_ip4_hdr_info ip4hdr_info; 45 eth_l4_hdr_info l4hdr_info; 46 }; 47 48 void net_rx_pkt_init(struct NetRxPkt **pkt) 49 { 50 struct NetRxPkt *p = g_malloc0(sizeof *p); 51 p->vec = NULL; 52 p->vec_len_total = 0; 53 *pkt = p; 54 } 55 56 void net_rx_pkt_uninit(struct NetRxPkt *pkt) 57 { 58 if (pkt->vec_len_total != 0) { 59 g_free(pkt->vec); 60 } 61 62 g_free(pkt); 63 } 64 65 struct virtio_net_hdr *net_rx_pkt_get_vhdr(struct NetRxPkt *pkt) 66 { 67 assert(pkt); 68 return &pkt->virt_hdr; 69 } 70 71 static inline void 72 net_rx_pkt_iovec_realloc(struct NetRxPkt *pkt, 73 int new_iov_len) 74 { 75 if (pkt->vec_len_total < new_iov_len) { 76 g_free(pkt->vec); 77 pkt->vec = g_malloc(sizeof(*pkt->vec) * new_iov_len); 78 pkt->vec_len_total = new_iov_len; 79 } 80 } 81 82 static void 83 net_rx_pkt_pull_data(struct NetRxPkt *pkt, 84 const struct iovec *iov, int iovcnt, 85 size_t ploff) 86 { 87 uint32_t pllen = iov_size(iov, iovcnt) - ploff; 88 89 if (pkt->ehdr_buf_len) { 90 net_rx_pkt_iovec_realloc(pkt, iovcnt + 1); 91 92 pkt->vec[0].iov_base = pkt->ehdr_buf; 93 pkt->vec[0].iov_len = pkt->ehdr_buf_len; 94 95 pkt->tot_len = pllen + pkt->ehdr_buf_len; 96 pkt->vec_len = iov_copy(pkt->vec + 1, pkt->vec_len_total - 1, 97 iov, iovcnt, ploff, pllen) + 1; 98 } else { 99 net_rx_pkt_iovec_realloc(pkt, iovcnt); 100 101 pkt->tot_len = pllen; 102 pkt->vec_len = iov_copy(pkt->vec, pkt->vec_len_total, 103 iov, iovcnt, ploff, pkt->tot_len); 104 } 105 106 eth_get_protocols(pkt->vec, pkt->vec_len, 0, &pkt->hasip4, &pkt->hasip6, 107 &pkt->l3hdr_off, &pkt->l4hdr_off, &pkt->l5hdr_off, 108 &pkt->ip6hdr_info, &pkt->ip4hdr_info, &pkt->l4hdr_info); 109 110 trace_net_rx_pkt_parsed(pkt->hasip4, pkt->hasip6, pkt->l4hdr_info.proto, 111 pkt->l3hdr_off, pkt->l4hdr_off, pkt->l5hdr_off); 112 } 113 114 void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt, 115 const struct iovec *iov, int iovcnt, 116 size_t iovoff, bool strip_vlan) 117 { 118 uint16_t tci = 0; 119 uint16_t ploff = iovoff; 120 assert(pkt); 121 122 if (strip_vlan) { 123 pkt->ehdr_buf_len = eth_strip_vlan(iov, iovcnt, iovoff, pkt->ehdr_buf, 124 &ploff, &tci); 125 } else { 126 pkt->ehdr_buf_len = 0; 127 } 128 129 pkt->tci = tci; 130 131 net_rx_pkt_pull_data(pkt, iov, iovcnt, ploff); 132 } 133 134 void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt, 135 const struct iovec *iov, int iovcnt, 136 size_t iovoff, bool strip_vlan, 137 uint16_t vet) 138 { 139 uint16_t tci = 0; 140 uint16_t ploff = iovoff; 141 assert(pkt); 142 143 if (strip_vlan) { 144 pkt->ehdr_buf_len = eth_strip_vlan_ex(iov, iovcnt, iovoff, vet, 145 pkt->ehdr_buf, 146 &ploff, &tci); 147 } else { 148 pkt->ehdr_buf_len = 0; 149 } 150 151 pkt->tci = tci; 152 153 net_rx_pkt_pull_data(pkt, iov, iovcnt, ploff); 154 } 155 156 void net_rx_pkt_dump(struct NetRxPkt *pkt) 157 { 158 #ifdef NET_RX_PKT_DEBUG 159 assert(pkt); 160 161 printf("RX PKT: tot_len: %d, ehdr_buf_len: %lu, vlan_tag: %d\n", 162 pkt->tot_len, pkt->ehdr_buf_len, pkt->tci); 163 #endif 164 } 165 166 void net_rx_pkt_set_packet_type(struct NetRxPkt *pkt, 167 eth_pkt_types_e packet_type) 168 { 169 assert(pkt); 170 171 pkt->packet_type = packet_type; 172 173 } 174 175 eth_pkt_types_e net_rx_pkt_get_packet_type(struct NetRxPkt *pkt) 176 { 177 assert(pkt); 178 179 return pkt->packet_type; 180 } 181 182 size_t net_rx_pkt_get_total_len(struct NetRxPkt *pkt) 183 { 184 assert(pkt); 185 186 return pkt->tot_len; 187 } 188 189 void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, 190 const struct iovec *iov, size_t iovcnt, 191 size_t iovoff) 192 { 193 assert(pkt); 194 195 eth_get_protocols(iov, iovcnt, iovoff, &pkt->hasip4, &pkt->hasip6, 196 &pkt->l3hdr_off, &pkt->l4hdr_off, &pkt->l5hdr_off, 197 &pkt->ip6hdr_info, &pkt->ip4hdr_info, &pkt->l4hdr_info); 198 } 199 200 void net_rx_pkt_get_protocols(struct NetRxPkt *pkt, 201 bool *hasip4, bool *hasip6, 202 EthL4HdrProto *l4hdr_proto) 203 { 204 assert(pkt); 205 206 *hasip4 = pkt->hasip4; 207 *hasip6 = pkt->hasip6; 208 *l4hdr_proto = pkt->l4hdr_info.proto; 209 } 210 211 size_t net_rx_pkt_get_l3_hdr_offset(struct NetRxPkt *pkt) 212 { 213 assert(pkt); 214 return pkt->l3hdr_off; 215 } 216 217 size_t net_rx_pkt_get_l4_hdr_offset(struct NetRxPkt *pkt) 218 { 219 assert(pkt); 220 return pkt->l4hdr_off; 221 } 222 223 size_t net_rx_pkt_get_l5_hdr_offset(struct NetRxPkt *pkt) 224 { 225 assert(pkt); 226 return pkt->l5hdr_off; 227 } 228 229 eth_ip6_hdr_info *net_rx_pkt_get_ip6_info(struct NetRxPkt *pkt) 230 { 231 return &pkt->ip6hdr_info; 232 } 233 234 eth_ip4_hdr_info *net_rx_pkt_get_ip4_info(struct NetRxPkt *pkt) 235 { 236 return &pkt->ip4hdr_info; 237 } 238 239 eth_l4_hdr_info *net_rx_pkt_get_l4_info(struct NetRxPkt *pkt) 240 { 241 return &pkt->l4hdr_info; 242 } 243 244 static inline void 245 _net_rx_rss_add_chunk(uint8_t *rss_input, size_t *bytes_written, 246 void *ptr, size_t size) 247 { 248 memcpy(&rss_input[*bytes_written], ptr, size); 249 trace_net_rx_pkt_rss_add_chunk(ptr, size, *bytes_written); 250 *bytes_written += size; 251 } 252 253 static inline void 254 _net_rx_rss_prepare_ip4(uint8_t *rss_input, 255 struct NetRxPkt *pkt, 256 size_t *bytes_written) 257 { 258 struct ip_header *ip4_hdr = &pkt->ip4hdr_info.ip4_hdr; 259 260 _net_rx_rss_add_chunk(rss_input, bytes_written, 261 &ip4_hdr->ip_src, sizeof(uint32_t)); 262 263 _net_rx_rss_add_chunk(rss_input, bytes_written, 264 &ip4_hdr->ip_dst, sizeof(uint32_t)); 265 } 266 267 static inline void 268 _net_rx_rss_prepare_ip6(uint8_t *rss_input, 269 struct NetRxPkt *pkt, 270 bool ipv6ex, size_t *bytes_written) 271 { 272 eth_ip6_hdr_info *ip6info = &pkt->ip6hdr_info; 273 274 _net_rx_rss_add_chunk(rss_input, bytes_written, 275 (ipv6ex && ip6info->rss_ex_src_valid) ? &ip6info->rss_ex_src 276 : &ip6info->ip6_hdr.ip6_src, 277 sizeof(struct in6_address)); 278 279 _net_rx_rss_add_chunk(rss_input, bytes_written, 280 (ipv6ex && ip6info->rss_ex_dst_valid) ? &ip6info->rss_ex_dst 281 : &ip6info->ip6_hdr.ip6_dst, 282 sizeof(struct in6_address)); 283 } 284 285 static inline void 286 _net_rx_rss_prepare_tcp(uint8_t *rss_input, 287 struct NetRxPkt *pkt, 288 size_t *bytes_written) 289 { 290 struct tcp_header *tcphdr = &pkt->l4hdr_info.hdr.tcp; 291 292 _net_rx_rss_add_chunk(rss_input, bytes_written, 293 &tcphdr->th_sport, sizeof(uint16_t)); 294 295 _net_rx_rss_add_chunk(rss_input, bytes_written, 296 &tcphdr->th_dport, sizeof(uint16_t)); 297 } 298 299 static inline void 300 _net_rx_rss_prepare_udp(uint8_t *rss_input, 301 struct NetRxPkt *pkt, 302 size_t *bytes_written) 303 { 304 struct udp_header *udphdr = &pkt->l4hdr_info.hdr.udp; 305 306 _net_rx_rss_add_chunk(rss_input, bytes_written, 307 &udphdr->uh_sport, sizeof(uint16_t)); 308 309 _net_rx_rss_add_chunk(rss_input, bytes_written, 310 &udphdr->uh_dport, sizeof(uint16_t)); 311 } 312 313 uint32_t 314 net_rx_pkt_calc_rss_hash(struct NetRxPkt *pkt, 315 NetRxPktRssType type, 316 uint8_t *key) 317 { 318 uint8_t rss_input[36]; 319 size_t rss_length = 0; 320 uint32_t rss_hash = 0; 321 net_toeplitz_key key_data; 322 323 switch (type) { 324 case NetPktRssIpV4: 325 assert(pkt->hasip4); 326 trace_net_rx_pkt_rss_ip4(); 327 _net_rx_rss_prepare_ip4(&rss_input[0], pkt, &rss_length); 328 break; 329 case NetPktRssIpV4Tcp: 330 assert(pkt->hasip4); 331 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_TCP); 332 trace_net_rx_pkt_rss_ip4_tcp(); 333 _net_rx_rss_prepare_ip4(&rss_input[0], pkt, &rss_length); 334 _net_rx_rss_prepare_tcp(&rss_input[0], pkt, &rss_length); 335 break; 336 case NetPktRssIpV6Tcp: 337 assert(pkt->hasip6); 338 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_TCP); 339 trace_net_rx_pkt_rss_ip6_tcp(); 340 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, false, &rss_length); 341 _net_rx_rss_prepare_tcp(&rss_input[0], pkt, &rss_length); 342 break; 343 case NetPktRssIpV6: 344 assert(pkt->hasip6); 345 trace_net_rx_pkt_rss_ip6(); 346 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, false, &rss_length); 347 break; 348 case NetPktRssIpV6Ex: 349 assert(pkt->hasip6); 350 trace_net_rx_pkt_rss_ip6_ex(); 351 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, true, &rss_length); 352 break; 353 case NetPktRssIpV6TcpEx: 354 assert(pkt->hasip6); 355 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_TCP); 356 trace_net_rx_pkt_rss_ip6_ex_tcp(); 357 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, true, &rss_length); 358 _net_rx_rss_prepare_tcp(&rss_input[0], pkt, &rss_length); 359 break; 360 case NetPktRssIpV4Udp: 361 assert(pkt->hasip4); 362 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP); 363 trace_net_rx_pkt_rss_ip4_udp(); 364 _net_rx_rss_prepare_ip4(&rss_input[0], pkt, &rss_length); 365 _net_rx_rss_prepare_udp(&rss_input[0], pkt, &rss_length); 366 break; 367 case NetPktRssIpV6Udp: 368 assert(pkt->hasip6); 369 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP); 370 trace_net_rx_pkt_rss_ip6_udp(); 371 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, false, &rss_length); 372 _net_rx_rss_prepare_udp(&rss_input[0], pkt, &rss_length); 373 break; 374 case NetPktRssIpV6UdpEx: 375 assert(pkt->hasip6); 376 assert(pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP); 377 trace_net_rx_pkt_rss_ip6_ex_udp(); 378 _net_rx_rss_prepare_ip6(&rss_input[0], pkt, true, &rss_length); 379 _net_rx_rss_prepare_udp(&rss_input[0], pkt, &rss_length); 380 break; 381 default: 382 assert(false); 383 break; 384 } 385 386 net_toeplitz_key_init(&key_data, key); 387 net_toeplitz_add(&rss_hash, rss_input, rss_length, &key_data); 388 389 trace_net_rx_pkt_rss_hash(rss_length, rss_hash); 390 391 return rss_hash; 392 } 393 394 uint16_t net_rx_pkt_get_ip_id(struct NetRxPkt *pkt) 395 { 396 assert(pkt); 397 398 if (pkt->hasip4) { 399 return be16_to_cpu(pkt->ip4hdr_info.ip4_hdr.ip_id); 400 } 401 402 return 0; 403 } 404 405 bool net_rx_pkt_is_tcp_ack(struct NetRxPkt *pkt) 406 { 407 assert(pkt); 408 409 if (pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_TCP) { 410 return TCP_HEADER_FLAGS(&pkt->l4hdr_info.hdr.tcp) & TCP_FLAG_ACK; 411 } 412 413 return false; 414 } 415 416 bool net_rx_pkt_has_tcp_data(struct NetRxPkt *pkt) 417 { 418 assert(pkt); 419 420 if (pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_TCP) { 421 return pkt->l4hdr_info.has_tcp_data; 422 } 423 424 return false; 425 } 426 427 struct iovec *net_rx_pkt_get_iovec(struct NetRxPkt *pkt) 428 { 429 assert(pkt); 430 431 return pkt->vec; 432 } 433 434 uint16_t net_rx_pkt_get_iovec_len(struct NetRxPkt *pkt) 435 { 436 assert(pkt); 437 438 return pkt->vec_len; 439 } 440 441 void net_rx_pkt_set_vhdr(struct NetRxPkt *pkt, 442 struct virtio_net_hdr *vhdr) 443 { 444 assert(pkt); 445 446 memcpy(&pkt->virt_hdr, vhdr, sizeof pkt->virt_hdr); 447 } 448 449 void net_rx_pkt_set_vhdr_iovec(struct NetRxPkt *pkt, 450 const struct iovec *iov, int iovcnt) 451 { 452 assert(pkt); 453 454 iov_to_buf(iov, iovcnt, 0, &pkt->virt_hdr, sizeof pkt->virt_hdr); 455 } 456 457 void net_rx_pkt_unset_vhdr(struct NetRxPkt *pkt) 458 { 459 assert(pkt); 460 461 memset(&pkt->virt_hdr, 0, sizeof(pkt->virt_hdr)); 462 } 463 464 bool net_rx_pkt_is_vlan_stripped(struct NetRxPkt *pkt) 465 { 466 assert(pkt); 467 468 return pkt->ehdr_buf_len ? true : false; 469 } 470 471 uint16_t net_rx_pkt_get_vlan_tag(struct NetRxPkt *pkt) 472 { 473 assert(pkt); 474 475 return pkt->tci; 476 } 477 478 bool net_rx_pkt_validate_l3_csum(struct NetRxPkt *pkt, bool *csum_valid) 479 { 480 uint32_t cntr; 481 uint16_t csum; 482 uint32_t csl; 483 484 trace_net_rx_pkt_l3_csum_validate_entry(); 485 486 if (!pkt->hasip4) { 487 trace_net_rx_pkt_l3_csum_validate_not_ip4(); 488 return false; 489 } 490 491 csl = pkt->l4hdr_off - pkt->l3hdr_off; 492 493 cntr = net_checksum_add_iov(pkt->vec, pkt->vec_len, 494 pkt->l3hdr_off, 495 csl, 0); 496 497 csum = net_checksum_finish(cntr); 498 499 *csum_valid = (csum == 0); 500 501 trace_net_rx_pkt_l3_csum_validate_csum(pkt->l3hdr_off, csl, 502 cntr, csum, *csum_valid); 503 504 return true; 505 } 506 507 static uint16_t 508 _net_rx_pkt_calc_l4_csum(struct NetRxPkt *pkt) 509 { 510 uint32_t cntr; 511 uint16_t csum; 512 uint16_t csl; 513 uint32_t cso; 514 515 trace_net_rx_pkt_l4_csum_calc_entry(); 516 517 if (pkt->hasip4) { 518 if (pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP) { 519 csl = be16_to_cpu(pkt->l4hdr_info.hdr.udp.uh_ulen); 520 trace_net_rx_pkt_l4_csum_calc_ip4_udp(); 521 } else { 522 csl = be16_to_cpu(pkt->ip4hdr_info.ip4_hdr.ip_len) - 523 IP_HDR_GET_LEN(&pkt->ip4hdr_info.ip4_hdr); 524 trace_net_rx_pkt_l4_csum_calc_ip4_tcp(); 525 } 526 527 cntr = eth_calc_ip4_pseudo_hdr_csum(&pkt->ip4hdr_info.ip4_hdr, 528 csl, &cso); 529 trace_net_rx_pkt_l4_csum_calc_ph_csum(cntr, csl); 530 } else { 531 if (pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP) { 532 csl = be16_to_cpu(pkt->l4hdr_info.hdr.udp.uh_ulen); 533 trace_net_rx_pkt_l4_csum_calc_ip6_udp(); 534 } else { 535 struct ip6_header *ip6hdr = &pkt->ip6hdr_info.ip6_hdr; 536 size_t full_ip6hdr_len = pkt->l4hdr_off - pkt->l3hdr_off; 537 size_t ip6opts_len = full_ip6hdr_len - sizeof(struct ip6_header); 538 539 csl = be16_to_cpu(ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_plen) - 540 ip6opts_len; 541 trace_net_rx_pkt_l4_csum_calc_ip6_tcp(); 542 } 543 544 cntr = eth_calc_ip6_pseudo_hdr_csum(&pkt->ip6hdr_info.ip6_hdr, csl, 545 pkt->ip6hdr_info.l4proto, &cso); 546 trace_net_rx_pkt_l4_csum_calc_ph_csum(cntr, csl); 547 } 548 549 cntr += net_checksum_add_iov(pkt->vec, pkt->vec_len, 550 pkt->l4hdr_off, csl, cso); 551 552 csum = net_checksum_finish_nozero(cntr); 553 554 trace_net_rx_pkt_l4_csum_calc_csum(pkt->l4hdr_off, csl, cntr, csum); 555 556 return csum; 557 } 558 559 bool net_rx_pkt_validate_l4_csum(struct NetRxPkt *pkt, bool *csum_valid) 560 { 561 uint16_t csum; 562 563 trace_net_rx_pkt_l4_csum_validate_entry(); 564 565 if (pkt->l4hdr_info.proto != ETH_L4_HDR_PROTO_TCP && 566 pkt->l4hdr_info.proto != ETH_L4_HDR_PROTO_UDP) { 567 trace_net_rx_pkt_l4_csum_validate_not_xxp(); 568 return false; 569 } 570 571 if (pkt->l4hdr_info.proto == ETH_L4_HDR_PROTO_UDP && 572 pkt->l4hdr_info.hdr.udp.uh_sum == 0) { 573 trace_net_rx_pkt_l4_csum_validate_udp_with_no_checksum(); 574 return false; 575 } 576 577 if (pkt->hasip4 && pkt->ip4hdr_info.fragment) { 578 trace_net_rx_pkt_l4_csum_validate_ip4_fragment(); 579 return false; 580 } 581 582 csum = _net_rx_pkt_calc_l4_csum(pkt); 583 584 *csum_valid = ((csum == 0) || (csum == 0xFFFF)); 585 586 trace_net_rx_pkt_l4_csum_validate_csum(*csum_valid); 587 588 return true; 589 } 590 591 bool net_rx_pkt_fix_l4_csum(struct NetRxPkt *pkt) 592 { 593 uint16_t csum = 0; 594 uint32_t l4_cso; 595 596 trace_net_rx_pkt_l4_csum_fix_entry(); 597 598 switch (pkt->l4hdr_info.proto) { 599 case ETH_L4_HDR_PROTO_TCP: 600 l4_cso = offsetof(struct tcp_header, th_sum); 601 trace_net_rx_pkt_l4_csum_fix_tcp(l4_cso); 602 break; 603 604 case ETH_L4_HDR_PROTO_UDP: 605 if (pkt->l4hdr_info.hdr.udp.uh_sum == 0) { 606 trace_net_rx_pkt_l4_csum_fix_udp_with_no_checksum(); 607 return false; 608 } 609 l4_cso = offsetof(struct udp_header, uh_sum); 610 trace_net_rx_pkt_l4_csum_fix_udp(l4_cso); 611 break; 612 613 default: 614 trace_net_rx_pkt_l4_csum_fix_not_xxp(); 615 return false; 616 } 617 618 if (pkt->hasip4 && pkt->ip4hdr_info.fragment) { 619 trace_net_rx_pkt_l4_csum_fix_ip4_fragment(); 620 return false; 621 } 622 623 /* Set zero to checksum word */ 624 iov_from_buf(pkt->vec, pkt->vec_len, 625 pkt->l4hdr_off + l4_cso, 626 &csum, sizeof(csum)); 627 628 /* Calculate L4 checksum */ 629 csum = cpu_to_be16(_net_rx_pkt_calc_l4_csum(pkt)); 630 631 /* Set calculated checksum to checksum word */ 632 iov_from_buf(pkt->vec, pkt->vec_len, 633 pkt->l4hdr_off + l4_cso, 634 &csum, sizeof(csum)); 635 636 trace_net_rx_pkt_l4_csum_fix_csum(pkt->l4hdr_off + l4_cso, csum); 637 638 return true; 639 } 640