Skip to content

Commit

Permalink
Merge branch 's390-next'
Browse files Browse the repository at this point in the history
Ursula Braun says:

====================
s390: network patches for net-next

here are some s390 related patches for net-next
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 18, 2015
2 parents 33e9fcc + 1dafd09 commit 7b68b2f
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 97 deletions.
6 changes: 2 additions & 4 deletions drivers/s390/net/claw.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ static debug_info_t *claw_dbf_trace;
static void
claw_unregister_debug_facility(void)
{
if (claw_dbf_setup)
debug_unregister(claw_dbf_setup);
if (claw_dbf_trace)
debug_unregister(claw_dbf_trace);
debug_unregister(claw_dbf_setup);
debug_unregister(claw_dbf_trace);
}

static int
Expand Down
18 changes: 7 additions & 11 deletions drivers/s390/net/ctcm_fsms.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,11 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg)
int first = 1;
int i;
unsigned long duration;
struct timespec done_stamp = current_kernel_time(); /* xtime */
unsigned long done_stamp = jiffies;

CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name);

duration =
(done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
(done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
duration = done_stamp - ch->prof.send_stamp;
if (duration > ch->prof.tx_time)
ch->prof.tx_time = duration;

Expand Down Expand Up @@ -307,7 +305,7 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg)
spin_unlock(&ch->collect_lock);
ch->ccw[1].count = ch->trans_skb->len;
fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
ch->prof.send_stamp = current_kernel_time(); /* xtime */
ch->prof.send_stamp = jiffies;
rc = ccw_device_start(ch->cdev, &ch->ccw[0],
(unsigned long)ch, 0xff, 0);
ch->prof.doios_multi++;
Expand Down Expand Up @@ -1229,14 +1227,12 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
int rc;
struct th_header *header;
struct pdu *p_header;
struct timespec done_stamp = current_kernel_time(); /* xtime */
unsigned long done_stamp = jiffies;

CTCM_PR_DEBUG("Enter %s: %s cp:%i\n",
__func__, dev->name, smp_processor_id());

duration =
(done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
(done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
duration = done_stamp - ch->prof.send_stamp;
if (duration > ch->prof.tx_time)
ch->prof.tx_time = duration;

Expand Down Expand Up @@ -1361,7 +1357,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)

ch->ccw[1].count = ch->trans_skb->len;
fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
ch->prof.send_stamp = current_kernel_time(); /* xtime */
ch->prof.send_stamp = jiffies;
if (do_debug_ccw)
ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3);
rc = ccw_device_start(ch->cdev, &ch->ccw[0],
Expand Down Expand Up @@ -1827,7 +1823,7 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg)
fsm_newstate(wch->fsm, CTC_STATE_TX);

spin_lock_irqsave(get_ccwdev_lock(wch->cdev), saveflags);
wch->prof.send_stamp = current_kernel_time(); /* xtime */
wch->prof.send_stamp = jiffies;
rc = ccw_device_start(wch->cdev, &wch->ccw[3],
(unsigned long) wch, 0xff, 0);
spin_unlock_irqrestore(get_ccwdev_lock(wch->cdev), saveflags);
Expand Down
4 changes: 2 additions & 2 deletions drivers/s390/net/ctcm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
fsm_newstate(ch->fsm, CTC_STATE_TX);
fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
ch->prof.send_stamp = current_kernel_time(); /* xtime */
ch->prof.send_stamp = jiffies;
rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],
(unsigned long)ch, 0xff, 0);
spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);
Expand Down Expand Up @@ -831,7 +831,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
sizeof(struct ccw1) * 3);

spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
ch->prof.send_stamp = current_kernel_time(); /* xtime */
ch->prof.send_stamp = jiffies;
rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],
(unsigned long)ch, 0xff, 0);
spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/net/ctcm_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ struct ctcm_profile {
unsigned long doios_multi;
unsigned long txlen;
unsigned long tx_time;
struct timespec send_stamp;
unsigned long send_stamp;
};

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/s390/net/ctcm_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ static void ctcm_print_statistics(struct ctcm_priv *priv)
priv->channel[WRITE]->prof.doios_multi);
p += sprintf(p, " Netto bytes written: %ld\n",
priv->channel[WRITE]->prof.txlen);
p += sprintf(p, " Max. TX IO-time: %ld\n",
priv->channel[WRITE]->prof.tx_time);
p += sprintf(p, " Max. TX IO-time: %u\n",
jiffies_to_usecs(priv->channel[WRITE]->prof.tx_time));

