aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/iseries_veth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/iseries_veth.c')
-rw-r--r--drivers/net/iseries_veth.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index aa7286bc4364..49997194bdd0 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -604,10 +604,10 @@ static int veth_process_caps(struct veth_lpar_connection *cnx)
604 /* Convert timer to jiffies */ 604 /* Convert timer to jiffies */
605 cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000; 605 cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000;
606 606
607 if ( (remote_caps->num_buffers == 0) 607 if ( (remote_caps->num_buffers == 0) ||
608 || (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) 608 (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) ||
609 || (remote_caps->ack_threshold == 0) 609 (remote_caps->ack_threshold == 0) ||
610 || (cnx->ack_timeout == 0) ) { 610 (cnx->ack_timeout == 0) ) {
611 veth_error("Received incompatible capabilities from LPAR %d.\n", 611 veth_error("Received incompatible capabilities from LPAR %d.\n",
612 cnx->remote_lp); 612 cnx->remote_lp);
613 return HvLpEvent_Rc_InvalidSubtypeData; 613 return HvLpEvent_Rc_InvalidSubtypeData;
@@ -714,8 +714,8 @@ static void veth_statemachine(struct work_struct *work)
714 cnx->state |= VETH_STATE_OPEN; 714 cnx->state |= VETH_STATE_OPEN;
715 } 715 }
716 716
717 if ( (cnx->state & VETH_STATE_OPEN) 717 if ( (cnx->state & VETH_STATE_OPEN) &&
718 && !(cnx->state & VETH_STATE_SENTMON) ) { 718 !(cnx->state & VETH_STATE_SENTMON) ) {
719 rc = veth_signalevent(cnx, VETH_EVENT_MONITOR, 719 rc = veth_signalevent(cnx, VETH_EVENT_MONITOR,
720 HvLpEvent_AckInd_DoAck, 720 HvLpEvent_AckInd_DoAck,
721 HvLpEvent_AckType_DeferredAck, 721 HvLpEvent_AckType_DeferredAck,
@@ -724,8 +724,8 @@ static void veth_statemachine(struct work_struct *work)
724 if (rc == HvLpEvent_Rc_Good) { 724 if (rc == HvLpEvent_Rc_Good) {
725 cnx->state |= VETH_STATE_SENTMON; 725 cnx->state |= VETH_STATE_SENTMON;
726 } else { 726 } else {
727 if ( (rc != HvLpEvent_Rc_PartitionDead) 727 if ( (rc != HvLpEvent_Rc_PartitionDead) &&
728 && (rc != HvLpEvent_Rc_PathClosed) ) 728 (rc != HvLpEvent_Rc_PathClosed) )
729 veth_error("Error sending monitor to LPAR %d, " 729 veth_error("Error sending monitor to LPAR %d, "
730 "rc = %d\n", rlp, rc); 730 "rc = %d\n", rlp, rc);
731 731
@@ -735,8 +735,8 @@ static void veth_statemachine(struct work_struct *work)
735 } 735 }
736 } 736 }
737 737
738 if ( (cnx->state & VETH_STATE_OPEN) 738 if ( (cnx->state & VETH_STATE_OPEN) &&
739 && !(cnx->state & VETH_STATE_SENTCAPS)) { 739 !(cnx->state & VETH_STATE_SENTCAPS)) {
740 u64 *rawcap = (u64 *)&cnx->local_caps; 740 u64 *rawcap = (u64 *)&cnx->local_caps;
741 741
742 rc = veth_signalevent(cnx, VETH_EVENT_CAP, 742 rc = veth_signalevent(cnx, VETH_EVENT_CAP,
@@ -748,8 +748,8 @@ static void veth_statemachine(struct work_struct *work)
748 if (rc == HvLpEvent_Rc_Good) { 748 if (rc == HvLpEvent_Rc_Good) {
749 cnx->state |= VETH_STATE_SENTCAPS; 749 cnx->state |= VETH_STATE_SENTCAPS;
750 } else { 750 } else {
751 if ( (rc != HvLpEvent_Rc_PartitionDead) 751 if ( (rc != HvLpEvent_Rc_PartitionDead) &&
752 && (rc != HvLpEvent_Rc_PathClosed) ) 752 (rc != HvLpEvent_Rc_PathClosed) )
753 veth_error("Error sending caps to LPAR %d, " 753 veth_error("Error sending caps to LPAR %d, "
754 "rc = %d\n", rlp, rc); 754 "rc = %d\n", rlp, rc);
755 755
@@ -759,8 +759,8 @@ static void veth_statemachine(struct work_struct *work)
759 } 759 }
760 } 760 }
761 761
762 if ((cnx->state & VETH_STATE_GOTCAPS) 762 if ((cnx->state & VETH_STATE_GOTCAPS) &&
763 && !(cnx->state & VETH_STATE_SENTCAPACK)) { 763 !(cnx->state & VETH_STATE_SENTCAPACK)) {
764 struct veth_cap_data *remote_caps = &cnx->remote_caps; 764 struct veth_cap_data *remote_caps = &cnx->remote_caps;
765 765
766 memcpy(remote_caps, &cnx->cap_event.u.caps_data, 766 memcpy(remote_caps, &cnx->cap_event.u.caps_data,
@@ -783,9 +783,9 @@ static void veth_statemachine(struct work_struct *work)
783 goto cant_cope; 783 goto cant_cope;
784 } 784 }
785 785
786 if ((cnx->state & VETH_STATE_GOTCAPACK) 786 if ((cnx->state & VETH_STATE_GOTCAPACK) &&
787 && (cnx->state & VETH_STATE_GOTCAPS) 787 (cnx->state & VETH_STATE_GOTCAPS) &&
788 && !(cnx->state & VETH_STATE_READY)) { 788 !(cnx->state & VETH_STATE_READY)) {
789 if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) { 789 if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) {
790 /* Start the ACK timer */ 790 /* Start the ACK timer */
791 cnx->ack_timer.expires = jiffies + cnx->ack_timeout; 791 cnx->ack_timer.expires = jiffies + cnx->ack_timeout;
@@ -818,8 +818,8 @@ static int veth_init_connection(u8 rlp)
818 struct veth_msg *msgs; 818 struct veth_msg *msgs;
819 int i; 819 int i;
820 820
821 if ( (rlp == this_lp) 821 if ( (rlp == this_lp) ||
822 || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) 822 ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )
823 return 0; 823 return 0;
824 824
825 cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); 825 cnx = kzalloc(sizeof(*cnx), GFP_KERNEL);
@@ -1538,8 +1538,8 @@ static void veth_receive(struct veth_lpar_connection *cnx,
1538 cnx->pending_acks[cnx->num_pending_acks++] = 1538 cnx->pending_acks[cnx->num_pending_acks++] =
1539 event->base_event.xCorrelationToken; 1539 event->base_event.xCorrelationToken;
1540 1540
1541 if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) 1541 if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) ||
1542 || (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) ) 1542 (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) )
1543 veth_flush_acks(cnx); 1543 veth_flush_acks(cnx);
1544 1544
1545 spin_unlock_irqrestore(&cnx->lock, flags); 1545 spin_unlock_irqrestore(&cnx->lock, flags);