Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1631555 > unrolled thread
| Started by | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| First post | 2017-04-26 18:00 +0200 |
| Last post | 2017-05-01 18:40 +0200 |
| Articles | 20 on this page of 44 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
[PATCH net-next 02/18] net: dsa: mv88e6xxx: split VTU entry data member Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 02/18] net: dsa: mv88e6xxx: split VTU entry data member Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:30 +0200
[PATCH net-next 11/18] net: dsa: mv88e6xxx: get STU entry on VTU GetNext Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 11/18] net: dsa: mv88e6xxx: get STU entry on VTU GetNext Andrew Lunn <andrew@lunn.ch> - 2017-04-27 22:20 +0200
[PATCH net-next 13/18] net: dsa: mv88e6xxx: add VTU GetNext operation Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 13/18] net: dsa: mv88e6xxx: add VTU GetNext operation Andrew Lunn <andrew@lunn.ch> - 2017-04-28 04:20 +0200
[PATCH net-next 17/18] net: dsa: mv88e6xxx: support the VTU Page bit Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 17/18] net: dsa: mv88e6xxx: support the VTU Page bit Andrew Lunn <andrew@lunn.ch> - 2017-04-28 15:00 +0200
Re: [PATCH net-next 17/18] net: dsa: mv88e6xxx: support the VTU Page bit Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-28 16:30 +0200
Re: [PATCH net-next 17/18] net: dsa: mv88e6xxx: support the VTU Page bit Andrew Lunn <andrew@lunn.ch> - 2017-04-28 17:00 +0200
[PATCH net-next 04/18] net: dsa: mv88e6xxx: move VTU flush Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 04/18] net: dsa: mv88e6xxx: move VTU flush Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:40 +0200
[PATCH net-next 14/18] net: dsa: mv88e6xxx: add VTU Load/Purge operation Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 14/18] net: dsa: mv88e6xxx: add VTU Load/Purge operation Andrew Lunn <andrew@lunn.ch> - 2017-04-28 04:20 +0200
[PATCH net-next 09/18] net: dsa: mv88e6xxx: move VTU Data accessors Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 09/18] net: dsa: mv88e6xxx: move VTU Data accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 21:20 +0200
[PATCH net-next 01/18] net: dsa: mv88e6xxx: add max VID to info Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 01/18] net: dsa: mv88e6xxx: add max VID to info Andrew Lunn <andrew@lunn.ch> - 2017-04-26 18:10 +0200
[PATCH net-next 10/18] net: dsa: mv88e6xxx: move STU GetNext operation Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 10/18] net: dsa: mv88e6xxx: move STU GetNext operation Andrew Lunn <andrew@lunn.ch> - 2017-04-27 21:50 +0200
[PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:40 +0200
Re: [PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:40 +0200
[PATCH net-next 07/18] net: dsa: mv88e6xxx: move VTU VID accessors Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:00 +0200
Re: [PATCH net-next 07/18] net: dsa: mv88e6xxx: move VTU VID accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 21:00 +0200
[PATCH net-next 16/18] net: dsa: mv88e6xxx: simplify VTU entry getter Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:10 +0200
Re: [PATCH net-next 16/18] net: dsa: mv88e6xxx: simplify VTU entry getter Andrew Lunn <andrew@lunn.ch> - 2017-04-28 04:30 +0200
[PATCH net-next 06/18] net: dsa: mv88e6xxx: move VTU SID accessors Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:10 +0200
Re: [PATCH net-next 06/18] net: dsa: mv88e6xxx: move VTU SID accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:40 +0200
[PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:10 +0200
Re: [PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext Andrew Lunn <andrew@lunn.ch> - 2017-04-27 21:00 +0200
Re: [PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-28 17:10 +0200
[PATCH net-next 12/18] net: dsa: mv88e6xxx: load STU entry with VTU entry Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:10 +0200
Re: [PATCH net-next 12/18] net: dsa: mv88e6xxx: load STU entry with VTU entry Andrew Lunn <andrew@lunn.ch> - 2017-04-28 04:10 +0200
[PATCH net-next 05/18] net: dsa: mv88e6xxx: move VTU FID accessors Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-04-26 18:10 +0200
Re: [PATCH net-next 05/18] net: dsa: mv88e6xxx: move VTU FID accessors Andrew Lunn <andrew@lunn.ch> - 2017-04-27 20:40 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-01 18:00 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU David Miller <davem@davemloft.net> - 2017-05-01 18:10 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Andrew Lunn <andrew@lunn.ch> - 2017-05-01 18:30 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-01 19:20 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-01 18:30 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU David Miller <davem@davemloft.net> - 2017-05-01 18:30 +0200
Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-01 18:40 +0200
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 21:50 +0200 |
| Subject | Re: [PATCH net-next 10/18] net: dsa: mv88e6xxx: move STU GetNext operation |
| Message-ID | <tAXAm-588-11@gated-at.bofh.it> |
| In reply to | #1631572 |
On Wed, Apr 26, 2017 at 11:53:28AM -0400, Vivien Didelot wrote:
> Extract the generic portion of code to issue an STU GetNext operation,
> which will be used in other implementations.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:00 +0200 |
| Subject | [PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors |
| Message-ID | <tAxwf-4hS-45@gated-at.bofh.it> |
| In reply to | #1631555 |
Move the helper functions to access the Global 1 VTU Operation register
to a new global1_vtu.c file, and get rid of the old underscore prefix
naming convention. This file will be extended will all VTU/STU related
code.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/Makefile | 1 +
drivers/net/dsa/mv88e6xxx/chip.c | 39 +++++++++------------------------
drivers/net/dsa/mv88e6xxx/global1.h | 3 +++
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 33 ++++++++++++++++++++++++++++
4 files changed, 47 insertions(+), 29 deletions(-)
create mode 100644 drivers/net/dsa/mv88e6xxx/global1_vtu.c
diff --git a/drivers/net/dsa/mv88e6xxx/Makefile b/drivers/net/dsa/mv88e6xxx/Makefile
index 31d37a90cec7..6edd869c8d6f 100644
--- a/drivers/net/dsa/mv88e6xxx/Makefile
+++ b/drivers/net/dsa/mv88e6xxx/Makefile
@@ -2,5 +2,6 @@ obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
mv88e6xxx-objs := chip.o
mv88e6xxx-objs += global1.o
mv88e6xxx-objs += global1_atu.o
+mv88e6xxx-objs += global1_vtu.o
mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2) += global2.o
mv88e6xxx-objs += port.o
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index f025d3c22dba..bf0350432337 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3,9 +3,6 @@
*
* Copyright (c) 2008 Marvell Semiconductor
*
- * Copyright (c) 2015 CMC Electronics, Inc.
- * Added support for VLAN Table Unit operations
- *
* Copyright (c) 2016 Andrew Lunn <andrew@lunn.ch>
*
* Copyright (c) 2016-2017 Savoir-faire Linux Inc.
@@ -1266,31 +1263,15 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
netdev_err(ds->ports[port].netdev, "failed to flush ATU\n");
}
-static int _mv88e6xxx_vtu_wait(struct mv88e6xxx_chip *chip)
-{
- return mv88e6xxx_g1_wait(chip, GLOBAL_VTU_OP, GLOBAL_VTU_OP_BUSY);
-}
-
-static int _mv88e6xxx_vtu_cmd(struct mv88e6xxx_chip *chip, u16 op)
-{
- int err;
-
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_OP, op);
- if (err)
- return err;
-
- return _mv88e6xxx_vtu_wait(chip);
-}
-
static int _mv88e6xxx_vtu_stu_flush(struct mv88e6xxx_chip *chip)
{
int ret;
- ret = _mv88e6xxx_vtu_wait(chip);
+ ret = mv88e6xxx_g1_vtu_op_wait(chip);
if (ret < 0)
return ret;
- return _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_FLUSH_ALL);
+ return mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_FLUSH_ALL);
}
static int _mv88e6xxx_vtu_stu_data_read(struct mv88e6xxx_chip *chip,
@@ -1380,11 +1361,11 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
u16 val;
int err;
- err = _mv88e6xxx_vtu_wait(chip);
+ err = mv88e6xxx_g1_vtu_op_wait(chip);
if (err)
return err;
- err = _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
+ err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
if (err)
return err;
@@ -1493,7 +1474,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
u16 reg = 0;
int err;
- err = _mv88e6xxx_vtu_wait(chip);
+ err = mv88e6xxx_g1_vtu_op_wait(chip);
if (err)
return err;
@@ -1532,7 +1513,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
if (err)
return err;
- return _mv88e6xxx_vtu_cmd(chip, op);
+ return mv88e6xxx_g1_vtu_op(chip, op);
}
static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
@@ -1542,7 +1523,7 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
u16 val;
int err;
- err = _mv88e6xxx_vtu_wait(chip);
+ err = mv88e6xxx_g1_vtu_op_wait(chip);
if (err)
return err;
@@ -1551,7 +1532,7 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
if (err)
return err;
- err = _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_STU_GET_NEXT);
+ err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_STU_GET_NEXT);
if (err)
return err;
@@ -1583,7 +1564,7 @@ static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
u16 reg = 0;
int err;
- err = _mv88e6xxx_vtu_wait(chip);
+ err = mv88e6xxx_g1_vtu_op_wait(chip);
if (err)
return err;
@@ -1606,7 +1587,7 @@ static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
if (err)
return err;
- return _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_STU_LOAD_PURGE);
+ return mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_STU_LOAD_PURGE);
}
static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index e30cbe480d5b..c153d07d2065 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -50,4 +50,7 @@ int mv88e6xxx_g1_atu_flush(struct mv88e6xxx_chip *chip, u16 fid, bool all);
int mv88e6xxx_g1_atu_remove(struct mv88e6xxx_chip *chip, u16 fid, int port,
bool all);
+int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip);
+int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op);
+
#endif /* _MV88E6XXX_GLOBAL1_H */
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
new file mode 100644
index 000000000000..20dfdcbda238
--- /dev/null
+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
@@ -0,0 +1,33 @@
+/*
+ * Marvell 88E6xxx VLAN [Spanning Tree] Translation Unit (VTU [STU]) support
+ *
+ * Copyright (c) 2008 Marvell Semiconductor
+ * Copyright (c) 2015 CMC Electronics, Inc.
+ * Copyright (c) 2017 Savoir-faire Linux, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "mv88e6xxx.h"
+#include "global1.h"
+
+/* Offset 0x05: VTU Operation Register */
+
+int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip)
+{
+ return mv88e6xxx_g1_wait(chip, GLOBAL_VTU_OP, GLOBAL_VTU_OP_BUSY);
+}
+
+int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op)
+{
+ int err;
+
+ err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_OP, op);
+ if (err)
+ return err;
+
+ return mv88e6xxx_g1_vtu_op_wait(chip);
+}
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 20:40 +0200 |
| Subject | Re: [PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors |
| Message-ID | <tAWuB-4ry-1@gated-at.bofh.it> |
| In reply to | #1631573 |
On Wed, Apr 26, 2017 at 11:53:21AM -0400, Vivien Didelot wrote:
> Move the helper functions to access the Global 1 VTU Operation register
> to a new global1_vtu.c file, and get rid of the old underscore prefix
> naming convention. This file will be extended will all VTU/STU related
> code.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
> drivers/net/dsa/mv88e6xxx/Makefile | 1 +
> drivers/net/dsa/mv88e6xxx/chip.c | 39 +++++++++------------------------
> drivers/net/dsa/mv88e6xxx/global1.h | 3 +++
> drivers/net/dsa/mv88e6xxx/global1_vtu.c | 33 ++++++++++++++++++++++++++++
> 4 files changed, 47 insertions(+), 29 deletions(-)
> create mode 100644 drivers/net/dsa/mv88e6xxx/global1_vtu.c
>
> diff --git a/drivers/net/dsa/mv88e6xxx/Makefile b/drivers/net/dsa/mv88e6xxx/Makefile
> index 31d37a90cec7..6edd869c8d6f 100644
> --- a/drivers/net/dsa/mv88e6xxx/Makefile
> +++ b/drivers/net/dsa/mv88e6xxx/Makefile
> @@ -2,5 +2,6 @@ obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
> mv88e6xxx-objs := chip.o
> mv88e6xxx-objs += global1.o
> mv88e6xxx-objs += global1_atu.o
> +mv88e6xxx-objs += global1_vtu.o
> mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2) += global2.o
> mv88e6xxx-objs += port.o
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index f025d3c22dba..bf0350432337 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -3,9 +3,6 @@
> *
> * Copyright (c) 2008 Marvell Semiconductor
> *
> - * Copyright (c) 2015 CMC Electronics, Inc.
> - * Added support for VLAN Table Unit operations
> - *
> * Copyright (c) 2016 Andrew Lunn <andrew@lunn.ch>
> *
> * Copyright (c) 2016-2017 Savoir-faire Linux Inc.
> @@ -1266,31 +1263,15 @@ static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
> netdev_err(ds->ports[port].netdev, "failed to flush ATU\n");
> }
>
> -static int _mv88e6xxx_vtu_wait(struct mv88e6xxx_chip *chip)
> -{
> - return mv88e6xxx_g1_wait(chip, GLOBAL_VTU_OP, GLOBAL_VTU_OP_BUSY);
> -}
> -
> -static int _mv88e6xxx_vtu_cmd(struct mv88e6xxx_chip *chip, u16 op)
> -{
> - int err;
> -
> - err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_OP, op);
> - if (err)
> - return err;
> -
> - return _mv88e6xxx_vtu_wait(chip);
> -}
> -
> static int _mv88e6xxx_vtu_stu_flush(struct mv88e6xxx_chip *chip)
> {
> int ret;
>
> - ret = _mv88e6xxx_vtu_wait(chip);
> + ret = mv88e6xxx_g1_vtu_op_wait(chip);
> if (ret < 0)
> return ret;
>
> - return _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_FLUSH_ALL);
> + return mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_FLUSH_ALL);
> }
>
> static int _mv88e6xxx_vtu_stu_data_read(struct mv88e6xxx_chip *chip,
> @@ -1380,11 +1361,11 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
> u16 val;
> int err;
>
> - err = _mv88e6xxx_vtu_wait(chip);
> + err = mv88e6xxx_g1_vtu_op_wait(chip);
> if (err)
> return err;
>
> - err = _mv88e6xxx_vtu_cmd(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
> + err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
> if (err)
> return err;
Hi Vivien
This patch got me for a while. It initially looks like a bad idea. It
is not until you read all the patches, you can see why it is actually
good. It is a simple mechanical translation, which is easy to
review. But it seemed odd to be using these names in chip.c. But later
patches solve that, by moving the code in global1_vtu.c.
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 20:40 +0200 |
| Subject | Re: [PATCH net-next 03/18] net: dsa: mv88e6xxx: move VTU Operation accessors |
| Message-ID | <tAWuB-4ry-15@gated-at.bofh.it> |
| In reply to | #1631573 |
On Wed, Apr 26, 2017 at 11:53:21AM -0400, Vivien Didelot wrote:
> Move the helper functions to access the Global 1 VTU Operation register
> to a new global1_vtu.c file, and get rid of the old underscore prefix
> naming convention. This file will be extended will all VTU/STU related
> code.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:00 +0200 |
| Subject | [PATCH net-next 07/18] net: dsa: mv88e6xxx: move VTU VID accessors |
| Message-ID | <tAxwf-4hS-47@gated-at.bofh.it> |
| In reply to | #1631555 |
Add helpers to access the VTU VID register in the global1_vtu.c file.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 57 +++++++++++++--------------------
drivers/net/dsa/mv88e6xxx/global1.h | 4 +++
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 29 +++++++++++++++++
3 files changed, 56 insertions(+), 34 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index ec621879439d..dce490e78347 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1337,12 +1337,6 @@ static int mv88e6xxx_stu_data_write(struct mv88e6xxx_chip *chip,
return _mv88e6xxx_vtu_stu_data_write(chip, entry, 2);
}
-static int _mv88e6xxx_vtu_vid_write(struct mv88e6xxx_chip *chip, u16 vid)
-{
- return mv88e6xxx_g1_write(chip, GLOBAL_VTU_VID,
- vid & GLOBAL_VTU_VID_MASK);
-}
-
static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry)
{
@@ -1358,13 +1352,10 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
if (err)
return err;
- err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_VID, &val);
+ err = mv88e6xxx_g1_vtu_vid_read(chip, &next);
if (err)
return err;
- next.vid = val & GLOBAL_VTU_VID_MASK;
- next.valid = !!(val & GLOBAL_VTU_VID_VALID);
-
if (next.valid) {
err = mv88e6xxx_vtu_data_read(chip, &next);
if (err)
@@ -1410,7 +1401,9 @@ static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port,
int (*cb)(struct switchdev_obj *obj))
{
struct mv88e6xxx_chip *chip = ds->priv;
- struct mv88e6xxx_vtu_entry next;
+ struct mv88e6xxx_vtu_entry next = {
+ .vid = chip->info->max_vid,
+ };
u16 pvid;
int err;
@@ -1423,7 +1416,7 @@ static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port,
if (err)
goto unlock;
- err = _mv88e6xxx_vtu_vid_write(chip, GLOBAL_VTU_VID_MASK);
+ err = mv88e6xxx_g1_vtu_vid_write(chip, &next);
if (err)
goto unlock;
@@ -1464,13 +1457,16 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry)
{
u16 op = GLOBAL_VTU_OP_VTU_LOAD_PURGE;
- u16 reg = 0;
int err;
err = mv88e6xxx_g1_vtu_op_wait(chip);
if (err)
return err;
+ err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
+ if (err)
+ return err;
+
if (!entry->valid)
goto loadpurge;
@@ -1496,14 +1492,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
op |= (entry->fid & 0xf0) << 8;
op |= entry->fid & 0xf;
}
-
- reg = GLOBAL_VTU_VID_VALID;
loadpurge:
- reg |= entry->vid & GLOBAL_VTU_VID_MASK;
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_VID, reg);
- if (err)
- return err;
-
return mv88e6xxx_g1_vtu_op(chip, op);
}
@@ -1513,7 +1502,6 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
struct mv88e6xxx_vtu_entry next = {
.sid = sid,
};
- u16 val;
int err;
err = mv88e6xxx_g1_vtu_op_wait(chip);
@@ -1532,12 +1520,10 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
if (err)
return err;
- err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_VID, &val);
+ err = mv88e6xxx_g1_vtu_vid_read(chip, &next);
if (err)
return err;
- next.valid = !!(val & GLOBAL_VTU_VID_VALID);
-
if (next.valid) {
err = mv88e6xxx_stu_data_read(chip, &next);
if (err)
@@ -1551,7 +1537,6 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry)
{
- u16 reg = 0;
int err;
err = mv88e6xxx_g1_vtu_op_wait(chip);
@@ -1565,10 +1550,8 @@ static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
err = mv88e6xxx_stu_data_write(chip, entry);
if (err)
return err;
-
- reg = GLOBAL_VTU_VID_VALID;
loadpurge:
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_VID, reg);
+ err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
if (err)
return err;
@@ -1582,7 +1565,9 @@ static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
{
DECLARE_BITMAP(fid_bitmap, MV88E6XXX_N_FID);
- struct mv88e6xxx_vtu_entry vlan;
+ struct mv88e6xxx_vtu_entry vlan = {
+ .vid = chip->info->max_vid,
+ };
int i, err;
bitmap_zero(fid_bitmap, MV88E6XXX_N_FID);
@@ -1597,7 +1582,7 @@ static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
}
/* Set every FID bit used by the VLAN entries */
- err = _mv88e6xxx_vtu_vid_write(chip, GLOBAL_VTU_VID_MASK);
+ err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
if (err)
return err;
@@ -1681,7 +1666,9 @@ static int _mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
if (!vid)
return -EINVAL;
- err = _mv88e6xxx_vtu_vid_write(chip, vid - 1);
+ entry->vid = vid - 1;
+ entry->valid = false;
+ err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
if (err)
return err;
@@ -1706,7 +1693,9 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
u16 vid_begin, u16 vid_end)
{
struct mv88e6xxx_chip *chip = ds->priv;
- struct mv88e6xxx_vtu_entry vlan;
+ struct mv88e6xxx_vtu_entry vlan = {
+ .vid = vid_begin - 1,
+ };
int i, err;
if (!vid_begin)
@@ -1714,7 +1703,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
mutex_lock(&chip->reg_lock);
- err = _mv88e6xxx_vtu_vid_write(chip, vid_begin - 1);
+ err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
if (err)
goto unlock;
@@ -2076,7 +2065,7 @@ static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port,
return err;
/* Dump VLANs' Filtering Information Databases */
- err = _mv88e6xxx_vtu_vid_write(chip, vlan.vid);
+ err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
if (err)
return err;
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index 1bf235085215..22fe22bd82cd 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -58,6 +58,10 @@ int mv88e6xxx_g1_vtu_sid_read(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_sid_write(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry);
+int mv88e6xxx_g1_vtu_vid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
+int mv88e6xxx_g1_vtu_vid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip);
int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op);
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip);
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
index 201c063d15f2..6ac3d0eeae6b 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
@@ -82,6 +82,35 @@ int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op)
return mv88e6xxx_g1_vtu_op_wait(chip);
}
+/* Offset 0x06: VTU VID Register */
+
+int mv88e6xxx_g1_vtu_vid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val;
+ int err;
+
+ err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_VID, &val);
+ if (err)
+ return err;
+
+ entry->vid = val & 0xfff;
+ entry->valid = !!(val & GLOBAL_VTU_VID_VALID);
+
+ return 0;
+}
+
+int mv88e6xxx_g1_vtu_vid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val = entry->vid & 0xfff;
+
+ if (entry->valid)
+ val |= GLOBAL_VTU_VID_VALID;
+
+ return mv88e6xxx_g1_write(chip, GLOBAL_VTU_VID, val);
+}
+
/* VLAN Translation Unit Operations */
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip)
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 21:00 +0200 |
| Subject | Re: [PATCH net-next 07/18] net: dsa: mv88e6xxx: move VTU VID accessors |
| Message-ID | <tAWNY-4B2-11@gated-at.bofh.it> |
| In reply to | #1631575 |
> @@ -1464,13 +1457,16 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
> struct mv88e6xxx_vtu_entry *entry)
> {
> u16 op = GLOBAL_VTU_OP_VTU_LOAD_PURGE;
> - u16 reg = 0;
> int err;
>
> err = mv88e6xxx_g1_vtu_op_wait(chip);
> if (err)
> return err;
>
> + err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
> + if (err)
> + return err;
> +
> if (!entry->valid)
> goto loadpurge;
>
> @@ -1496,14 +1492,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
> op |= (entry->fid & 0xf0) << 8;
> op |= entry->fid & 0xf;
> }
> -
> - reg = GLOBAL_VTU_VID_VALID;
> loadpurge:
> - reg |= entry->vid & GLOBAL_VTU_VID_MASK;
> - err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_VID, reg);
> - if (err)
> - return err;
> -
> return mv88e6xxx_g1_vtu_op(chip, op);
> }
This is not obvious, why do the vtu_vid_write() at the beginning,
rather than at the end? Especially before the if (!entry->valid).
However, when you look at the rest of the patch, it is O.K.
It might of been better to do this in two patches, to make it clearer
what is going on.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:10 +0200 |
| Subject | [PATCH net-next 16/18] net: dsa: mv88e6xxx: simplify VTU entry getter |
| Message-ID | <tAxFT-4AU-1@gated-at.bofh.it> |
| In reply to | #1631555 |
Make the code which fetches or initializes a new VTU entry more concise.
This allows us the get rid of the old underscore prefix naming.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 64 ++++++++++++++++------------------------
1 file changed, 25 insertions(+), 39 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 51c8b2ff9760..aede0194e341 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1359,33 +1359,8 @@ static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
return mv88e6xxx_g1_atu_flush(chip, *fid, true);
}
-static int _mv88e6xxx_vtu_new(struct mv88e6xxx_chip *chip, u16 vid,
- struct mv88e6xxx_vtu_entry *entry)
-{
- struct dsa_switch *ds = chip->ds;
- struct mv88e6xxx_vtu_entry vlan = {
- .valid = true,
- .vid = vid,
- };
- int i, err;
-
- err = mv88e6xxx_atu_new(chip, &vlan.fid);
- if (err)
- return err;
-
- /* exclude all ports except the CPU and DSA ports */
- for (i = 0; i < mv88e6xxx_num_ports(chip); ++i)
- vlan.member[i] = dsa_is_cpu_port(ds, i) ||
- dsa_is_dsa_port(ds, i)
- ? GLOBAL_VTU_DATA_MEMBER_TAG_UNMODIFIED
- : GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER;
-
- *entry = vlan;
- return 0;
-}
-
-static int _mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
- struct mv88e6xxx_vtu_entry *entry, bool creat)
+static int mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
+ struct mv88e6xxx_vtu_entry *entry, bool new)
{
int err;
@@ -1399,17 +1374,28 @@ static int _mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
if (err)
return err;
- if (entry->vid != vid || !entry->valid) {
- if (!creat)
- return -EOPNOTSUPP;
- /* -ENOENT would've been more appropriate, but switchdev expects
- * -EOPNOTSUPP to inform bridge about an eventual software VLAN.
- */
-
- err = _mv88e6xxx_vtu_new(chip, vid, entry);
+ if (entry->vid == vid && entry->valid)
+ return 0;
+
+ if (new) {
+ int i;
+
+ /* Initialize a fresh VLAN entry */
+ memset(entry, 0, sizeof(*entry));
+ entry->valid = true;
+ entry->vid = vid;
+
+ /* Include only CPU and DSA ports */
+ for (i = 0; i < mv88e6xxx_num_ports(chip); ++i)
+ entry->member[i] = dsa_is_normal_port(chip->ds, i) ?
+ GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER :
+ GLOBAL_VTU_DATA_MEMBER_TAG_UNMODIFIED;
+
+ return mv88e6xxx_atu_new(chip, &entry->fid);
}
- return err;
+ /* switchdev expects -EOPNOTSUPP to honor software VLANs */
+ return -EOPNOTSUPP;
}
static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
@@ -1519,7 +1505,7 @@ static int _mv88e6xxx_port_vlan_add(struct mv88e6xxx_chip *chip, int port,
struct mv88e6xxx_vtu_entry vlan;
int err;
- err = _mv88e6xxx_vtu_get(chip, vid, &vlan, true);
+ err = mv88e6xxx_vtu_get(chip, vid, &vlan, true);
if (err)
return err;
@@ -1564,7 +1550,7 @@ static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry vlan;
int i, err;
- err = _mv88e6xxx_vtu_get(chip, vid, &vlan, false);
+ err = mv88e6xxx_vtu_get(chip, vid, &vlan, false);
if (err)
return err;
@@ -1639,7 +1625,7 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,
if (vid == 0)
err = mv88e6xxx_port_get_fid(chip, port, &vlan.fid);
else
- err = _mv88e6xxx_vtu_get(chip, vid, &vlan, false);
+ err = mv88e6xxx_vtu_get(chip, vid, &vlan, false);
if (err)
return err;
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-28 04:30 +0200 |
| Subject | Re: [PATCH net-next 16/18] net: dsa: mv88e6xxx: simplify VTU entry getter |
| Message-ID | <tB3Pr-1aZ-5@gated-at.bofh.it> |
| In reply to | #1631576 |
On Wed, Apr 26, 2017 at 11:53:34AM -0400, Vivien Didelot wrote:
> Make the code which fetches or initializes a new VTU entry more concise.
> This allows us the get rid of the old underscore prefix naming.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:10 +0200 |
| Subject | [PATCH net-next 06/18] net: dsa: mv88e6xxx: move VTU SID accessors |
| Message-ID | <tAxFT-4AU-13@gated-at.bofh.it> |
| In reply to | #1631555 |
Add helpers to access the VTU SID register in the global1_vtu.c file.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 21 ++++++++-------------
drivers/net/dsa/mv88e6xxx/global1.h | 4 ++++
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 25 +++++++++++++++++++++++++
3 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 0452543a2463..ec621879439d 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1387,11 +1387,9 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
}
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_STU)) {
- err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_SID, &val);
+ err = mv88e6xxx_g1_vtu_sid_read(chip, &next);
if (err)
return err;
-
- next.sid = val & GLOBAL_VTU_SID_MASK;
}
}
@@ -1482,8 +1480,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
return err;
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_STU)) {
- reg = entry->sid & GLOBAL_VTU_SID_MASK;
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_SID, reg);
+ err = mv88e6xxx_g1_vtu_sid_write(chip, entry);
if (err)
return err;
}
@@ -1513,7 +1510,9 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
struct mv88e6xxx_vtu_entry *entry)
{
- struct mv88e6xxx_vtu_entry next = { 0 };
+ struct mv88e6xxx_vtu_entry next = {
+ .sid = sid,
+ };
u16 val;
int err;
@@ -1521,8 +1520,7 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
if (err)
return err;
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_SID,
- sid & GLOBAL_VTU_SID_MASK);
+ err = mv88e6xxx_g1_vtu_sid_write(chip, &next);
if (err)
return err;
@@ -1530,12 +1528,10 @@ static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
if (err)
return err;
- err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_SID, &val);
+ err = mv88e6xxx_g1_vtu_sid_read(chip, &next);
if (err)
return err;
- next.sid = val & GLOBAL_VTU_SID_MASK;
-
err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_VID, &val);
if (err)
return err;
@@ -1576,8 +1572,7 @@ static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
if (err)
return err;
- reg = entry->sid & GLOBAL_VTU_SID_MASK;
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_SID, reg);
+ err = mv88e6xxx_g1_vtu_sid_write(chip, entry);
if (err)
return err;
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index 353de283362f..1bf235085215 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -54,6 +54,10 @@ int mv88e6xxx_g1_vtu_fid_read(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_fid_write(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry);
+int mv88e6xxx_g1_vtu_sid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
+int mv88e6xxx_g1_vtu_sid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip);
int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op);
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip);
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
index 81d6f9f3c84a..201c063d15f2 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
@@ -39,6 +39,31 @@ int mv88e6xxx_g1_vtu_fid_write(struct mv88e6xxx_chip *chip,
return mv88e6xxx_g1_write(chip, GLOBAL_VTU_FID, val);
}
+/* Offset 0x03: VTU SID Register */
+
+int mv88e6xxx_g1_vtu_sid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val;
+ int err;
+
+ err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_SID, &val);
+ if (err)
+ return err;
+
+ entry->sid = val & GLOBAL_VTU_SID_MASK;
+
+ return 0;
+}
+
+int mv88e6xxx_g1_vtu_sid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val = entry->sid & GLOBAL_VTU_SID_MASK;
+
+ return mv88e6xxx_g1_write(chip, GLOBAL_VTU_SID, val);
+}
+
/* Offset 0x05: VTU Operation Register */
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip)
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 20:40 +0200 |
| Subject | Re: [PATCH net-next 06/18] net: dsa: mv88e6xxx: move VTU SID accessors |
| Message-ID | <tAWuB-4ry-13@gated-at.bofh.it> |
| In reply to | #1631578 |
On Wed, Apr 26, 2017 at 11:53:24AM -0400, Vivien Didelot wrote:
> Add helpers to access the VTU SID register in the global1_vtu.c file.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:10 +0200 |
| Subject | [PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext |
| Message-ID | <tAxFU-4AU-33@gated-at.bofh.it> |
| In reply to | #1631555 |
Even though every switch model has a different way to access the VTU
Data bits, the base implementation of the VTU GetNext operation remains
the same: wait, write the first VID to iterate from, start the
operation, and read the next VID.
Move this generic implementation into global_vtu.c and abstract the
handling of the start VID (similarly to the ATU GetNext implementation),
before introducing a new chip operation for specific chips.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 31 ++-----------------------------
drivers/net/dsa/mv88e6xxx/global1.h | 2 ++
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 23 +++++++++++++++++++++++
3 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index dce490e78347..70b420e134ce 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1340,19 +1340,11 @@ static int mv88e6xxx_stu_data_write(struct mv88e6xxx_chip *chip,
static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry)
{
- struct mv88e6xxx_vtu_entry next = { 0 };
+ struct mv88e6xxx_vtu_entry next = *entry;
u16 val;
int err;
- err = mv88e6xxx_g1_vtu_op_wait(chip);
- if (err)
- return err;
-
- err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
- if (err)
- return err;
-
- err = mv88e6xxx_g1_vtu_vid_read(chip, &next);
+ err = mv88e6xxx_g1_vtu_getnext(chip, &next);
if (err)
return err;
@@ -1416,10 +1408,6 @@ static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port,
if (err)
goto unlock;
- err = mv88e6xxx_g1_vtu_vid_write(chip, &next);
- if (err)
- goto unlock;
-
do {
err = _mv88e6xxx_vtu_getnext(chip, &next);
if (err)
@@ -1582,10 +1570,6 @@ static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
}
/* Set every FID bit used by the VLAN entries */
- err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
- if (err)
- return err;
-
do {
err = _mv88e6xxx_vtu_getnext(chip, &vlan);
if (err)
@@ -1668,9 +1652,6 @@ static int _mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
entry->vid = vid - 1;
entry->valid = false;
- err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
- if (err)
- return err;
err = _mv88e6xxx_vtu_getnext(chip, entry);
if (err)
@@ -1703,10 +1684,6 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port,
mutex_lock(&chip->reg_lock);
- err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
- if (err)
- goto unlock;
-
do {
err = _mv88e6xxx_vtu_getnext(chip, &vlan);
if (err)
@@ -2065,10 +2042,6 @@ static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port,
return err;
/* Dump VLANs' Filtering Information Databases */
- err = mv88e6xxx_g1_vtu_vid_write(chip, &vlan);
- if (err)
- return err;
-
do {
err = _mv88e6xxx_vtu_getnext(chip, &vlan);
if (err)
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index 22fe22bd82cd..66216848fc0d 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -64,6 +64,8 @@ int mv88e6xxx_g1_vtu_vid_write(struct mv88e6xxx_chip *chip,
struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip);
int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op);
+int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip);
#endif /* _MV88E6XXX_GLOBAL1_H */
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
index 6ac3d0eeae6b..efe43d7d9e10 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
@@ -113,6 +113,29 @@ int mv88e6xxx_g1_vtu_vid_write(struct mv88e6xxx_chip *chip,
/* VLAN Translation Unit Operations */
+int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ int err;
+
+ err = mv88e6xxx_g1_vtu_op_wait(chip);
+ if (err)
+ return err;
+
+ /* Write the VID to iterate from only once */
+ if (!entry->valid) {
+ err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
+ if (err)
+ return err;
+ }
+
+ err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_VTU_GET_NEXT);
+ if (err)
+ return err;
+
+ return mv88e6xxx_g1_vtu_vid_read(chip, entry);
+}
+
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip)
{
int err;
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 21:00 +0200 |
| Subject | Re: [PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext |
| Message-ID | <tAWNX-4B2-1@gated-at.bofh.it> |
| In reply to | #1631580 |
On Wed, Apr 26, 2017 at 11:53:26AM -0400, Vivien Didelot wrote:
> Even though every switch model has a different way to access the VTU
> Data bits, the base implementation of the VTU GetNext operation remains
> the same: wait, write the first VID to iterate from, start the
> operation, and read the next VID.
>
> Move this generic implementation into global_vtu.c and abstract the
global1_vtu.c
> +int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
> + struct mv88e6xxx_vtu_entry *entry)
> +{
> + int err;
> +
> + err = mv88e6xxx_g1_vtu_op_wait(chip);
> + if (err)
> + return err;
> +
> + /* Write the VID to iterate from only once */
> + if (!entry->valid) {
> + err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
> + if (err)
> + return err;
> + }
Please could you add a bigger comment. It is not clear why you write
it, when it is invalid. That just seems wrong, and needs a good
comment to explain why it is correct, more than what you currently
have as a comment.
Thanks
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-28 17:10 +0200 |
| Subject | Re: [PATCH net-next 08/18] net: dsa: mv88e6xxx: move generic VTU GetNext |
| Message-ID | <tBfGV-DE-1@gated-at.bofh.it> |
| In reply to | #1632334 |
Hi Andrew,
Andrew Lunn <andrew@lunn.ch> writes:
>> + /* Write the VID to iterate from only once */
>> + if (!entry->valid) {
>> + err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
>> + if (err)
>> + return err;
>> + }
>
> Please could you add a bigger comment. It is not clear why you write
> it, when it is invalid. That just seems wrong, and needs a good
> comment to explain why it is correct, more than what you currently
> have as a comment.
This trick could indeed benefit a better explanation. The reason for it
is that I used the same comment as the ATU GetNext implementation, i.e.:
/* Write the MAC address to iterate from only once */
if (entry->state == GLOBAL_ATU_DATA_STATE_UNUSED) {
err = mv88e6xxx_g1_atu_mac_write(chip, entry);
if (err)
return err;
}
I suggest me sending a future patch to improve the comments of both
GetNext (ATU and VTU) implementations at the same time later.
Thanks,
Vivien
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:10 +0200 |
| Subject | [PATCH net-next 12/18] net: dsa: mv88e6xxx: load STU entry with VTU entry |
| Message-ID | <tAxFU-4AU-35@gated-at.bofh.it> |
| In reply to | #1631555 |
Now that the code writes both VTU and STU data when loading a VTU entry,
load the corresponding STU entry at the same time.
This allows us to get rid of the STU management in the
_mv88e6xxx_vtu_new helper and thus remove the separate implementations
of STU Load/Purge and STU GetNext, as well as the unused family checks.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 108 ++-------------------------------------
1 file changed, 4 insertions(+), 104 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 38c3e047fbf9..fc30a3e3df47 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -677,31 +677,6 @@ static int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip,
return err;
}
-static bool mv88e6xxx_6097_family(struct mv88e6xxx_chip *chip)
-{
- return chip->info->family == MV88E6XXX_FAMILY_6097;
-}
-
-static bool mv88e6xxx_6165_family(struct mv88e6xxx_chip *chip)
-{
- return chip->info->family == MV88E6XXX_FAMILY_6165;
-}
-
-static bool mv88e6xxx_6341_family(struct mv88e6xxx_chip *chip)
-{
- return chip->info->family == MV88E6XXX_FAMILY_6341;
-}
-
-static bool mv88e6xxx_6351_family(struct mv88e6xxx_chip *chip)
-{
- return chip->info->family == MV88E6XXX_FAMILY_6351;
-}
-
-static bool mv88e6xxx_6352_family(struct mv88e6xxx_chip *chip)
-{
- return chip->info->family == MV88E6XXX_FAMILY_6352;
-}
-
static int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port,
int link, int speed, int duplex,
phy_interface_t mode)
@@ -1393,6 +1368,10 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
err = mv88e6xxx_g1_vtu_sid_write(chip, entry);
if (err)
return err;
+
+ err = mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_STU_LOAD_PURGE);
+ if (err)
+ return err;
}
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G1_VTU_FID)) {
@@ -1410,60 +1389,6 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
return mv88e6xxx_g1_vtu_op(chip, op);
}
-static int _mv88e6xxx_stu_getnext(struct mv88e6xxx_chip *chip, u8 sid,
- struct mv88e6xxx_vtu_entry *entry)
-{
- struct mv88e6xxx_vtu_entry next = {
- .sid = sid,
- };
- int err;
-
- err = mv88e6xxx_g1_vtu_op_wait(chip);
- if (err)
- return err;
-
- err = mv88e6xxx_g1_vtu_stu_getnext(chip, &next);
- if (err)
- return err;
-
- if (next.valid) {
- err = mv88e6185_g1_vtu_data_read(chip, &next);
- if (err)
- return err;
- }
-
- *entry = next;
- return 0;
-}
-
-static int _mv88e6xxx_stu_loadpurge(struct mv88e6xxx_chip *chip,
- struct mv88e6xxx_vtu_entry *entry)
-{
- int err;
-
- err = mv88e6xxx_g1_vtu_op_wait(chip);
- if (err)
- return err;
-
- if (!entry->valid)
- goto loadpurge;
-
- /* Write port states */
- err = mv88e6185_g1_vtu_data_write(chip, entry);
- if (err)
- return err;
-loadpurge:
- err = mv88e6xxx_g1_vtu_vid_write(chip, entry);
- if (err)
- return err;
-
- err = mv88e6xxx_g1_vtu_sid_write(chip, entry);
- if (err)
- return err;
-
- return mv88e6xxx_g1_vtu_op(chip, GLOBAL_VTU_OP_STU_LOAD_PURGE);
-}
-
static int mv88e6xxx_atu_new(struct mv88e6xxx_chip *chip, u16 *fid)
{
DECLARE_BITMAP(fid_bitmap, MV88E6XXX_N_FID);
@@ -1527,31 +1452,6 @@ static int _mv88e6xxx_vtu_new(struct mv88e6xxx_chip *chip, u16 vid,
? GLOBAL_VTU_DATA_MEMBER_TAG_UNMODIFIED
: GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER;
- if (mv88e6xxx_6097_family(chip) || mv88e6xxx_6165_family(chip) ||
- mv88e6xxx_6351_family(chip) || mv88e6xxx_6352_family(chip) ||
- mv88e6xxx_6341_family(chip)) {
- struct mv88e6xxx_vtu_entry vstp;
-
- /* Adding a VTU entry requires a valid STU entry. As VSTP is not
- * implemented, only one STU entry is needed to cover all VTU
- * entries. Thus, validate the SID 0.
- */
- vlan.sid = 0;
- err = _mv88e6xxx_stu_getnext(chip, GLOBAL_VTU_SID_MASK, &vstp);
- if (err)
- return err;
-
- if (vstp.sid != vlan.sid || !vstp.valid) {
- memset(&vstp, 0, sizeof(vstp));
- vstp.valid = true;
- vstp.sid = vlan.sid;
-
- err = _mv88e6xxx_stu_loadpurge(chip, &vstp);
- if (err)
- return err;
- }
- }
-
*entry = vlan;
return 0;
}
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-28 04:10 +0200 |
| Subject | Re: [PATCH net-next 12/18] net: dsa: mv88e6xxx: load STU entry with VTU entry |
| Message-ID | <tB3w6-YD-5@gated-at.bofh.it> |
| In reply to | #1631581 |
On Wed, Apr 26, 2017 at 11:53:30AM -0400, Vivien Didelot wrote:
> Now that the code writes both VTU and STU data when loading a VTU entry,
> load the corresponding STU entry at the same time.
>
> This allows us to get rid of the STU management in the
> _mv88e6xxx_vtu_new helper and thus remove the separate implementations
> of STU Load/Purge and STU GetNext, as well as the unused family checks.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-04-26 18:10 +0200 |
| Subject | [PATCH net-next 05/18] net: dsa: mv88e6xxx: move VTU FID accessors |
| Message-ID | <tAxFU-4AU-29@gated-at.bofh.it> |
| In reply to | #1631555 |
Add helpers to access the VTU FID register in the global1_vtu.c file.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 7 ++-----
drivers/net/dsa/mv88e6xxx/global1.h | 4 ++++
drivers/net/dsa/mv88e6xxx/global1_vtu.c | 25 +++++++++++++++++++++++++
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index d244c2283138..0452543a2463 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1371,11 +1371,9 @@ static int _mv88e6xxx_vtu_getnext(struct mv88e6xxx_chip *chip,
return err;
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G1_VTU_FID)) {
- err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_FID, &val);
+ err = mv88e6xxx_g1_vtu_fid_read(chip, &next);
if (err)
return err;
-
- next.fid = val & GLOBAL_VTU_FID_MASK;
} else if (mv88e6xxx_num_databases(chip) == 256) {
/* VTU DBNum[7:4] are located in VTU Operation 11:8, and
* VTU DBNum[3:0] are located in VTU Operation 3:0
@@ -1491,8 +1489,7 @@ static int _mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
}
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G1_VTU_FID)) {
- reg = entry->fid & GLOBAL_VTU_FID_MASK;
- err = mv88e6xxx_g1_write(chip, GLOBAL_VTU_FID, reg);
+ err = mv88e6xxx_g1_vtu_fid_write(chip, entry);
if (err)
return err;
} else if (mv88e6xxx_num_databases(chip) == 256) {
diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
index ed40e5557bbc..353de283362f 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.h
+++ b/drivers/net/dsa/mv88e6xxx/global1.h
@@ -50,6 +50,10 @@ int mv88e6xxx_g1_atu_flush(struct mv88e6xxx_chip *chip, u16 fid, bool all);
int mv88e6xxx_g1_atu_remove(struct mv88e6xxx_chip *chip, u16 fid, int port,
bool all);
+int mv88e6xxx_g1_vtu_fid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
+int mv88e6xxx_g1_vtu_fid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry);
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip);
int mv88e6xxx_g1_vtu_op(struct mv88e6xxx_chip *chip, u16 op);
int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip);
diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
index c41ca28da084..81d6f9f3c84a 100644
--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
+++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
@@ -14,6 +14,31 @@
#include "mv88e6xxx.h"
#include "global1.h"
+/* Offset 0x02: VTU FID Register */
+
+int mv88e6xxx_g1_vtu_fid_read(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val;
+ int err;
+
+ err = mv88e6xxx_g1_read(chip, GLOBAL_VTU_FID, &val);
+ if (err)
+ return err;
+
+ entry->fid = val & GLOBAL_VTU_FID_MASK;
+
+ return 0;
+}
+
+int mv88e6xxx_g1_vtu_fid_write(struct mv88e6xxx_chip *chip,
+ struct mv88e6xxx_vtu_entry *entry)
+{
+ u16 val = entry->fid & GLOBAL_VTU_FID_MASK;
+
+ return mv88e6xxx_g1_write(chip, GLOBAL_VTU_FID, val);
+}
+
/* Offset 0x05: VTU Operation Register */
int mv88e6xxx_g1_vtu_op_wait(struct mv88e6xxx_chip *chip)
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-04-27 20:40 +0200 |
| Subject | Re: [PATCH net-next 05/18] net: dsa: mv88e6xxx: move VTU FID accessors |
| Message-ID | <tAWuB-4ry-3@gated-at.bofh.it> |
| In reply to | #1631584 |
On Wed, Apr 26, 2017 at 11:53:23AM -0400, Vivien Didelot wrote:
> Add helpers to access the VTU FID register in the global1_vtu.c file.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-05-01 18:00 +0200 |
| Message-ID | <tClTY-2yI-13@gated-at.bofh.it> |
| In reply to | #1631555 |
Hi David,
Vivien Didelot <vivien.didelot@savoirfairelinux.com> writes:
> Vivien Didelot (18):
> net: dsa: mv88e6xxx: add max VID to info
> net: dsa: mv88e6xxx: split VTU entry data member
> net: dsa: mv88e6xxx: move VTU Operation accessors
> net: dsa: mv88e6xxx: move VTU flush
> net: dsa: mv88e6xxx: move VTU FID accessors
> net: dsa: mv88e6xxx: move VTU SID accessors
> net: dsa: mv88e6xxx: move VTU VID accessors
> net: dsa: mv88e6xxx: move generic VTU GetNext
> net: dsa: mv88e6xxx: move VTU Data accessors
> net: dsa: mv88e6xxx: move STU GetNext operation
> net: dsa: mv88e6xxx: get STU entry on VTU GetNext
> net: dsa: mv88e6xxx: load STU entry with VTU entry
> net: dsa: mv88e6xxx: add VTU GetNext operation
> net: dsa: mv88e6xxx: add VTU Load/Purge operation
> net: dsa: mv88e6xxx: make VTU helpers static
> net: dsa: mv88e6xxx: simplify VTU entry getter
> net: dsa: mv88e6xxx: support the VTU Page bit
> net: dsa: mv88e6xxx: add VTU support for 88E6390
>
> drivers/net/dsa/mv88e6xxx/Makefile | 1 +
> drivers/net/dsa/mv88e6xxx/chip.c | 568 +++++++++-----------------------
> drivers/net/dsa/mv88e6xxx/global1.h | 14 +
> drivers/net/dsa/mv88e6xxx/global1_vtu.c | 505 ++++++++++++++++++++++++++++
> drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 31 +-
> 5 files changed, 684 insertions(+), 435 deletions(-)
> create mode 100644 drivers/net/dsa/mv88e6xxx/global1_vtu.c
I don't see the patchset in net-next. Can you pick it?
Thanks,
Vivien
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-05-01 18:10 +0200 |
| Subject | Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU |
| Message-ID | <tCm3E-2R0-13@gated-at.bofh.it> |
| In reply to | #1633715 |
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Date: Mon, 01 May 2017 11:51:05 -0400 > Hi David, > > Vivien Didelot <vivien.didelot@savoirfairelinux.com> writes: > >> Vivien Didelot (18): >> net: dsa: mv88e6xxx: add max VID to info >> net: dsa: mv88e6xxx: split VTU entry data member >> net: dsa: mv88e6xxx: move VTU Operation accessors >> net: dsa: mv88e6xxx: move VTU flush >> net: dsa: mv88e6xxx: move VTU FID accessors >> net: dsa: mv88e6xxx: move VTU SID accessors >> net: dsa: mv88e6xxx: move VTU VID accessors >> net: dsa: mv88e6xxx: move generic VTU GetNext >> net: dsa: mv88e6xxx: move VTU Data accessors >> net: dsa: mv88e6xxx: move STU GetNext operation >> net: dsa: mv88e6xxx: get STU entry on VTU GetNext >> net: dsa: mv88e6xxx: load STU entry with VTU entry >> net: dsa: mv88e6xxx: add VTU GetNext operation >> net: dsa: mv88e6xxx: add VTU Load/Purge operation >> net: dsa: mv88e6xxx: make VTU helpers static >> net: dsa: mv88e6xxx: simplify VTU entry getter >> net: dsa: mv88e6xxx: support the VTU Page bit >> net: dsa: mv88e6xxx: add VTU support for 88E6390 >> >> drivers/net/dsa/mv88e6xxx/Makefile | 1 + >> drivers/net/dsa/mv88e6xxx/chip.c | 568 +++++++++----------------------- >> drivers/net/dsa/mv88e6xxx/global1.h | 14 + >> drivers/net/dsa/mv88e6xxx/global1_vtu.c | 505 ++++++++++++++++++++++++++++ >> drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 31 +- >> 5 files changed, 684 insertions(+), 435 deletions(-) >> create mode 100644 drivers/net/dsa/mv88e6xxx/global1_vtu.c > > I don't see the patchset in net-next. Can you pick it? This had feedback which you must address, therefore the state in patchwork is "changes requested" which you could have checked before asking me this. If the patch set is fine and you got ACKs for all of your patches then please resubmit. Otherwise, make the changes you were asked to make or explain to the person who asked for them why they are not appropriate.
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-05-01 18:30 +0200 |
| Subject | Re: [PATCH net-next 00/18] net: dsa: mv88e6xxx: 802.1s and 88E6390 VTU |
| Message-ID | <tCmmZ-2Xx-1@gated-at.bofh.it> |
| In reply to | #1633725 |
> We did discuss the patchset and everything is good as is. Can someone > change the state in patchwork afterwards? It feels weird to resend the > patch with no changes. Hi Vivien I actually pointed out a typo in one of the change log message. And i requested some additional comments. Andrew
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | linux.kernel
csiph-web