All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default
@ 2017-08-28 19:03 Alexander Aring
  2017-08-28 19:03 ` [PATCH net-next 1/3] if_ether: add forces ife lfb type Alexander Aring
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alexander Aring @ 2017-08-28 19:03 UTC (permalink / raw)
  To: jhs
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest,
	Alexander Aring

Hi,

this patch series will introduce the IFE ethertype which is registered by
IEEE. If the netlink act_ife type netlink attribute is not given it will
use this value by default now.
At least it will introduce some UAPI testcases to check if the default type
is used if not specified and vice versa.

- Alex

Alexander Aring (3):
  if_ether: add forces ife lfb type
  act_ife: use registered ife_type as fallback
  tc-testing: add test for testing ife type

 include/uapi/linux/if_ether.h                      |  1 +
 net/sched/act_ife.c                                | 17 ++------
 .../tc-testing/tc-tests/actions/tests.json         | 50 ++++++++++++++++++++++
 3 files changed, 54 insertions(+), 14 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net-next 1/3] if_ether: add forces ife lfb type
  2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
@ 2017-08-28 19:03 ` Alexander Aring
  2017-08-28 22:03   ` Jamal Hadi Salim
  2017-08-28 19:03 ` [PATCH net-next 2/3] act_ife: use registered ife_type as fallback Alexander Aring
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Alexander Aring @ 2017-08-28 19:03 UTC (permalink / raw)
  To: jhs
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest,
	Alexander Aring

This patch adds the forces IFE lfb type according to IEEE registered
ethertypes. See http://standards-oui.ieee.org/ethertype/eth.txt for more
information. Since there exists the IFE subsystem it can be used there.

This patch also use the correct word "ForCES" instead of "FoRCES" which
is a spelling error inside the IEEE ethertype specification.

Signed-off-by: Alexander Aring <aring@mojatatu.com>
---
 include/uapi/linux/if_ether.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 5bc9bfd816b7..22bf8effefef 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -103,6 +103,7 @@
 #define ETH_P_QINQ2	0x9200		/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
 #define ETH_P_QINQ3	0x9300		/* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
 #define ETH_P_EDSA	0xDADA		/* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IFE	0xED3E		/* ForCES inter-FE LFB type */
 #define ETH_P_AF_IUCV   0xFBFB		/* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
 
 #define ETH_P_802_3_MIN	0x0600		/* If the value in the ethernet type is less than this value
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next 2/3] act_ife: use registered ife_type as fallback
  2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
  2017-08-28 19:03 ` [PATCH net-next 1/3] if_ether: add forces ife lfb type Alexander Aring
@ 2017-08-28 19:03 ` Alexander Aring
  2017-08-28 22:14   ` Jamal Hadi Salim
  2017-08-28 19:03 ` [PATCH net-next 3/3] tc-testing: add test for testing ife type Alexander Aring
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Alexander Aring @ 2017-08-28 19:03 UTC (permalink / raw)
  To: jhs
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest,
	Alexander Aring

This patch handles a default IFE type if it's not given by user space
netlink api. The default IFE type will be the registered ethertype by
IEEE for IFE ForCES.

Signed-off-by: Alexander Aring <aring@mojatatu.com>
---
 net/sched/act_ife.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index c5dec308b8b1..7ed1be80ee86 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -435,8 +435,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
 	struct nlattr *tb[TCA_IFE_MAX + 1];
 	struct nlattr *tb2[IFE_META_MAX + 1];
 	struct tcf_ife_info *ife;
+	u16 ife_type = ETH_P_IFE;
 	struct tc_ife *parm;
-	u16 ife_type = 0;
 	u8 *daddr = NULL;
 	u8 *saddr = NULL;
 	bool exists = false;
@@ -456,18 +456,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
 	if (exists && bind)
 		return 0;
 
