{"id":806726,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806726/?format=json","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.0/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},"msgid":"<20170828190315.26646-3-aring@mojatatu.com>","date":"2017-08-28T19:03:14","name":"[net-next,2/3] act_ife: use registered ife_type as fallback","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"ea9e8390f33c81677212f8e1a996928297602769","submitter":{"id":72245,"url":"http://patchwork.ozlabs.org/api/1.0/people/72245/?format=json","name":"Alexander Aring","email":"aring@mojatatu.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.0/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/20170828190315.26646-3-aring@mojatatu.com/mbox/","series":[{"id":242,"url":"http://patchwork.ozlabs.org/api/1.0/series/242/?format=json","date":"2017-08-28T19:03:12","name":"tc: act_ife: handle IEEE IFE ethertype as default","version":1,"mbox":"http://patchwork.ozlabs.org/series/242/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806726/checks/","tags":{},"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>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=mojatatu-com.20150623.gappssmtp.com\n\theader.i=@mojatatu-com.20150623.gappssmtp.com\n\theader.b=\"XwkGPlJ8\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xh1RH0F4gz9s9Y\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 05:04:43 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751363AbdH1TEg (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 15:04:36 -0400","from mail-io0-f193.google.com ([209.85.223.193]:32984 \"EHLO\n\tmail-io0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751213AbdH1TEc (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 28 Aug 2017 15:04:32 -0400","by mail-io0-f193.google.com with SMTP id s101so1094923ioe.0\n\tfor <netdev@vger.kernel.org>; Mon, 28 Aug 2017 12:04:32 -0700 (PDT)","from x220t.lan ([64.26.149.125]) by smtp.gmail.com with ESMTPSA id\n\tj15sm471282ioe.26.2017.08.28.12.04.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 28 Aug 2017 12:04:30 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=mojatatu-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=8P6PRccNIQo5/CsvFhh1tuzx6CLTOI6VTfMAE3i8sMw=;\n\tb=XwkGPlJ8RLevOPweFeqmnAtdnpNv4+vKcu3z3jFKc+dz0CT/O/cbqYXP8tyBQYRpCo\n\t4jpN51uHGo17s0bJ63C9Y0FCtRNqnYMSt4A4dJehHIDz8bSH9A9P9jXS8yq3ncn/v6XJ\n\t/ufymakiy4H485o9hQ1GUGNgdlcDiVZurl0QdBkpEhguhpdf4XSUReiumbctF7zAVUZW\n\tfGrqq2GNVcchd62uUtEfE1M+WANx31ptRi7H/84kfb509K/ndDhNfZcG+OrUNJEU4XKR\n\t/Z4c1l9rOdIfhh3OHUStbty5tfjoA+zCa/DB5qNGaakzENKgFf/fiJ6IIhw5LJDIXg0d\n\towSg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=8P6PRccNIQo5/CsvFhh1tuzx6CLTOI6VTfMAE3i8sMw=;\n\tb=XHp1PCi10KWDOEPfEVzTNmQ5toCPT/mk8V82H4kqgV/4dY7UZB0oYfThWynaC7dex2\n\tVtHLKa0BuGrUZS955FnTQwK530hsbQHSa8u93508/hrVv2ShmSXNfnxaoqbubBOjhwPe\n\tNO3zWCRROemKZouFmfR5R4zVSMNvVig39TvPMWafYNuyKgGXJoLyx0jtouJy8ebgP2Kj\n\tkqeLBeizSAEFKaPS6Y7cSXwBVcrmTu2ZeGV4DlxdH3pnFDzAZNIVHoPTrC5e2tMUtKfJ\n\t561vLNRg+4zhoatcAr89YEicjdlv7Lv/6lUtWFiBh/koZ9EOe1SKlFWzweZjEi8xzl0e\n\tCQZA==","X-Gm-Message-State":"AHYfb5gtIDV0G1heh6MgSWqHfUU5WJOudV0oxS/zErUdpZOyGsq2hkS+\n\tYlS8igx4gypyQGP2","X-Received":"by 10.107.153.8 with SMTP id b8mr1542670ioe.234.1503947071920;\n\tMon, 28 Aug 2017 12:04:31 -0700 (PDT)","From":"Alexander Aring <aring@mojatatu.com>","To":"jhs@mojatatu.com","Cc":"yotamg@mellanox.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,\n\tlucasb@mojatatu.com, netdev@vger.kernel.org,\n\tlinux-kselftest@vger.kernel.org, Alexander Aring <aring@mojatatu.com>","Subject":"[PATCH net-next 2/3] act_ife: use registered ife_type as fallback","Date":"Mon, 28 Aug 2017 15:03:14 -0400","Message-Id":"<20170828190315.26646-3-aring@mojatatu.com>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170828190315.26646-1-aring@mojatatu.com>","References":"<20170828190315.26646-1-aring@mojatatu.com>","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"This patch handles a default IFE type if it's not given by user space\nnetlink api. The default IFE type will be the registered ethertype by\nIEEE for IFE ForCES.\n\nSigned-off-by: Alexander Aring <aring@mojatatu.com>\n---\n net/sched/act_ife.c | 17 +++--------------\n 1 file changed, 3 insertions(+), 14 deletions(-)","diff":"diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c\nindex c5dec308b8b1..7ed1be80ee86 100644\n--- a/net/sched/act_ife.c\n+++ b/net/sched/act_ife.c\n@@ -435,8 +435,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,\n \tstruct nlattr *tb[TCA_IFE_MAX + 1];\n \tstruct nlattr *tb2[IFE_META_MAX + 1];\n \tstruct tcf_ife_info *ife;\n+\tu16 ife_type = ETH_P_IFE;\n \tstruct tc_ife *parm;\n-\tu16 ife_type = 0;\n \tu8 *daddr = NULL;\n \tu8 *saddr = NULL;\n \tbool exists = false;\n@@ -456,18 +456,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,\n \tif (exists && bind)\n \t\treturn 0;\n \n-\tif (parm->flags & IFE_ENCODE) {\n-\t\t/* Until we get issued the ethertype, we cant have\n-\t\t * a default..\n-\t\t**/\n-\t\tif (!tb[TCA_IFE_TYPE]) {\n-\t\t\tif (exists)\n-\t\t\t\ttcf_hash_release(*a, bind);\n-\t\t\tpr_info(\"You MUST pass etherype for encoding\\n\");\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t}\n-\n \tif (!exists) {\n \t\tret = tcf_hash_create(tn, parm->index, est, a, &act_ife_ops,\n \t\t\t\t      bind, false);\n@@ -484,7 +472,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,\n \tife->flags = parm->flags;\n \n \tif (parm->flags & IFE_ENCODE) {\n-\t\tife_type = nla_get_u16(tb[TCA_IFE_TYPE]);\n+\t\tif (tb[TCA_IFE_TYPE])\n+\t\t\tife_type = nla_get_u16(tb[TCA_IFE_TYPE]);\n \t\tif (tb[TCA_IFE_DMAC])\n \t\t\tdaddr = nla_data(tb[TCA_IFE_DMAC]);\n \t\tif (tb[TCA_IFE_SMAC])\n","prefixes":["net-next","2/3"]}