{"id":815120,"url":"http://patchwork.ozlabs.org/api/1.2/patches/815120/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/20170918191822.65142-9-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-9-jwi@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-18T19:18:21","name":"[net-next,8/9] s390/qeth: fold VLAN handling into l3_rebuild_skb()","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"f6dd4cb4b446788455eec84384574a120ee83979","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-9-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/815120/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/815120/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 3xwwns5FF2z9s7G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 05:20:33 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751458AbdIRTUH (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 15:20:07 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42559 \"EHLO\n\tmx0a-001b2d01.pphosted.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1750790AbdIRTUF (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 15:20:05 -0400","from pps.filterd (m0098393.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8IJK2DB097370\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 15:20:05 -0400","from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d2m1b8mdw-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:04 -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:30 +0100","from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195)\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:28 +0100","from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com\n\t[9.149.105.232])\n\tby b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8IJJR7e24117402; Mon, 18 Sep 2017 19:19:27 GMT","from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 7AFED5203F;\n\tMon, 18 Sep 2017 19:14:28 +0100 (BST)","from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 3E11052041; \n\tMon, 18 Sep 2017 19:14:28 +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 8/9] s390/qeth: fold VLAN handling into\n\tl3_rebuild_skb()","Date":"Mon, 18 Sep 2017 21:18:21 +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-000004EDDFD3","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091819-0017-0000-0000-000028280F41","Message-Id":"<20170918191822.65142-9-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":"Move the overly complicated VLAN processing from the L3 RX handler into\nits l3_rebuild_skb() helper. No change in functionality.\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_l3_main.c | 27 +++++++++++----------------\n 1 file changed, 11 insertions(+), 16 deletions(-)","diff":"diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c\nindex 733f94cbd4d4..270ac9515f6b 100644\n--- a/drivers/s390/net/qeth_l3_main.c\n+++ b/drivers/s390/net/qeth_l3_main.c\n@@ -1646,13 +1646,12 @@ static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,\n \treturn 0;\n }\n \n-static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,\n-\t\t\t       struct qeth_hdr *hdr, unsigned short *vlan_id)\n+static void qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,\n+\t\t\t\tstruct qeth_hdr *hdr)\n {\n \t__u16 prot;\n \tstruct iphdr *ip_hdr;\n \tunsigned char tg_addr[MAX_ADDR_LEN];\n-\tint is_vlan = 0;\n \n \tif (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) {\n \t\tprot = (hdr->hdr.l3.flags & QETH_HDR_IPV6) ? ETH_P_IPV6 :\n@@ -1706,11 +1705,14 @@ static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,\n \n \tskb->protocol = eth_type_trans(skb, card->dev);\n \n-\tif (hdr->hdr.l3.ext_flags &\n-\t    (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) {\n-\t\t*vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME) ?\n-\t\t hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]);\n-\t\tis_vlan = 1;\n+\t/* copy VLAN tag from hdr into skb */\n+\tif (!card->options.sniffer &&\n+\t    (hdr->hdr.l3.ext_flags & (QETH_HDR_EXT_VLAN_FRAME |\n+\t\t\t\t      QETH_HDR_EXT_INCLUDE_VLAN_TAG))) {\n+\t\tu16 tag = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME) ?\n+\t\t\t\thdr->hdr.l3.vlan_id :\n+\t\t\t\t*((u16 *)&hdr->hdr.l3.dest_addr[12]);\n+\t\t__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tag);\n \t}\n \n \tif (card->dev->features & NETIF_F_RXCSUM) {\n@@ -1724,7 +1726,6 @@ static int qeth_l3_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,\n \t\t\tskb->ip_summed = CHECKSUM_NONE;\n \t} else\n \t\tskb->ip_summed = CHECKSUM_NONE;\n-\treturn is_vlan;\n }\n \n static int qeth_l3_process_inbound_buffer(struct qeth_card *card,\n@@ -1733,8 +1734,6 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,\n \tint work_done = 0;\n \tstruct sk_buff *skb;\n \tstruct qeth_hdr *hdr;\n-\t__u16 vlan_tag = 0;\n-\tint is_vlan;\n \tunsigned int len;\n \t__u16 magic;\n \n@@ -1764,12 +1763,8 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,\n \t\t\t\t\tcard->dev->addr_len);\n \t\t\t\tnetif_receive_skb(skb);\n \t\t\t} else {\n-\t\t\t\tis_vlan = qeth_l3_rebuild_skb(card, skb, hdr,\n-\t\t\t\t\t\t      &vlan_tag);\n+\t\t\t\tqeth_l3_rebuild_skb(card, skb, hdr);\n \t\t\t\tlen = skb->len;\n-\t\t\t\tif (is_vlan && !card->options.sniffer)\n-\t\t\t\t\t__vlan_hwaccel_put_tag(skb,\n-\t\t\t\t\t\thtons(ETH_P_8021Q), vlan_tag);\n \t\t\t\tnapi_gro_receive(&card->napi, skb);\n \t\t\t}\n \t\t\tbreak;\n","prefixes":["net-next","8/9"]}