--- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -157,6 +157,7 @@ struct net_bridge_port #define BR_ROOT_BLOCK 0x00000004 #define BR_MULTICAST_FAST_LEAVE 0x00000008 #define BR_ADMIN_COST 0x00000010 +#define BR_ISOLATE_MODE 0x00000020 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING u32 multicast_startup_queries_sent; --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c @@ -159,6 +159,22 @@ BRPORT_ATTR_FLAG(hairpin_mode, BR_HAIRPI BRPORT_ATTR_FLAG(bpdu_guard, BR_BPDU_GUARD); BRPORT_ATTR_FLAG(root_block, BR_ROOT_BLOCK); +static ssize_t show_isolate_mode(struct net_bridge_port *p, char *buf) +{ + int isolate_mode = (p->flags & BR_ISOLATE_MODE) ? 1 : 0; + return sprintf(buf, "%d\n", isolate_mode); +} +static ssize_t store_isolate_mode(struct net_bridge_port *p, unsigned long v) +{ + if (v) + p->flags |= BR_ISOLATE_MODE; + else + p->flags &= ~BR_ISOLATE_MODE; + return 0; +} +static BRPORT_ATTR(isolate_mode, S_IRUGO | S_IWUSR, + show_isolate_mode, store_isolate_mode); + #ifdef CONFIG_BRIDGE_IGMP_SNOOPING static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) { @@ -199,6 +215,7 @@ static const struct brport_attribute *br &brport_attr_multicast_router, &brport_attr_multicast_fast_leave, #endif + &brport_attr_isolate_mode, NULL }; --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c @@ -114,8 +114,8 @@ int br_handle_frame_finish(struct sk_buf skb2 = skb; br->dev->stats.multicast++; - } else if ((dst = __br_fdb_get(br, dest, vid)) && - dst->is_local) { + } else if ((p->flags & BR_ISOLATE_MODE) || + ((dst = __br_fdb_get(br, dest, vid)) && dst->is_local)) { skb2 = skb; /* Do not forward the packet since it's local. */ skb = NULL; --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -119,7 +119,7 @@ void br_deliver(const struct net_bridge_ /* called with rcu_read_lock */ void br_forward(const struct net_bridge_port *to, struct sk_buff *skb, struct sk_buff *skb0) { - if (should_deliver(to, skb)) { + if (should_deliver(to, skb) && !(to->flags & BR_ISOLATE_MODE)) { if (skb0) deliver_clone(to, skb, __br_forward); else @@ -174,7 +174,8 @@ out: static void br_flood(struct net_bridge *br, struct sk_buff *skb, struct sk_buff *skb0, void (*__packet_hook)(const struct net_bridge_port *p, - struct sk_buff *skb)) + struct sk_buff *skb), + bool forward) { struct net_bridge_port *p; struct net_bridge_port *prev; @@ -182,6 +183,9 @@ static void br_flood(struct net_bridge * prev = NULL; list_for_each_entry_rcu(p, &br->port_list, list) { + if (forward && (p->flags & BR_ISOLATE_MODE)) + continue; + prev = maybe_deliver(prev, p, skb, __packet_hook); if (IS_ERR(prev)) goto out; @@ -205,14 +209,14 @@ out: /* called with rcu_read_lock */ void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb) { - br_flood(br, skb, NULL, __br_deliver); + br_flood(br, skb, NULL, __br_deliver, false); } /* called under bridge lock */ void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, struct sk_buff *skb2) { - br_flood(br, skb, skb2, __br_forward); + br_flood(br, skb, skb2, __br_forward, true); } #ifdef CONFIG_BRIDGE_IGMP_SNOOPING 20' href='#n20'>20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
.. exec::
   from helpers import createShields
   createShields()

GHDL
####

.. raw:: html

   <p style="text-align: center;">
     <a title="GitHub Repository" href="https://github.com/ghdl/ghdl"><img src="https://img.shields.io/badge/-ghdl/ghdl-323131.svg?longCache=true&style=flat-square&logo=github"></a><!--
     -->
     <a title="Talk to us on Gitter" href="https://gitter.im/ghdl1/Lobby"><img src="https://img.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=fff"></a><!--
     -->
     <a title="GNU General Public License 2" href="Licenses.html"><img src="https://img.shields.io/badge/code%20license-GPLv2-bd0000.svg?longCache=true&style=flat-square&label=license&logo=gnu"></a><!--
     -->
     <a title="Creative Commons Attribution-ShareAlike 4.0" href="Licenses.html"><img src="https://img.shields.io/badge/doc%20license-CC--BY--SA--4.0-bf7600.svg?longCache=true&style=flat-square&logo=Creative%20Commons&logoColor=fff"></a><!--
     -->
     <a title="Latest release" href="http://ghdl.rtfd.io"><img src="https://img.shields.io/github/release/ghdl/ghdl.svg?longCache=true&style=flat-square&label=latest%20release"></a><!--
     -->
   </p>

   <p style="text-align: center; font-weight: 700; font-size: 125%; margin: 24px 0;">
   GHDL: free and open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL
   </p>

