Skip to contentSkip to conversation

s390: qeth patches for net-next

PATCH In review [email protected] 2 participants 6 messages Nov 26, 2010 – Nov 29, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover s390: qeth patches for net-next

Hi Dave,

here are some patches for net-next.
The set contains also the patch from Sachin Sant to fix the s390 build.

shortlog:
Ursula Braun (1)
qeth: enable interface setup if LAN is offline

Joe Perches (1)
drivers/s390/net: Remove unnecessary semicolons

Sachin Sant (1)
qeth lcs: convert mc rwlock to RCU

Frank Blaschka (1)
qeth: l3 fix len in tso hdr

Thanks,
Frank

#1 lore raw

PATCH 1/4 qeth lcs: convert mc rwlock to RCU

From: Sachin Sant <[email protected]>

Commit 1d7138de878d1d4210727c1200193e69596f93b3
igmp: RCU conversion of in_dev->mc_list

converted rwlock to RCU.

Update the s390 network drivers(qeth & lcs) code to adapt to this change. V2 : Changes based on suggestions given by Eric Dumazet

---
 drivers/s390/net/lcs.c          |   10 ++++++----
 drivers/s390/net/qeth_l3_main.c |   11 ++++++-----
 2 files changed, 12 insertions(+), 9 deletions(-)
