{"id":815123,"url":"http://patchwork.ozlabs.org/api/1.2/patches/815123/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170918191822.65142-8-jwi@linux.vnet.ibm.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","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-8-jwi@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-18T19:18:20","name":"[net-next,7/9] s390/qeth: translate SETVLAN/DELVLAN errors","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"2a908814128361cbcf5f5f02190344b27f66102d","submitter":{"id":71397,"url":"http://patchwork.ozlabs.org/api/1.2/people/71397/?format=json","name":"Julian Wiedmann","email":"jwi@linux.vnet.ibm.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170918191822.65142-8-jwi@linux.vnet.ibm.com/mbox/","series":[{"id":3715,"url":"http://patchwork.ozlabs.org/api/1.2/series/3715/?format=json","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/815123/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815123/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 3xwwp21PDhz9s81\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 05:20:41 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751488AbdIRTU0 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 15:20:26 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46815 \"EHLO\n\tmx0a-001b2d01.pphosted.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1750772AbdIRTUZ (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 15:20:25 -0400","from pps.filterd (m0098409.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8IJKPj3038436\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 15:20:25 -0400","from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d2hwt8mg5-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:21 -0400","from localhost\n\tby e06smtp14.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:29 +0100","from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194)\n\tby e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tMon, 18 Sep 2017 20:19:27 +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 v8IJJQ9Z19398784; Mon, 18 Sep 2017 19:19:26 GMT","from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 3DA9E5203F;\n\tMon, 18 Sep 2017 19:14:27 +0100 (BST)","from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 015AC52045; \n\tMon, 18 Sep 2017 19:14:26 +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 7/9] s390/qeth: translate SETVLAN/DELVLAN errors","Date":"Mon, 18 Sep 2017 21:18:20 +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-0016-0000-0000-000004EDDFD2","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091819-0017-0000-0000-000028280F40","Message-Id":"<20170918191822.65142-8-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":"Properly return any error encountered during VLAN processing to the\nthe caller.\nResulting change in behaviour: if SETVLAN fails while registering a\nnew VLAN ID, the stack no longer creates the corresponding vlan device.\n\nSigned-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>\nReviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com>\n---\n drivers/s390/net/qeth_core_mpc.h |  1 +\n drivers/s390/net/qeth_l2_main.c  | 47 ++++++++++++++++++++++++++++++----------\n 2 files changed, 36 insertions(+), 12 deletions(-)","diff":"diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h\nindex 2f1f0da3d089..6a7654df6e78 100644\n--- a/drivers/s390/net/qeth_core_mpc.h\n+++ b/drivers/s390/net/qeth_core_mpc.h\n@@ -166,6 +166,7 @@ enum qeth_ipa_return_codes {\n \tIPA_RC_L2_INVALID_VLAN_ID\t= 0x2015,\n \tIPA_RC_L2_DUP_VLAN_ID\t\t= 0x2016,\n \tIPA_RC_L2_VLAN_ID_NOT_FOUND\t= 0x2017,\n+\tIPA_RC_L2_VLAN_ID_NOT_ALLOWED\t= 0x2050,\n \tIPA_RC_VNICC_VNICBP\t\t= 0x20B0,\n \tIPA_RC_SBP_OSA_NOT_CONFIGURED\t= 0x2B0C,\n \tIPA_RC_SBP_OSA_OS_MISMATCH\t= 0x2B10,\ndiff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c\nindex 009de7248cc7..7b61c2ef4c74 100644\n--- a/drivers/s390/net/qeth_l2_main.c\n+++ b/drivers/s390/net/qeth_l2_main.c\n@@ -78,7 +78,7 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)\n \treturn ndev;\n }\n \n-static int qeth_setdel_makerc(struct qeth_card *card, int retcode)\n+static int qeth_setdelmac_makerc(struct qeth_card *card, int retcode)\n {\n \tint rc;\n \n@@ -128,8 +128,8 @@ static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac,\n \tcmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);\n \tcmd->data.setdelmac.mac_length = OSA_ADDR_LEN;\n \tmemcpy(&cmd->data.setdelmac.mac, mac, OSA_ADDR_LEN);\n-\treturn qeth_setdel_makerc(card, qeth_send_ipa_cmd(card, iob,\n-\t\t\t\t\tNULL, NULL));\n+\treturn qeth_setdelmac_makerc(card, qeth_send_ipa_cmd(card, iob,\n+\t\t\t\t\t   NULL, NULL));\n }\n \n static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac)\n@@ -289,17 +289,40 @@ static void qeth_l2_fill_header(struct qeth_hdr *hdr, struct sk_buff *skb,\n \t}\n }\n \n+static int qeth_setdelvlan_makerc(struct qeth_card *card, int retcode)\n+{\n+\tif (retcode)\n+\t\tQETH_CARD_TEXT_(card, 2, \"err%04x\", retcode);\n+\n+\tswitch (retcode) {\n+\tcase IPA_RC_SUCCESS:\n+\t\treturn 0;\n+\tcase IPA_RC_L2_INVALID_VLAN_ID:\n+\t\treturn -EINVAL;\n+\tcase IPA_RC_L2_DUP_VLAN_ID:\n+\t\treturn -EEXIST;\n+\tcase IPA_RC_L2_VLAN_ID_NOT_FOUND:\n+\t\treturn -ENOENT;\n+\tcase IPA_RC_L2_VLAN_ID_NOT_ALLOWED:\n+\t\treturn -EPERM;\n+\tcase -ENOMEM:\n+\t\treturn -ENOMEM;\n+\tdefault:\n+\t\treturn -EIO;\n+\t}\n+}\n+\n static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,\n-\t\t\tstruct qeth_reply *reply, unsigned long data)\n+\t\t\t\t      struct qeth_reply *reply,\n+\t\t\t\t      unsigned long data)\n {\n-\tstruct qeth_ipa_cmd *cmd;\n+\tstruct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;\n \n \tQETH_CARD_TEXT(card, 2, \"L2sdvcb\");\n-\tcmd = (struct qeth_ipa_cmd *) data;\n \tif (cmd->hdr.return_code) {\n-\t\tQETH_DBF_MESSAGE(2, \"Error in processing VLAN %i on %s: 0x%x. \"\n-\t\t\t  \"Continuing\\n\", cmd->data.setdelvlan.vlan_id,\n-\t\t\t  QETH_CARD_IFNAME(card), cmd->hdr.return_code);\n+\t\tQETH_DBF_MESSAGE(2, \"Error in processing VLAN %i on %s: 0x%x.\\n\",\n+\t\t\t\t cmd->data.setdelvlan.vlan_id,\n+\t\t\t\t QETH_CARD_IFNAME(card), cmd->hdr.return_code);\n \t\tQETH_CARD_TEXT_(card, 2, \"L2VL%4x\", cmd->hdr.command);\n \t\tQETH_CARD_TEXT_(card, 2, \"err%d\", cmd->hdr.return_code);\n \t}\n@@ -307,7 +330,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,\n }\n \n static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i,\n-\t\t\t\tenum qeth_ipa_cmds ipacmd)\n+\t\t\t\t   enum qeth_ipa_cmds ipacmd)\n {\n \tstruct qeth_ipa_cmd *cmd;\n \tstruct qeth_cmd_buffer *iob;\n@@ -318,8 +341,8 @@ static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i,\n \t\treturn -ENOMEM;\n \tcmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);\n \tcmd->data.setdelvlan.vlan_id = i;\n-\treturn qeth_send_ipa_cmd(card, iob,\n-\t\t\t\t qeth_l2_send_setdelvlan_cb, NULL);\n+\treturn qeth_setdelvlan_makerc(card, qeth_send_ipa_cmd(card, iob,\n+\t\t\t\t\t    qeth_l2_send_setdelvlan_cb, NULL));\n }\n \n static void qeth_l2_process_vlans(struct qeth_card *card)\n","prefixes":["net-next","7/9"]}