.. only:: html

   News
   ****

   02.02.2021 - `GHDL v1.0 was released <https://github.com/ghdl/ghdl/milestone/9?closed=1>`__
   ============================================================================================

   31.01.2021 - GHDL v1.0.0rc1 was tagged
   ======================================

   * Python bindings were overhauled and renamed to ``pyGHDL``. Three modules are included: ``libghdl``, ``lsp`` and ``dom``.

     * The utility scripts in the codebase were moved into subdir ``scripts``: CI, binding generation, vendors, etc.

   * Repository `ghdl/extended-tests <https://github.com/ghdl/extended-tests>`__ was created for testing `vendors` build scripts.

   * The logo was updated (org, ghdl/ghdl, ghdl/docker and ghdl/ghdl-cosim).

   * Assets are not added to releases or pre-releases anymore. Users should use package managers or nightly assets.

   21.05.2020 - Nightly build assets available
   ===========================================

   * After each successful CI run of branch ``master``, packages are published as assets of pre-release `nightly <https://github.com/ghdl/ghdl/releases/tag/nightly>`__.
   * GitHub Action `ghdl/setup-ghdl-ci <https://github.com/ghdl/setup-ghdl-ci>`__ was created, to allow easy installation of
     nightly GHDL assets in GitHub Actions workflows.

   09.05.2020 - New repositories and a wiki were created
   =====================================================

   * The plugin for Yosys was moved from `tgingold/ghdlsynth-beta <https://github.com/tgingold/ghdlsynth-beta>`__ to
     `ghdl/ghdl-yosys-plugin <https://github.com/ghdl/ghdl-yosys-plugin>`__.
   * Repository `ghdl/ghdl-cosim <https://github.com/ghdl/ghdl-cosim>`__ was created. It contains documentation and code
     examples related to VHPIDIRECT, VPI and SystemC. See :ref:`COSIM` and `Previous work and future ideas <https://github.com/ghdl/ghdl-cosim/issues/1>`__.
   * A `Wiki <https://github.com/ghdl/ghdl/wiki>`__ was created. The roadmap and ideas for documentation and internship
     programs were moved there. If you want to contribute anyhow, `have a look <https://github.com/ghdl/ghdl/wiki>`__!

   28.02.2020 - `GHDL v0.37 was released <https://github.com/ghdl/ghdl/milestone/8?closed=1>`__
   ============================================================================================

   The major changes are:

      * Experimental support of synthesis (either with --synth or with
	the Yosys plugin).
      * Fixes and improved support of vhdl 2008.
      * Last version that supports the Mentor variation of
	std_logic_arith.  The Synopsys one is still available.

   03.03.2019 - `GHDL v0.36 was released <https://github.com/ghdl/ghdl/milestone/7?closed=1>`__
   ============================================================================================

   23.02.2019 - GHDL v0.36-rc1 was released
   ========================================

   The major improvements are:

      * more support of unbounded arrays and records
      * support of UVVM and Vunit

   29.11.2018 - GHDL 20181129 was released
   =======================================

   20.12.2017 - A new GitHub organization was created
   ==================================================

   A new GitHub organization is created and the main repo is moved from `github.com/tgingold/ghdl <https://github.com/tgingold/ghdl>`__ to
   `github.com/ghdl/ghdl <https://github.com/ghdl/ghdl>`__. Old refs will continue working, because permanent redirects are set up. However, we suggest
   every contributor to update the remote URLs in their local clones.

   14.12.2017 - `GHDL 0.35 was released <https://github.com/ghdl/ghdl/milestone/3?closed=1>`__
   ===========================================================================================

   15.08.2017 - `GHDL 0.34 was released <https://github.com/ghdl/ghdl/milestone/1?closed=1>`__
   ===========================================================================================

   23.10.2015 - GHDL 0.33 was released
   ===================================

.. only:: latex

   .. rubric:: 02.02.2021 - GHDL v1.0 was released.

   .. rubric:: 31.01.2021 - GHDL v1.0.0rc1 was tagged.

   .. rubric:: 21.05.2020 - Nightly build assets available.

   .. rubric:: 09.05.2020 - New repositories and a wiki were created.

   .. rubric:: 28.02.2020 - GHDL v0.37 was released.

   .. rubric:: 03.03.2019 - GHDL v0.36 was released.

   .. rubric:: 23.02.2019 - GHDL v0.36-rc1 was released.

   .. rubric:: 29.11.2018 - GHDL 20181129 was released.

   .. rubric:: 20.12.2017 - A new GitHub organization was created.

   .. rubric:: 14.12.2017 - GHDL 0.35 was released.

   .. rubric:: 15.08.2017 - GHDL 0.34 was released.

   .. rubric:: 23.10.2015 - GHDL 0.33 was released.

.. include:: toc.rst