drivers/s390/net/lcs.c +6 -4
@@ -1188,7 +1188,8 @@ lcs_remove_mc_addresses(struct lcs_card
 	spin_lock_irqsave(&card->ipm_lock, flags);
 	list_for_each(l, &card->ipm_list) {
 		ipm = list_entry(l, struct lcs_ipm_list, list);
-		for (im4 = in4_dev->mc_list; im4 != NULL; im4 = im4->next) {
+		for (im4 = rcu_dereference(in4_dev->mc_list);
+		     im4 != NULL; im4 = rcu_dereference(im4->next_rcu)) {
 			lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
 			if ( (ipm->ipm.ip_addr == im4->multiaddr) &&
 			     (memcmp(buf, &ipm->ipm.mac_addr,
@@ -1233,7 +1234,8 @@ lcs_set_mc_addresses(struct lcs_card *ca
 	unsigned long flags;
 
 	LCS_DBF_TEXT(4, trace, "setmclst");
-	for (im4 = in4_dev->mc_list; im4; im4 = im4->next) {
+	for (im4 = rcu_dereference(in4_dev->mc_list); im4 != NULL;
+	     im4 = rcu_dereference(im4->next_rcu)) {
 		lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
 		ipm = lcs_check_addr_entry(card, im4, buf);
 		if (ipm != NULL)
@@ -1269,10 +1271,10 @@ lcs_register_mc_addresses(void *data)
 	in4_dev = in_dev_get(card->dev);
 	if (in4_dev == NULL)
 		goto out;
-	read_lock(&in4_dev->mc_list_lock);
+	rcu_read_lock();
 	lcs_remove_mc_addresses(card,in4_dev);
 	lcs_set_mc_addresses(card, in4_dev);
-	read_unlock(&in4_dev->mc_list_lock);
+	rcu_read_unlock();
 	in_dev_put(in4_dev);
 
 	netif_carrier_off(card->dev);
drivers/s390/net/qeth_l3_main.c +6 -5
@@ -1796,7 +1796,8 @@ static void qeth_l3_add_mc(struct qeth_c
 	char buf[MAX_ADDR_LEN];
 
 	QETH_CARD_TEXT(card, 4, "addmc");
-	for (im4 = in4_dev->mc_list; im4; im4 = im4->next) {
+	for (im4 = rcu_dereference(in4_dev->mc_list); im4 != NULL;
+	     im4 = rcu_dereference(im4->next_rcu)) {
 		qeth_l3_get_mac_for_ipm(im4->multiaddr, buf, in4_dev->dev);
 		ipm = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
 		if (!ipm)
@@ -1828,9 +1829,9 @@ static void qeth_l3_add_vlan_mc(struct q
 		in_dev = in_dev_get(netdev);
 		if (!in_dev)
 			continue;
-		read_lock(&in_dev->mc_list_lock);
+		rcu_read_lock();
 		qeth_l3_add_mc(card, in_dev);
-		read_unlock(&in_dev->mc_list_lock);
+		rcu_read_unlock();
 		in_dev_put(in_dev);
 	}
 }
@@ -1843,10 +1844,10 @@ static void qeth_l3_add_multicast_ipv4(s
 	in4_dev = in_dev_get(card->dev);
 	if (in4_dev == NULL)
 		return;
-	read_lock(&in4_dev->mc_list_lock);
+	rcu_read_lock();
 	qeth_l3_add_mc(card, in4_dev);
 	qeth_l3_add_vlan_mc(card);
-	read_unlock(&in4_dev->mc_list_lock);
+	rcu_read_unlock();
 	in_dev_put(in4_dev);
 }
 
#2 lore raw

PATCH 2/4 drivers/s390/net: Remove unnecessary semicolons

In reply to [email protected]

From: Joe Perches <[email protected]>

---

 drivers/s390/net/qeth_core_sys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_core_sys.c +1 -1
@@ -372,7 +372,7 @@ static ssize_t qeth_dev_performance_stat
 	i = simple_strtoul(buf, &tmp, 16);
 	if ((i == 0) || (i == 1)) {
 		if (i == card->options.performance_stats)
-			goto out;;
+			goto out;
 		card->options.performance_stats = i;
 		if (i == 0)
 			memset(&card->perf_stats, 0,
#3 lore raw

PATCH 3/4 qeth: enable interface setup if LAN is offline

In reply to [email protected]

From: Ursula Braun <[email protected]>

Device initialization of a qeth device contains a STARTLAN step. This step may fail, if cable is not yet plugged in. The qeth device stays in state HARDSETUP until cable is plugged in. This prevents further preparational initialization steps of the qeth device and its network interface. This patch makes sure initialization of qeth device continues, even though cable is not yet plugged in. Once carrier is available, qeth is notified, triggers a recovery which results in a working network interface.

---

 drivers/s390/net/qeth_l2_main.c |   11 ++++++-----
 drivers/s390/net/qeth_l3_main.c |   11 ++++++-----
 2 files changed, 12 insertions(+), 10 deletions(-)
drivers/s390/net/qeth_l2_main.c +6 -5
@@ -849,8 +849,6 @@ static int qeth_l2_open(struct net_devic
 	card->state = CARD_STATE_UP;
 	netif_start_queue(dev);
 
-	if (!card->lan_online && netif_carrier_ok(dev))
-		netif_carrier_off(dev);
 	if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) {
 		napi_enable(&card->napi);
 		napi_schedule(&card->napi);
@@ -1013,13 +1011,14 @@ static int __qeth_l2_set_online(struct c
 			dev_warn(&card->gdev->dev,
 				"The LAN is offline\n");
 			card->lan_online = 0;
-			goto out;
+			goto contin;
 		}
 		rc = -ENODEV;
 		goto out_remove;
 	} else
 		card->lan_online = 1;
 
+contin:
 	if ((card->info.type == QETH_CARD_TYPE_OSD) ||
 	    (card->info.type == QETH_CARD_TYPE_OSX))
 		/* configure isolation level */
@@ -1038,7 +1037,10 @@ static int __qeth_l2_set_online(struct c
 		goto out_remove;
 	}
 	card->state = CARD_STATE_SOFTSETUP;
-	netif_carrier_on(card->dev);
+	if (card->lan_online)
+		netif_carrier_on(card->dev);
+	else
+		netif_carrier_off(card->dev);
 
 	qeth_set_allowed_threads(card, 0xffffffff, 0);
 	if (recover_flag == CARD_STATE_RECOVER) {
@@ -1055,7 +1057,6 @@ static int __qeth_l2_set_online(struct c
 	}
 	/* let user_space know that device is online */
 	kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
-out:
 	mutex_unlock(&card->conf_mutex);
 	mutex_unlock(&card->discipline_mutex);
 	return 0;
drivers/s390/net/qeth_l3_main.c +6 -5
@@ -3177,8 +3177,6 @@ static int qeth_l3_open(struct net_devic
 	card->state = CARD_STATE_UP;
 	netif_start_queue(dev);
 
-	if (!card->lan_online && netif_carrier_ok(dev))
-		netif_carrier_off(dev);
 	if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) {
 		napi_enable(&card->napi);
 		napi_schedule(&card->napi);
@@ -3450,13 +3448,14 @@ static int __qeth_l3_set_online(struct c
 			dev_warn(&card->gdev->dev,
 				"The LAN is offline\n");
 			card->lan_online = 0;
-			goto out;
+			goto contin;
 		}
 		rc = -ENODEV;
 		goto out_remove;
 	} else
 		card->lan_online = 1;
 
+contin:
 	rc = qeth_l3_setadapter_parms(card);
 	if (rc)
 		QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
@@ -3481,10 +3480,13 @@ static int __qeth_l3_set_online(struct c
 		goto out_remove;
 	}
 	card->state = CARD_STATE_SOFTSETUP;
-	netif_carrier_on(card->dev);
 
 	qeth_set_allowed_threads(card, 0xffffffff, 0);
 	qeth_l3_set_ip_addr_list(card);
+	if (card->lan_online)
+		netif_carrier_on(card->dev);
+	else
+		netif_carrier_off(card->dev);
 	if (recover_flag == CARD_STATE_RECOVER) {
 		if (recovery_mode)
 			qeth_l3_open(card->dev);
@@ -3497,7 +3499,6 @@ static int __qeth_l3_set_online(struct c
 	}
 	/* let user_space know that device is online */
 	kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
-out:
 	mutex_unlock(&card->conf_mutex);
 	mutex_unlock(&card->discipline_mutex);
 	return 0;
#4 lore raw

PATCH 4/4 qeth: l3 fix len in tso hdr

In reply to [email protected]

From: Frank Blaschka <[email protected]>

The tso hdr is longer then the regular l3 hdr. Fix the calculation of the total len by accounting the size of the tso hdr.

---
 drivers/s390/net/qeth_l3_main.c |    1 +
 1 file changed, 1 insertion(+)
drivers/s390/net/qeth_l3_main.c +1 -0
@@ -2939,6 +2939,7 @@ static void qeth_tso_fill_header(struct
 
 	/*fix header to TSO values ...*/
 	hdr->hdr.hdr.l3.id = QETH_HEADER_TYPE_TSO;
+	hdr->hdr.hdr.l3.length = skb->len - sizeof(struct qeth_hdr_tso);
 	/*set values which are fix for the first approach ...*/
 	hdr->ext.hdr_tot_len = (__u16) sizeof(struct qeth_hdr_ext_tso);
 	hdr->ext.imb_hdr_no  = 1;