* [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT
@ 2020-02-20 8:00 Julian Wiedmann
2020-02-20 8:22 ` Nikolay Aleksandrov
2020-02-20 18:10 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Julian Wiedmann @ 2020-02-20 8:00 UTC (permalink / raw)
To: David Miller
Cc: netdev, Julian Wiedmann, Johannes Berg, Roopa Prabhu,
Nikolay Aleksandrov
Trivial cleanup, so that all bridge port-specific code can be found in
one go.
CC: Johannes Berg <johannes@sipsolutions.net>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
---
drivers/net/bonding/bond_main.c | 2 +-
drivers/net/ethernet/micrel/ksz884x.c | 2 +-
net/core/rtnetlink.c | 12 ++++++------
net/wireless/nl80211.c | 2 +-
net/wireless/util.c | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 48d5ec770b94..c3c524f77fcd 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1265,7 +1265,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
skb->dev = bond->dev;
if (BOND_MODE(bond) == BOND_MODE_ALB &&
- bond->dev->priv_flags & IFF_BRIDGE_PORT &&
+ netif_is_bridge_port(bond->dev) &&
skb->pkt_type == PACKET_HOST) {
if (unlikely(skb_cow_head(skb,
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index d1444ba36e10..4fe6aedca22f 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -5694,7 +5694,7 @@ static void dev_set_promiscuous(struct net_device *dev, struct dev_priv *priv,
* from the bridge.
*/
if ((hw->features & STP_SUPPORT) && !promiscuous &&
- (dev->priv_flags & IFF_BRIDGE_PORT)) {
+ netif_is_bridge_port(dev)) {
struct ksz_switch *sw = hw->ksz_switch;
int port = priv->port.first_port;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 9b4f8a254a15..6e35742969e6 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3911,7 +3911,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
/* Support fdb on master device the net/bridge default case */
if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
- (dev->priv_flags & IFF_BRIDGE_PORT)) {
+ netif_is_bridge_port(dev)) {
struct net_device *br_dev = netdev_master_upper_dev_get(dev);
const struct net_device_ops *ops = br_dev->netdev_ops;
@@ -4022,7 +4022,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
/* Support fdb on master device the net/bridge default case */
if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
- (dev->priv_flags & IFF_BRIDGE_PORT)) {
+ netif_is_bridge_port(dev)) {
struct net_device *br_dev = netdev_master_upper_dev_get(dev);
const struct net_device_ops *ops = br_dev->netdev_ops;
@@ -4248,13 +4248,13 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
continue;
if (!br_idx) { /* user did not specify a specific bridge */
- if (dev->priv_flags & IFF_BRIDGE_PORT) {
+ if (netif_is_bridge_port(dev)) {
br_dev = netdev_master_upper_dev_get(dev);
cops = br_dev->netdev_ops;
}
} else {
if (dev != br_dev &&
- !(dev->priv_flags & IFF_BRIDGE_PORT))
+ !netif_is_bridge_port(dev))
continue;
if (br_dev != netdev_master_upper_dev_get(dev) &&
@@ -4266,7 +4266,7 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (idx < s_idx)
goto cont;
- if (dev->priv_flags & IFF_BRIDGE_PORT) {
+ if (netif_is_bridge_port(dev)) {
if (cops && cops->ndo_fdb_dump) {
err = cops->ndo_fdb_dump(skb, cb,
br_dev, dev,
@@ -4416,7 +4416,7 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
if (dev) {
if (!ndm_flags || (ndm_flags & NTF_MASTER)) {
- if (!(dev->priv_flags & IFF_BRIDGE_PORT)) {
+ if (!netif_is_bridge_port(dev)) {
NL_SET_ERR_MSG(extack, "Device is not a bridge port");
return -EINVAL;
}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f0112dabe21e..8c2a246099ef 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3531,7 +3531,7 @@ static int nl80211_valid_4addr(struct cfg80211_registered_device *rdev,
enum nl80211_iftype iftype)
{
if (!use_4addr) {
- if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT))
+ if (netdev && netif_is_bridge_port(netdev))
return -EBUSY;
return 0;
}
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 8481e9ac33da..80fb47c43bdd 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -934,7 +934,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
return -EOPNOTSUPP;
/* if it's part of a bridge, reject changing type to station/ibss */
- if ((dev->priv_flags & IFF_BRIDGE_PORT) &&
+ if (netif_is_bridge_port(dev) &&
(ntype == NL80211_IFTYPE_ADHOC ||
ntype == NL80211_IFTYPE_STATION ||
ntype == NL80211_IFTYPE_P2P_CLIENT))
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT
2020-02-20 8:00 [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT Julian Wiedmann
@ 2020-02-20 8:22 ` Nikolay Aleksandrov
2020-02-20 18:10 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2020-02-20 8:22 UTC (permalink / raw)
To: Julian Wiedmann, David Miller; +Cc: netdev, Johannes Berg, Roopa Prabhu
On 20/02/2020 10:00, Julian Wiedmann wrote:
> Trivial cleanup, so that all bridge port-specific code can be found in
> one go.
>
> CC: Johannes Berg <johannes@sipsolutions.net>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
> ---
> drivers/net/bonding/bond_main.c | 2 +-
> drivers/net/ethernet/micrel/ksz884x.c | 2 +-
> net/core/rtnetlink.c | 12 ++++++------
> net/wireless/nl80211.c | 2 +-
> net/wireless/util.c | 2 +-
> 5 files changed, 10 insertions(+), 10 deletions(-)
>
LGTM,
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 48d5ec770b94..c3c524f77fcd 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1265,7 +1265,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> skb->dev = bond->dev;
>
> if (BOND_MODE(bond) == BOND_MODE_ALB &&
> - bond->dev->priv_flags & IFF_BRIDGE_PORT &&
> + netif_is_bridge_port(bond->dev) &&
> skb->pkt_type == PACKET_HOST) {
>
> if (unlikely(skb_cow_head(skb,
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
> index d1444ba36e10..4fe6aedca22f 100644
> --- a/drivers/net/ethernet/micrel/ksz884x.c
> +++ b/drivers/net/ethernet/micrel/ksz884x.c
> @@ -5694,7 +5694,7 @@ static void dev_set_promiscuous(struct net_device *dev, struct dev_priv *priv,
> * from the bridge.
> */
> if ((hw->features & STP_SUPPORT) && !promiscuous &&
> - (dev->priv_flags & IFF_BRIDGE_PORT)) {
> + netif_is_bridge_port(dev)) {
> struct ksz_switch *sw = hw->ksz_switch;
> int port = priv->port.first_port;
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 9b4f8a254a15..6e35742969e6 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -3911,7 +3911,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
>
> /* Support fdb on master device the net/bridge default case */
> if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
> - (dev->priv_flags & IFF_BRIDGE_PORT)) {
> + netif_is_bridge_port(dev)) {
> struct net_device *br_dev = netdev_master_upper_dev_get(dev);
> const struct net_device_ops *ops = br_dev->netdev_ops;
>
> @@ -4022,7 +4022,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
>
> /* Support fdb on master device the net/bridge default case */
> if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) &&
> - (dev->priv_flags & IFF_BRIDGE_PORT)) {
> + netif_is_bridge_port(dev)) {
> struct net_device *br_dev = netdev_master_upper_dev_get(dev);
> const struct net_device_ops *ops = br_dev->netdev_ops;
>
> @@ -4248,13 +4248,13 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
> continue;
>
> if (!br_idx) { /* user did not specify a specific bridge */
> - if (dev->priv_flags & IFF_BRIDGE_PORT) {
> + if (netif_is_bridge_port(dev)) {
> br_dev = netdev_master_upper_dev_get(dev);
> cops = br_dev->netdev_ops;
> }
> } else {
> if (dev != br_dev &&
> - !(dev->priv_flags & IFF_BRIDGE_PORT))
> + !netif_is_bridge_port(dev))
> continue;
>
> if (br_dev != netdev_master_upper_dev_get(dev) &&
> @@ -4266,7 +4266,7 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
> if (idx < s_idx)
> goto cont;
>
> - if (dev->priv_flags & IFF_BRIDGE_PORT) {
> + if (netif_is_bridge_port(dev)) {
> if (cops && cops->ndo_fdb_dump) {
> err = cops->ndo_fdb_dump(skb, cb,
> br_dev, dev,
> @@ -4416,7 +4416,7 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
>
> if (dev) {
> if (!ndm_flags || (ndm_flags & NTF_MASTER)) {
> - if (!(dev->priv_flags & IFF_BRIDGE_PORT)) {
> + if (!netif_is_bridge_port(dev)) {
> NL_SET_ERR_MSG(extack, "Device is not a bridge port");
> return -EINVAL;
> }
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index f0112dabe21e..8c2a246099ef 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -3531,7 +3531,7 @@ static int nl80211_valid_4addr(struct cfg80211_registered_device *rdev,
> enum nl80211_iftype iftype)
> {
> if (!use_4addr) {
> - if (netdev && (netdev->priv_flags & IFF_BRIDGE_PORT))
> + if (netdev && netif_is_bridge_port(netdev))
> return -EBUSY;
> return 0;
> }
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 8481e9ac33da..80fb47c43bdd 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -934,7 +934,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
> return -EOPNOTSUPP;
>
> /* if it's part of a bridge, reject changing type to station/ibss */
> - if ((dev->priv_flags & IFF_BRIDGE_PORT) &&
> + if (netif_is_bridge_port(dev) &&
> (ntype == NL80211_IFTYPE_ADHOC ||
> ntype == NL80211_IFTYPE_STATION ||
> ntype == NL80211_IFTYPE_P2P_CLIENT))
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT
2020-02-20 8:00 [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT Julian Wiedmann
2020-02-20 8:22 ` Nikolay Aleksandrov
@ 2020-02-20 18:10 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-02-20 18:10 UTC (permalink / raw)
To: jwi; +Cc: netdev, johannes, roopa, nikolay
From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Thu, 20 Feb 2020 09:00:07 +0100
> Trivial cleanup, so that all bridge port-specific code can be found in
> one go.
>
> CC: Johannes Berg <johannes@sipsolutions.net>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-20 18:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-20 8:00 [PATCH net-next] net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORT Julian Wiedmann
2020-02-20 8:22 ` Nikolay Aleksandrov
2020-02-20 18:10 ` David Miller
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.