Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/815119/?format=api
{ "id": 815119, "url": "http://patchwork.ozlabs.org/api/1.2/patches/815119/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170918191822.65142-4-jwi@linux.vnet.ibm.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170918191822.65142-4-jwi@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2017-09-18T19:18:16", "name": "[net-next,3/9] s390/qeth: add VNICC get/set timeout support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "91b423040c392f33d97db2311f4649f422336293", "submitter": { "id": 71397, "url": "http://patchwork.ozlabs.org/api/1.2/people/71397/?format=api", "name": "Julian Wiedmann", "email": "jwi@linux.vnet.ibm.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170918191822.65142-4-jwi@linux.vnet.ibm.com/mbox/", "series": [ { "id": 3715, "url": "http://patchwork.ozlabs.org/api/1.2/series/3715/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=3715", "date": "2017-09-18T19:18:13", "name": "s390/qeth: updates 2017-09-18", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3715/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/815119/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/815119/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwwnM3Lyzz9s7v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 05:20:07 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751453AbdIRTUF (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 15:20:05 -0400", "from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40030 \"EHLO\n\tmx0a-001b2d01.pphosted.com\" rhost-flags-OK-OK-OK-FAIL)\n\tby vger.kernel.org with ESMTP id S1750897AbdIRTUE (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 15:20:04 -0400", "from pps.filterd (m0098417.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8IJJx12091078\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 15:20:03 -0400", "from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d2ea07ay0-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 15:20:00 -0400", "from localhost\n\tby e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <netdev@vger.kernel.org> from <jwi@linux.vnet.ibm.com>;\n\tMon, 18 Sep 2017 20:19:24 +0100", "from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194)\n\tby e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tMon, 18 Sep 2017 20:19:22 +0100", "from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com\n\t[9.149.105.232])\n\tby b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8IJJLJS19595394; Mon, 18 Sep 2017 19:19:21 GMT", "from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 3E2FA5203F;\n\tMon, 18 Sep 2017 19:14:22 +0100 (BST)", "from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 00A9052047; \n\tMon, 18 Sep 2017 19:14:21 +0100 (BST)" ], "From": "Julian Wiedmann <jwi@linux.vnet.ibm.com>", "To": "David Miller <davem@davemloft.net>", "Cc": "<netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,\n\tMartin Schwidefsky <schwidefsky@de.ibm.com>,\n\tHeiko Carstens <heiko.carstens@de.ibm.com>,\n\tStefan Raspl <raspl@linux.vnet.ibm.com>,\n\tUrsula Braun <ubraun@linux.vnet.ibm.com>,\n\tJulian Wiedmann <jwi@linux.vnet.ibm.com>", "Subject": "[PATCH net-next 3/9] s390/qeth: add VNICC get/set timeout support", "Date": "Mon, 18 Sep 2017 21:18:16 +0200", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170918191822.65142-1-jwi@linux.vnet.ibm.com>", "References": "<20170918191822.65142-1-jwi@linux.vnet.ibm.com>", "X-TM-AS-GCONF": "00", "x-cbid": "17091819-0012-0000-0000-00000579E6CC", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17091819-0013-0000-0000-000018F316B4", "Message-Id": "<20170918191822.65142-4-jwi@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-18_08:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709180272", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "From: Hans Wippel <hwippel@linux.vnet.ibm.com>\n\nHiperSockets allow configuring so called VNIC Characteristics (VNICC)\nthat influence how the underlying hardware handles packets. For VNICCs,\nadditional commands for getting and setting timeouts are available.\nCurrently, the learning VNICC uses these commands.\n\n* Learning VNICC: If learning is enabled on a qeth device, the device\n learns the source MAC addresses of outgoing packets and incoming\n packets to those learned MAC addresses are received.\n\nFor learning, the timeout specifies the idle period in seconds, after\nwhich the underlying hardware removes a learned MAC address again.\n\nThis patch adds support for the IPA commands that are required to get\nand set the current timeout values for the learning VNIC characteristic.\nAlso, it introduces the sysfs interface that allows users to configure\nthe timeout.\n\nSigned-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>\nReviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>\nSigned-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>\n---\n drivers/s390/net/qeth_core.h | 3 +\n drivers/s390/net/qeth_core_mpc.h | 11 ++++\n drivers/s390/net/qeth_l2.h | 2 +\n drivers/s390/net/qeth_l2_main.c | 135 +++++++++++++++++++++++++++++++++++++--\n drivers/s390/net/qeth_l2_sys.c | 44 +++++++++++++\n 5 files changed, 190 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h\nindex 2236c0c9744a..e3d3609cd9e7 100644\n--- a/drivers/s390/net/qeth_core.h\n+++ b/drivers/s390/net/qeth_core.h\n@@ -188,6 +188,9 @@ struct qeth_vnicc_info {\n \tu32 cur_chars;\n \t/* supported commands: bitmasks which VNICCs support respective cmd */\n \tu32 set_char_sup;\n+\tu32 getset_timeout_sup;\n+\t/* timeout value for the learning characteristic */\n+\tu32 learning_timeout;\n \t/* characteristics wanted/configured by user */\n \tu32 wanted_chars;\n \t/* has user explicitly enabled rx_bcast while online? */\ndiff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h\nindex 7f67a81a2ae6..2f1f0da3d089 100644\n--- a/drivers/s390/net/qeth_core_mpc.h\n+++ b/drivers/s390/net/qeth_core_mpc.h\n@@ -562,6 +562,8 @@ struct qeth_ipacmd_diagass {\n #define IPA_VNICC_QUERY_CMDS\t\t0x00000001L\n #define IPA_VNICC_ENABLE\t\t0x00000002L\n #define IPA_VNICC_DISABLE\t\t0x00000004L\n+#define IPA_VNICC_SET_TIMEOUT\t\t0x00000008L\n+#define IPA_VNICC_GET_TIMEOUT\t\t0x00000010L\n \n /* VNICC flags */\n #define QETH_VNICC_FLOODING\t\t0x80000000\n@@ -575,6 +577,8 @@ struct qeth_ipacmd_diagass {\n /* VNICC default values */\n #define QETH_VNICC_ALL\t\t\t0xff000000\n #define QETH_VNICC_DEFAULT\t\tQETH_VNICC_RX_BCAST\n+/* default VNICC timeout in seconds */\n+#define QETH_VNICC_DEFAULT_TIMEOUT\t600\n \n /* VNICC header */\n struct qeth_ipacmd_vnicc_hdr {\n@@ -600,6 +604,12 @@ struct qeth_vnicc_set_char {\n \tu32 vnic_char;\n };\n \n+/* get/set timeout for VNIC characteristic */\n+struct qeth_vnicc_getset_timeout {\n+\tu32 vnic_char;\n+\tu32 timeout;\n+};\n+\n /* complete VNICC IPA command message */\n struct qeth_ipacmd_vnicc {\n \tstruct qeth_ipacmd_vnicc_hdr hdr;\n@@ -607,6 +617,7 @@ struct qeth_ipacmd_vnicc {\n \tunion {\n \t\tstruct qeth_vnicc_query_cmds query_cmds;\n \t\tstruct qeth_vnicc_set_char set_char;\n+\t\tstruct qeth_vnicc_getset_timeout getset_timeout;\n \t};\n };\n \ndiff --git a/drivers/s390/net/qeth_l2.h b/drivers/s390/net/qeth_l2.h\nindex 0619018c76f9..241df6b98ab4 100644\n--- a/drivers/s390/net/qeth_l2.h\n+++ b/drivers/s390/net/qeth_l2.h\n@@ -16,6 +16,8 @@ void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card);\n \n int qeth_l2_vnicc_set_state(struct qeth_card *card, u32 vnicc, bool state);\n int qeth_l2_vnicc_get_state(struct qeth_card *card, u32 vnicc, bool *state);\n+int qeth_l2_vnicc_set_timeout(struct qeth_card *card, u32 timeout);\n+int qeth_l2_vnicc_get_timeout(struct qeth_card *card, u32 *timeout);\n bool qeth_l2_vnicc_is_in_use(struct qeth_card *card);\n \n struct qeth_mac {\ndiff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c\nindex 36a7fd7255e3..25a0f381bcd5 100644\n--- a/drivers/s390/net/qeth_l2_main.c\n+++ b/drivers/s390/net/qeth_l2_main.c\n@@ -35,6 +35,8 @@ static void qeth_bridge_host_event(struct qeth_card *card,\n \t\t\t\t\tstruct qeth_ipa_cmd *cmd);\n static void qeth_l2_vnicc_set_defaults(struct qeth_card *card);\n static void qeth_l2_vnicc_init(struct qeth_card *card);\n+static bool qeth_l2_vnicc_recover_timeout(struct qeth_card *card, u32 vnicc,\n+\t\t\t\t\t u32 *timeout);\n \n static int qeth_l2_verify_dev(struct net_device *dev)\n {\n@@ -2096,9 +2098,13 @@ struct _qeth_l2_vnicc_request_cbctl {\n \tu32 sub_cmd;\n \tstruct {\n \t\tu32 vnic_char;\n+\t\tu32 timeout;\n \t} param;\n \tstruct {\n-\t\tu32 *sup_cmds;\n+\t\tunion{\n+\t\t\tu32 *sup_cmds;\n+\t\t\tu32 *timeout;\n+\t\t};\n \t} result;\n };\n \n@@ -2122,6 +2128,9 @@ static int qeth_l2_vnicc_request_cb(struct qeth_card *card,\n \tif (cbctl->sub_cmd == IPA_VNICC_QUERY_CMDS)\n \t\t*cbctl->result.sup_cmds = rep->query_cmds.sup_cmds;\n \n+\tif (cbctl->sub_cmd == IPA_VNICC_GET_TIMEOUT)\n+\t\t*cbctl->result.timeout = rep->getset_timeout.timeout;\n+\n \treturn 0;\n }\n \n@@ -2162,6 +2171,13 @@ static int qeth_l2_vnicc_request(struct qeth_card *card,\n \t\treq->sub_hdr.data_length += sizeof(req->set_char);\n \t\treq->set_char.vnic_char = cbctl->param.vnic_char;\n \t\tbreak;\n+\tcase IPA_VNICC_SET_TIMEOUT:\n+\t\treq->getset_timeout.timeout = cbctl->param.timeout;\n+\t\t/* fallthrough */\n+\tcase IPA_VNICC_GET_TIMEOUT:\n+\t\treq->sub_hdr.data_length += sizeof(req->getset_timeout);\n+\t\treq->getset_timeout.vnic_char = cbctl->param.vnic_char;\n+\t\tbreak;\n \tdefault:\n \t\tqeth_release_buffer(iob->channel, iob);\n \t\treturn -EOPNOTSUPP;\n@@ -2215,6 +2231,24 @@ static int qeth_l2_vnicc_set_char(struct qeth_card *card, u32 vnic_char,\n \treturn qeth_l2_vnicc_request(card, &cbctl);\n }\n \n+/* VNICC get/set timeout for characteristic request */\n+static int qeth_l2_vnicc_getset_timeout(struct qeth_card *card, u32 vnicc,\n+\t\t\t\t\tu32 cmd, u32 *timeout)\n+{\n+\tstruct _qeth_l2_vnicc_request_cbctl cbctl;\n+\n+\t/* prepare callback control */\n+\tcbctl.sub_cmd = cmd;\n+\tcbctl.param.vnic_char = vnicc;\n+\tif (cmd == IPA_VNICC_SET_TIMEOUT)\n+\t\tcbctl.param.timeout = *timeout;\n+\tif (cmd == IPA_VNICC_GET_TIMEOUT)\n+\t\tcbctl.result.timeout = timeout;\n+\n+\tQETH_CARD_TEXT(card, 2, \"vniccgst\");\n+\treturn qeth_l2_vnicc_request(card, &cbctl);\n+}\n+\n /* set current VNICC flag state; called from sysfs store function */\n int qeth_l2_vnicc_set_state(struct qeth_card *card, u32 vnicc, bool state)\n {\n@@ -2258,8 +2292,14 @@ int qeth_l2_vnicc_set_state(struct qeth_card *card, u32 vnicc, bool state)\n \tif (rc)\n \t\tcard->options.vnicc.wanted_chars =\n \t\t\tcard->options.vnicc.cur_chars;\n-\telse if (state && vnicc == QETH_VNICC_RX_BCAST)\n-\t\tcard->options.vnicc.rx_bcast_enabled = true;\n+\telse {\n+\t\t/* successful online VNICC change; handle special cases */\n+\t\tif (state && vnicc == QETH_VNICC_RX_BCAST)\n+\t\t\tcard->options.vnicc.rx_bcast_enabled = true;\n+\t\tif (!state && vnicc == QETH_VNICC_LEARNING)\n+\t\t\tqeth_l2_vnicc_recover_timeout(card, vnicc,\n+\t\t\t\t\t&card->options.vnicc.learning_timeout);\n+\t}\n \n \treturn rc;\n }\n@@ -2287,6 +2327,70 @@ int qeth_l2_vnicc_get_state(struct qeth_card *card, u32 vnicc, bool *state)\n \treturn rc;\n }\n \n+/* set VNICC timeout; called from sysfs store function. Currently, only learning\n+ * supports timeout\n+ */\n+int qeth_l2_vnicc_set_timeout(struct qeth_card *card, u32 timeout)\n+{\n+\tint rc = 0;\n+\n+\tQETH_CARD_TEXT(card, 2, \"vniccsto\");\n+\n+\t/* do not change anything if BridgePort is enabled */\n+\tif (qeth_bridgeport_is_in_use(card))\n+\t\treturn -EBUSY;\n+\n+\t/* check if characteristic and set_timeout are supported */\n+\tif (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) ||\n+\t !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING))\n+\t\treturn -EOPNOTSUPP;\n+\n+\t/* do we need to do anything? */\n+\tif (card->options.vnicc.learning_timeout == timeout)\n+\t\treturn rc;\n+\n+\t/* if card is not ready, simply store the value internally and return */\n+\tif (!qeth_card_hw_is_reachable(card)) {\n+\t\tcard->options.vnicc.learning_timeout = timeout;\n+\t\treturn rc;\n+\t}\n+\n+\t/* send timeout value to card; if successful, store value internally */\n+\trc = qeth_l2_vnicc_getset_timeout(card, QETH_VNICC_LEARNING,\n+\t\t\t\t\t IPA_VNICC_SET_TIMEOUT, &timeout);\n+\tif (!rc)\n+\t\tcard->options.vnicc.learning_timeout = timeout;\n+\n+\treturn rc;\n+}\n+\n+/* get current VNICC timeout; called from sysfs show function. Currently, only\n+ * learning supports timeout\n+ */\n+int qeth_l2_vnicc_get_timeout(struct qeth_card *card, u32 *timeout)\n+{\n+\tint rc = 0;\n+\n+\tQETH_CARD_TEXT(card, 2, \"vniccgto\");\n+\n+\t/* do not get anything if BridgePort is enabled */\n+\tif (qeth_bridgeport_is_in_use(card))\n+\t\treturn -EBUSY;\n+\n+\t/* check if characteristic and get_timeout are supported */\n+\tif (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) ||\n+\t !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING))\n+\t\treturn -EOPNOTSUPP;\n+\t/* if card is ready, get timeout. Otherwise, just return stored value */\n+\t*timeout = card->options.vnicc.learning_timeout;\n+\tif (qeth_card_hw_is_reachable(card))\n+\t\trc = qeth_l2_vnicc_getset_timeout(card, QETH_VNICC_LEARNING,\n+\t\t\t\t\t\t IPA_VNICC_GET_TIMEOUT,\n+\t\t\t\t\t\t timeout);\n+\n+\treturn rc;\n+}\n+\n /* check if VNICC is currently enabled */\n bool qeth_l2_vnicc_is_in_use(struct qeth_card *card)\n {\n@@ -2304,6 +2408,19 @@ bool qeth_l2_vnicc_is_in_use(struct qeth_card *card)\n \treturn true;\n }\n \n+/* recover user timeout setting */\n+static bool qeth_l2_vnicc_recover_timeout(struct qeth_card *card, u32 vnicc,\n+\t\t\t\t\t u32 *timeout)\n+{\n+\tif (card->options.vnicc.sup_chars & vnicc &&\n+\t card->options.vnicc.getset_timeout_sup & vnicc &&\n+\t !qeth_l2_vnicc_getset_timeout(card, vnicc, IPA_VNICC_SET_TIMEOUT,\n+\t\t\t\t\t timeout))\n+\t\treturn false;\n+\t*timeout = QETH_VNICC_DEFAULT_TIMEOUT;\n+\treturn true;\n+}\n+\n /* recover user characteristic setting */\n static bool qeth_l2_vnicc_recover_char(struct qeth_card *card, u32 vnicc,\n \t\t\t\t bool enable)\n@@ -2322,6 +2439,7 @@ static bool qeth_l2_vnicc_recover_char(struct qeth_card *card, u32 vnicc,\n /* (re-)initialize VNICC */\n static void qeth_l2_vnicc_init(struct qeth_card *card)\n {\n+\tu32 *timeout = &card->options.vnicc.learning_timeout;\n \tunsigned int chars_len, i;\n \tunsigned long chars_tmp;\n \tu32 sup_cmds, vnicc;\n@@ -2332,7 +2450,8 @@ static void qeth_l2_vnicc_init(struct qeth_card *card)\n \tcard->options.vnicc.rx_bcast_enabled = 0;\n \t/* initial query and storage of VNIC characteristics */\n \tif (qeth_l2_vnicc_query_chars(card)) {\n-\t\tif (card->options.vnicc.wanted_chars != QETH_VNICC_DEFAULT)\n+\t\tif (card->options.vnicc.wanted_chars != QETH_VNICC_DEFAULT ||\n+\t\t *timeout != QETH_VNICC_DEFAULT_TIMEOUT)\n \t\t\tdev_err(&card->gdev->dev, \"Configuring the VNIC characteristics failed\\n\");\n \t\t/* fail quietly if user didn't change the default config */\n \t\tcard->options.vnicc.sup_chars = 0;\n@@ -2346,12 +2465,16 @@ static void qeth_l2_vnicc_init(struct qeth_card *card)\n \tfor_each_set_bit(i, &chars_tmp, chars_len) {\n \t\tvnicc = BIT(i);\n \t\tqeth_l2_vnicc_query_cmds(card, vnicc, &sup_cmds);\n+\t\tif (!(sup_cmds & IPA_VNICC_SET_TIMEOUT) ||\n+\t\t !(sup_cmds & IPA_VNICC_GET_TIMEOUT))\n+\t\t\tcard->options.vnicc.getset_timeout_sup &= ~vnicc;\n \t\tif (!(sup_cmds & IPA_VNICC_ENABLE) ||\n \t\t !(sup_cmds & IPA_VNICC_DISABLE))\n \t\t\tcard->options.vnicc.set_char_sup &= ~vnicc;\n \t}\n \t/* enforce assumed default values and recover settings, if changed */\n-\terror = false;\n+\terror = qeth_l2_vnicc_recover_timeout(card, QETH_VNICC_LEARNING,\n+\t\t\t\t\t timeout);\n \tchars_tmp = card->options.vnicc.wanted_chars ^ QETH_VNICC_DEFAULT;\n \tchars_tmp |= QETH_VNICC_BRIDGE_INVISIBLE;\n \tchars_len = sizeof(card->options.vnicc.wanted_chars) * BITS_PER_BYTE;\n@@ -2370,8 +2493,10 @@ static void qeth_l2_vnicc_set_defaults(struct qeth_card *card)\n \t/* characteristics values */\n \tcard->options.vnicc.sup_chars = QETH_VNICC_ALL;\n \tcard->options.vnicc.cur_chars = QETH_VNICC_DEFAULT;\n+\tcard->options.vnicc.learning_timeout = QETH_VNICC_DEFAULT_TIMEOUT;\n \t/* supported commands */\n \tcard->options.vnicc.set_char_sup = QETH_VNICC_ALL;\n+\tcard->options.vnicc.getset_timeout_sup = QETH_VNICC_LEARNING;\n \t/* settings wanted by users */\n \tcard->options.vnicc.wanted_chars = QETH_VNICC_DEFAULT;\n }\ndiff --git a/drivers/s390/net/qeth_l2_sys.c b/drivers/s390/net/qeth_l2_sys.c\nindex 01936f7dbe7e..4608daedb204 100644\n--- a/drivers/s390/net/qeth_l2_sys.c\n+++ b/drivers/s390/net/qeth_l2_sys.c\n@@ -309,6 +309,47 @@ static u32 qeth_l2_vnicc_sysfs_attr_to_char(const char *attr_name)\n \treturn 0;\n }\n \n+/* get current timeout setting */\n+static ssize_t qeth_vnicc_timeout_show(struct device *dev,\n+\t\t\t\t struct device_attribute *attr, char *buf)\n+{\n+\tstruct qeth_card *card = dev_get_drvdata(dev);\n+\tu32 timeout;\n+\tint rc;\n+\n+\tif (!card)\n+\t\treturn -EINVAL;\n+\n+\trc = qeth_l2_vnicc_get_timeout(card, &timeout);\n+\tif (rc == -EBUSY)\n+\t\treturn sprintf(buf, \"n/a (BridgePort)\\n\");\n+\tif (rc == -EOPNOTSUPP)\n+\t\treturn sprintf(buf, \"n/a\\n\");\n+\treturn rc ? rc : sprintf(buf, \"%d\\n\", timeout);\n+}\n+\n+/* change timeout setting */\n+static ssize_t qeth_vnicc_timeout_store(struct device *dev,\n+\t\t\t\t\tstruct device_attribute *attr,\n+\t\t\t\t\tconst char *buf, size_t count)\n+{\n+\tstruct qeth_card *card = dev_get_drvdata(dev);\n+\tu32 timeout;\n+\tint rc;\n+\n+\tif (!card)\n+\t\treturn -EINVAL;\n+\n+\trc = kstrtou32(buf, 10, &timeout);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\tmutex_lock(&card->conf_mutex);\n+\trc = qeth_l2_vnicc_set_timeout(card, timeout);\n+\tmutex_unlock(&card->conf_mutex);\n+\treturn rc ? rc : count;\n+}\n+\n /* get current setting of characteristic */\n static ssize_t qeth_vnicc_char_show(struct device *dev,\n \t\t\t\t struct device_attribute *attr, char *buf)\n@@ -359,6 +400,8 @@ static DEVICE_ATTR(flooding, 0644, qeth_vnicc_char_show, qeth_vnicc_char_store);\n static DEVICE_ATTR(mcast_flooding, 0644, qeth_vnicc_char_show,\n \t\t qeth_vnicc_char_store);\n static DEVICE_ATTR(learning, 0644, qeth_vnicc_char_show, qeth_vnicc_char_store);\n+static DEVICE_ATTR(learning_timeout, 0644, qeth_vnicc_timeout_show,\n+\t\t qeth_vnicc_timeout_store);\n static DEVICE_ATTR(takeover_setvmac, 0644, qeth_vnicc_char_show,\n \t\t qeth_vnicc_char_store);\n static DEVICE_ATTR(takeover_learning, 0644, qeth_vnicc_char_show,\n@@ -371,6 +414,7 @@ static struct attribute *qeth_l2_vnicc_attrs[] = {\n \t&dev_attr_flooding.attr,\n \t&dev_attr_mcast_flooding.attr,\n \t&dev_attr_learning.attr,\n+\t&dev_attr_learning_timeout.attr,\n \t&dev_attr_takeover_setvmac.attr,\n \t&dev_attr_takeover_learning.attr,\n \t&dev_attr_bridge_invisible.attr,\n", "prefixes": [ "net-next", "3/9" ] }