printk(KERN_INFO "Statistics for %s:\n%s",
priv->channel[CTCM_WRITE]->netdev->name, sbuf);
Expand Down
6 changes: 2 additions & 4 deletions drivers/s390/net/lcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ static debug_info_t *lcs_dbf_trace;
static void
lcs_unregister_debug_facility(void)
{
if (lcs_dbf_setup)
debug_unregister(lcs_dbf_setup);
if (lcs_dbf_trace)
debug_unregister(lcs_dbf_trace);
debug_unregister(lcs_dbf_setup);
debug_unregister(lcs_dbf_trace);
}

static int
Expand Down
15 changes: 6 additions & 9 deletions drivers/s390/net/netiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ struct connection_profile {
unsigned long doios_multi;
unsigned long txlen;
unsigned long tx_time;
struct timespec send_stamp;
unsigned long send_stamp;
unsigned long tx_pending;
unsigned long tx_max_pending;
};
Expand Down Expand Up @@ -487,12 +487,9 @@ DEFINE_PER_CPU(char[256], iucv_dbf_txt_buf);

static void iucv_unregister_dbf_views(void)
{
if (iucv_dbf_setup)
debug_unregister(iucv_dbf_setup);
if (iucv_dbf_data)
debug_unregister(iucv_dbf_data);
if (iucv_dbf_trace)
debug_unregister(iucv_dbf_trace);
debug_unregister(iucv_dbf_setup);
debug_unregister(iucv_dbf_data);
debug_unregister(iucv_dbf_trace);
}
static int iucv_register_dbf_views(void)
{
Expand Down Expand Up @@ -786,7 +783,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)

header.next = 0;
memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
conn->prof.send_stamp = current_kernel_time();
conn->prof.send_stamp = jiffies;
txmsg.class = 0;
txmsg.tag = 0;
rc = iucv_message_send(conn->path, &txmsg, 0, 0,
Expand Down Expand Up @@ -1220,7 +1217,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);

fsm_newstate(conn->fsm, CONN_STATE_TX);
conn->prof.send_stamp = current_kernel_time();
conn->prof.send_stamp = jiffies;

msg.tag = 1;
msg.class = 0;
Expand Down
1 change: 0 additions & 1 deletion drivers/s390/net/qeth_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ struct qeth_channel {
struct ccw1 ccw;
spinlock_t iob_lock;
wait_queue_head_t wait_q;
struct tasklet_struct irq_tasklet;
struct ccw_device *ccwdev;
/*command buffer for control data*/
struct qeth_cmd_buffer iob[QETH_CMD_BUFFER_NO];
Expand Down
45 changes: 18 additions & 27 deletions drivers/s390/net/qeth_core_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct qeth_card *card = dev_get_drvdata(dev);
char *tmp;
int rc = 0;

if (!card)
Expand All @@ -253,36 +252,35 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
goto out;
}