-	if (parm->flags & IFE_ENCODE) {
-		/* Until we get issued the ethertype, we cant have
-		 * a default..
-		**/
-		if (!tb[TCA_IFE_TYPE]) {
-			if (exists)
-				tcf_hash_release(*a, bind);
-			pr_info("You MUST pass etherype for encoding\n");
-			return -EINVAL;
-		}
-	}
-
 	if (!exists) {
 		ret = tcf_hash_create(tn, parm->index, est, a, &act_ife_ops,
 				      bind, false);
@@ -484,7 +472,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
 	ife->flags = parm->flags;
 
 	if (parm->flags & IFE_ENCODE) {
-		ife_type = nla_get_u16(tb[TCA_IFE_TYPE]);
+		if (tb[TCA_IFE_TYPE])
+			ife_type = nla_get_u16(tb[TCA_IFE_TYPE]);
 		if (tb[TCA_IFE_DMAC])
 			daddr = nla_data(tb[TCA_IFE_DMAC]);
 		if (tb[TCA_IFE_SMAC])
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net-next 3/3] tc-testing: add test for testing ife type
  2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
  2017-08-28 19:03 ` [PATCH net-next 1/3] if_ether: add forces ife lfb type Alexander Aring
  2017-08-28 19:03 ` [PATCH net-next 2/3] act_ife: use registered ife_type as fallback Alexander Aring
@ 2017-08-28 19:03 ` Alexander Aring
  2017-08-28 22:16   ` Jamal Hadi Salim
  2017-08-29 22:14 ` [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default David Miller
  2017-08-30 15:27 ` Stephen Hemminger
  4 siblings, 1 reply; 9+ messages in thread
From: Alexander Aring @ 2017-08-28 19:03 UTC (permalink / raw)
  To: jhs
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest,
	Alexander Aring

This patch adds a new testcase for the IFE type setting in tc. In case
of user specified the type it will check if the ife is correctly
configured to react on it. If it's not specified the default IFE type
should be used.

Signed-off-by: Alexander Aring <aring@mojatatu.com>
---
 .../tc-testing/tc-tests/actions/tests.json         | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/tests.json b/tools/testing/selftests/tc-testing/tc-tests/actions/tests.json
index af519bc97a8e..6973bdc5b5bf 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/tests.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/tests.json
@@ -1111,5 +1111,55 @@
         "teardown": [
             "$TC actions flush action gact"
         ]
+    },
+    {
+        "id": "a568",
+        "name": "Add action with ife type",
+        "category": [
+            "actions",
+            "ife"
+        ],
+        "setup": [
+            [
+                "$TC actions flush action ife",
+                0,
+                1,
+                255
+            ],
+            "$TC actions add action ife encode type 0xDEAD index 1"
+        ],
+        "cmdUnderTest": "$TC actions get action ife index 1",
+        "expExitCode": "0",
+        "verifyCmd": "$TC actions get action ife index 1",
+        "matchPattern": "type 0xDEAD",
+        "matchCount": "1",
+        "teardown": [
+            "$TC actions flush action ife"
+        ]
+    },
+    {
+        "id": "b983",
+        "name": "Add action without ife type",
+        "category": [
+            "actions",
+            "ife"
+        ],
+        "setup": [
+            [
+                "$TC actions flush action ife",
+                0,
+                1,
+                255
+            ],
+            "$TC actions add action ife encode index 1"
+        ],
+        "cmdUnderTest": "$TC actions get action ife index 1",
+        "expExitCode": "0",
+        "verifyCmd": "$TC actions get action ife index 1",
+        "matchPattern": "type 0xED3E",
+        "matchCount": "1",
+        "teardown": [
+            "$TC actions flush action ife"
+        ]
     }
 ]
\ No newline at end of file
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 1/3] if_ether: add forces ife lfb type
  2017-08-28 19:03 ` [PATCH net-next 1/3] if_ether: add forces ife lfb type Alexander Aring
@ 2017-08-28 22:03   ` Jamal Hadi Salim
  0 siblings, 0 replies; 9+ messages in thread
From: Jamal Hadi Salim @ 2017-08-28 22:03 UTC (permalink / raw)
  To: Alexander Aring
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest

On 17-08-28 03:03 PM, Alexander Aring wrote:
> This patch adds the forces IFE lfb type according to IEEE registered
> ethertypes. See http://standards-oui.ieee.org/ethertype/eth.txt for more
> information. Since there exists the IFE subsystem it can be used there.
> 
> This patch also use the correct word "ForCES" instead of "FoRCES" which
> is a spelling error inside the IEEE ethertype specification.
> 
> Signed-off-by: Alexander Aring <aring@mojatatu.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 2/3] act_ife: use registered ife_type as fallback
  2017-08-28 19:03 ` [PATCH net-next 2/3] act_ife: use registered ife_type as fallback Alexander Aring
@ 2017-08-28 22:14   ` Jamal Hadi Salim
  0 siblings, 0 replies; 9+ messages in thread
