Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] s390: qeth driver fixes [1/6]

[PATCH 4/9] s390: qeth driver fixes [1/6]

From: Frank Pavlic <fpavlic@de.ibm.com>
- Drop incoming packets with vlan_tag set
if card->vlangrp is not set.
- use always vlan_hwaccel_rx to pass
vlan frames to the stack.
- fix recovery problem. Device was recovered
properly but still not working.
netif_carrier_on call right before
recovery start fixes it.

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Frank Pavlic and committed by
Jeff Garzik
330b6369 f449c565

+24 -27
+24 -27
drivers/s390/net/qeth_main.c
··· 1708 1708 "IP address reset.\n", 1709 1709 QETH_CARD_IFNAME(card), 1710 1710 card->info.chpid); 1711 + netif_carrier_on(card->dev); 1711 1712 qeth_schedule_recovery(card); 1712 1713 return NULL; 1713 1714 case IPA_CMD_MODCCID: ··· 2465 2464 qeth_rebuild_skb_fake_ll_eth(card, skb, hdr); 2466 2465 } 2467 2466 2468 - static inline void 2469 - qeth_rebuild_skb_vlan(struct qeth_card *card, struct sk_buff *skb, 2470 - struct qeth_hdr *hdr) 2471 - { 2472 - #ifdef CONFIG_QETH_VLAN 2473 - u16 *vlan_tag; 2474 - 2475 - if (hdr->hdr.l3.ext_flags & 2476 - (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { 2477 - vlan_tag = (u16 *) skb_push(skb, VLAN_HLEN); 2478 - *vlan_tag = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME)? 2479 - hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]); 2480 - *(vlan_tag + 1) = skb->protocol; 2481 - skb->protocol = __constant_htons(ETH_P_8021Q); 2482 - } 2483 - #endif /* CONFIG_QETH_VLAN */ 2484 - } 2485 - 2486 2467 static inline __u16 2487 2468 qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, 2488 2469 struct qeth_hdr *hdr) ··· 2493 2510 return vlan_id; 2494 2511 } 2495 2512 2496 - static inline void 2513 + static inline __u16 2497 2514 qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, 2498 2515 struct qeth_hdr *hdr) 2499 2516 { 2517 + unsigned short vlan_id = 0; 2500 2518 #ifdef CONFIG_QETH_IPV6 2501 2519 if (hdr->hdr.l3.flags & QETH_HDR_PASSTHRU) { 2502 2520 skb->pkt_type = PACKET_HOST; 2503 2521 skb->protocol = qeth_type_trans(skb, card->dev); 2504 - return; 2522 + return 0; 2505 2523 } 2506 2524 #endif /* CONFIG_QETH_IPV6 */ 2507 2525 skb->protocol = htons((hdr->hdr.l3.flags & QETH_HDR_IPV6)? ETH_P_IPV6 : ··· 2524 2540 default: 2525 2541 skb->pkt_type = PACKET_HOST; 2526 2542 } 2527 - qeth_rebuild_skb_vlan(card, skb, hdr); 2543 + 2544 + if (hdr->hdr.l3.ext_flags & 2545 + (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { 2546 + vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME)? 2547 + hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]); 2548 + } 2549 + 2528 2550 if (card->options.fake_ll) 2529 2551 qeth_rebuild_skb_fake_ll(card, skb, hdr); 2530 2552 else ··· 2546 2556 else 2547 2557 skb->ip_summed = SW_CHECKSUMMING; 2548 2558 } 2559 + return vlan_id; 2549 2560 } 2550 2561 2551 2562 static inline void ··· 2559 2568 int offset; 2560 2569 int rxrc; 2561 2570 __u16 vlan_tag = 0; 2571 + __u16 *vlan_addr; 2562 2572 2563 2573 /* get first element of current buffer */ 2564 2574 element = (struct qdio_buffer_element *)&buf->buffer->element[0]; ··· 2573 2581 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) 2574 2582 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); 2575 2583 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) 2576 - qeth_rebuild_skb(card, skb, hdr); 2584 + vlan_tag = qeth_rebuild_skb(card, skb, hdr); 2577 2585 else { /*in case of OSN*/ 2578 2586 skb_push(skb, sizeof(struct qeth_hdr)); 2579 2587 memcpy(skb->data, hdr, sizeof(struct qeth_hdr)); ··· 2583 2591 dev_kfree_skb_any(skb); 2584 2592 continue; 2585 2593 } 2586 - #ifdef CONFIG_QETH_VLAN 2587 - if (vlan_tag) 2588 - vlan_hwaccel_rx(skb, card->vlangrp, vlan_tag); 2589 - else 2590 - #endif 2591 2594 if (card->info.type == QETH_CARD_TYPE_OSN) 2592 2595 rxrc = card->osn_info.data_cb(skb); 2593 2596 else 2597 + #ifdef CONFIG_QETH_VLAN 2598 + if (vlan_tag) 2599 + if (card->vlangrp) 2600 + vlan_hwaccel_rx(skb, card->vlangrp, vlan_tag); 2601 + else { 2602 + dev_kfree_skb_any(skb); 2603 + continue; 2604 + } 2605 + else 2606 + #endif 2594 2607 rxrc = netif_rx(skb); 2595 2608 card->dev->last_rx = jiffies; 2596 2609 card->stats.rx_packets++;