tmp = strsep((char **) &buf, "\n");
if (!strcmp(tmp, "prio_queueing_prec")) {
if (sysfs_streq(buf, "prio_queueing_prec")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else if (!strcmp(tmp, "prio_queueing_skb")) {
} else if (sysfs_streq(buf, "prio_queueing_skb")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_SKB;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else if (!strcmp(tmp, "prio_queueing_tos")) {
} else if (sysfs_streq(buf, "prio_queueing_tos")) {
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else if (!strcmp(tmp, "prio_queueing_vlan")) {
} else if (sysfs_streq(buf, "prio_queueing_vlan")) {
if (!card->options.layer2) {
rc = -ENOTSUPP;
goto out;
}
card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else if (!strcmp(tmp, "no_prio_queueing:0")) {
} else if (sysfs_streq(buf, "no_prio_queueing:0")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = 0;
} else if (!strcmp(tmp, "no_prio_queueing:1")) {
} else if (sysfs_streq(buf, "no_prio_queueing:1")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = 1;
} else if (!strcmp(tmp, "no_prio_queueing:2")) {
} else if (sysfs_streq(buf, "no_prio_queueing:2")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = 2;
} else if (!strcmp(tmp, "no_prio_queueing:3")) {
} else if (sysfs_streq(buf, "no_prio_queueing:3")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = 3;
} else if (!strcmp(tmp, "no_prio_queueing")) {
} else if (sysfs_streq(buf, "no_prio_queueing")) {
card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
} else
Expand Down Expand Up @@ -497,8 +495,6 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
struct qeth_card *card = dev_get_drvdata(dev);
enum qeth_ipa_isolation_modes isolation;
int rc = 0;
char *tmp, *curtoken;
curtoken = (char *) buf;

if (!card)
return -EINVAL;
Expand All @@ -515,12 +511,11 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
}

/* parse input into isolation mode */
tmp = strsep(&curtoken, "\n");
if (!strcmp(tmp, ATTR_QETH_ISOLATION_NONE)) {
if (sysfs_streq(buf, ATTR_QETH_ISOLATION_NONE)) {
isolation = ISOLATION_MODE_NONE;
} else if (!strcmp(tmp, ATTR_QETH_ISOLATION_FWD)) {
} else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_FWD)) {
isolation = ISOLATION_MODE_FWD;
} else if (!strcmp(tmp, ATTR_QETH_ISOLATION_DROP)) {
} else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_DROP)) {
isolation = ISOLATION_MODE_DROP;
} else {
rc = -EINVAL;
Expand All @@ -531,8 +526,7 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
/* defer IP assist if device is offline (until discipline->set_online)*/
card->options.prev_isolation = card->options.isolation;
card->options.isolation = isolation;
if (card->state == CARD_STATE_SOFTSETUP ||
card->state == CARD_STATE_UP) {
if (qeth_card_hw_is_reachable(card)) {
int ipa_rc = qeth_set_access_ctrl_online(card, 1);
if (ipa_rc != 0)
rc = ipa_rc;
Expand All @@ -555,7 +549,7 @@ static ssize_t qeth_dev_switch_attrs_show(struct device *dev,
if (!card)
return -EINVAL;

if (card->state != CARD_STATE_SOFTSETUP && card->state != CARD_STATE_UP)
if (!qeth_card_hw_is_reachable(card))
return sprintf(buf, "n/a\n");

rc = qeth_query_switch_attributes(card, &sw_info);
Expand Down Expand Up @@ -598,19 +592,16 @@ static ssize_t qeth_hw_trap_store(struct device *dev,
{
struct qeth_card *card = dev_get_drvdata(dev);
int rc = 0;
char *tmp, *curtoken;
int state = 0;
curtoken = (char *)buf;

if (!card)
return -EINVAL;

mutex_lock(&card->conf_mutex);
if (card->state == CARD_STATE_SOFTSETUP || card->state == CARD_STATE_UP)
if (qeth_card_hw_is_reachable(card))
state = 1;
tmp = strsep(&curtoken, "\n");

if (!strcmp(tmp, "arm") && !card->info.hwtrap) {
if (sysfs_streq(buf, "arm") && !card->info.hwtrap) {
if (state) {
if (qeth_is_diagass_supported(card,
QETH_DIAGS_CMD_TRAP)) {
Expand All @@ -621,14 +612,14 @@ static ssize_t qeth_hw_trap_store(struct device *dev,
rc = -EINVAL;
} else
card->info.hwtrap = 1;
} else if (!strcmp(tmp, "disarm") && card->info.hwtrap) {
} else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) {
if (state) {
rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
if (!rc)
card->info.hwtrap = 0;
} else
card->info.hwtrap = 0;
} else if (!strcmp(tmp, "trap") && state && card->info.hwtrap)
} else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap)
rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE);
else
rc = -EINVAL;
Expand Down
6 changes: 2 additions & 4 deletions drivers/s390/net/qeth_l2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (!card)
return -ENODEV;

if ((card->state != CARD_STATE_UP) &&
(card->state != CARD_STATE_SOFTSETUP))
if (!qeth_card_hw_is_reachable(card))
return -ENODEV;

if (card->info.type == QETH_CARD_TYPE_OSN)
Expand Down Expand Up @@ -1344,8 +1343,7 @@ int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
if (!card)
return -ENODEV;
QETH_CARD_TEXT(card, 2, "osnsdmc");
if ((card->state != CARD_STATE_UP) &&
(card->state != CARD_STATE_SOFTSETUP))
if (!qeth_card_hw_is_reachable(card))
return -ENODEV;
iob = qeth_wait_for_buffer(&card->write);
memcpy(iob->data+IPA_PDU_HEADER_SIZE, data, data_len);
Expand Down
7 changes: 2 additions & 5 deletions drivers/s390/net/qeth_l3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,8 @@ void qeth_l3_set_ip_addr_list(struct qeth_card *card)
QETH_CARD_TEXT(card, 2, "sdiplist");
QETH_CARD_HEX(card, 2, &card, sizeof(void *));

if ((card->state != CARD_STATE_UP &&
card->state != CARD_STATE_SOFTSETUP) || card->options.sniffer) {
if (!qeth_card_hw_is_reachable(card) || card->options.sniffer)
return;
}

spin_lock_irqsave(&card->ip_lock, flags);
tbd_list = card->ip_tbd_list;
Expand Down Expand Up @@ -2626,8 +2624,7 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (!card)
return -ENODEV;

if ((card->state != CARD_STATE_UP) &&
(card->state != CARD_STATE_SOFTSETUP))
if (!qeth_card_hw_is_reachable(card))
return -ENODEV;

switch (cmd) {
Expand Down
Loading

0 comments on commit 7b68b2f

Please sign in to comment.