From: Jamal Hadi Salim @ 2017-08-28 22:14 UTC (permalink / raw)
  To: Alexander Aring
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest

On 17-08-28 03:03 PM, Alexander Aring wrote:
> This patch handles a default IFE type if it's not given by user space
> netlink api. The default IFE type will be the registered ethertype by
> IEEE for IFE ForCES.
> 
> Signed-off-by: Alexander Aring <aring@mojatatu.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 3/3] tc-testing: add test for testing ife type
  2017-08-28 19:03 ` [PATCH net-next 3/3] tc-testing: add test for testing ife type Alexander Aring
@ 2017-08-28 22:16   ` Jamal Hadi Salim
  0 siblings, 0 replies; 9+ messages in thread
From: Jamal Hadi Salim @ 2017-08-28 22:16 UTC (permalink / raw)
  To: Alexander Aring
  Cc: yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest

On 17-08-28 03:03 PM, Alexander Aring wrote:
> This patch adds a new testcase for the IFE type setting in tc. In case
> of user specified the type it will check if the ife is correctly
> configured to react on it. If it's not specified the default IFE type
> should be used.
> 
> Signed-off-by: Alexander Aring <aring@mojatatu.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>


We should add the tests which do filter binding as well
(both auto-binding and late binding)

cheers,
jamal

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default
  2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
                   ` (2 preceding siblings ...)
  2017-08-28 19:03 ` [PATCH net-next 3/3] tc-testing: add test for testing ife type Alexander Aring
@ 2017-08-29 22:14 ` David Miller
  2017-08-30 15:27 ` Stephen Hemminger
  4 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2017-08-29 22:14 UTC (permalink / raw)
  To: aring; +Cc: jhs, yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest

From: Alexander Aring <aring@mojatatu.com>
Date: Mon, 28 Aug 2017 15:03:12 -0400

> this patch series will introduce the IFE ethertype which is registered by
> IEEE. If the netlink act_ife type netlink attribute is not given it will
> use this value by default now.
> At least it will introduce some UAPI testcases to check if the default type
> is used if not specified and vice versa.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default
  2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
                   ` (3 preceding siblings ...)
  2017-08-29 22:14 ` [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default David Miller
@ 2017-08-30 15:27 ` Stephen Hemminger
  4 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2017-08-30 15:27 UTC (permalink / raw)
  To: Alexander Aring
  Cc: jhs, yotamg, xiyou.wangcong, jiri, lucasb, netdev, linux-kselftest

On Mon, 28 Aug 2017 15:03:12 -0400
Alexander Aring <aring@mojatatu.com> wrote:

> Hi,
> 
> this patch series will introduce the IFE ethertype which is registered by
> IEEE. If the netlink act_ife type netlink attribute is not given it will
> use this value by default now.
> At least it will introduce some UAPI testcases to check if the default type
> is used if not specified and vice versa.
> 
> - Alex
> 
> Alexander Aring (3):
>   if_ether: add forces ife lfb type
>   act_ife: use registered ife_type as fallback
>   tc-testing: add test for testing ife type
> 
>  include/uapi/linux/if_ether.h                      |  1 +
>  net/sched/act_ife.c                                | 17 ++------
>  .../tc-testing/tc-tests/actions/tests.json         | 50 ++++++++++++++++++++++
>  3 files changed, 54 insertions(+), 14 deletions(-)
> 

Applied to net-next

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-30 15:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 19:03 [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default Alexander Aring
2017-08-28 19:03 ` [PATCH net-next 1/3] if_ether: add forces ife lfb type Alexander Aring
2017-08-28 22:03   ` Jamal Hadi Salim
2017-08-28 19:03 ` [PATCH net-next 2/3] act_ife: use registered ife_type as fallback Alexander Aring
2017-08-28 22:14   ` Jamal Hadi Salim
2017-08-28 19:03 ` [PATCH net-next 3/3] tc-testing: add test for testing ife type Alexander Aring
2017-08-28 22:16   ` Jamal Hadi Salim
2017-08-29 22:14 ` [PATCH net-next 0/3] tc: act_ife: handle IEEE IFE ethertype as default David Miller
2017-08-30 15:27 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.