Netdev List
 help / color / mirror / Atom feed
* [PATCH v2] packet: uses kfree_skb() for drops or errors.
From: Weongyo Jeong @ 2016-04-06 21:14 UTC (permalink / raw)
  To: netdev; +Cc: Weongyo Jeong, David S. Miller, Willem de Bruijn

consume_skb() isn't for drop or error cases that  kfree_skb() is more proper
one.  At this patch, it fixed tpacket_rcv() and packet_rcv() to be
consistent for error or non-error cases letting perf trace its event
properly.

Signed-off-by: Weongyo Jeong <weongyo.linux@gmail.com>
---
 net/packet/af_packet.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1ecfa71..cd100cf 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2040,7 +2040,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
 	struct sockaddr_ll *sll;
 	struct packet_sock *po;
 	u8 *skb_head = skb->data;
-	int skb_len = skb->len;
+	int err = 0, skb_len = skb->len;
 	unsigned int snaplen, res;
 
 	if (skb->pkt_type == PACKET_LOOPBACK)
@@ -2130,6 +2130,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
 	return 0;
 
 drop_n_acct:
+	err = -1;
 	spin_lock(&sk->sk_receive_queue.lock);
 	po->stats.stats1.tp_drops++;
 	atomic_inc(&sk->sk_drops);
@@ -2141,7 +2142,10 @@ drop_n_restore:
 		skb->len = skb_len;
 	}
 drop:
-	consume_skb(skb);
+	if (!err)
+		consume_skb(skb);
+	else
+		kfree_skb(skb);
 	return 0;
 }
 
@@ -2153,7 +2157,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
 	struct sockaddr_ll *sll;
 	union tpacket_uhdr h;
 	u8 *skb_head = skb->data;
-	int skb_len = skb->len;
+	int err = 0, skb_len = skb->len;
 	unsigned int snaplen, res;
 	unsigned long status = TP_STATUS_USER;
 	unsigned short macoff, netoff, hdrlen;
@@ -2367,10 +2371,14 @@ drop_n_restore:
 		skb->len = skb_len;
 	}
 drop:
-	kfree_skb(skb);
+	if (!err)
+		consume_skb(skb);
+	else
+		kfree_skb(skb);
 	return 0;
 
 drop_n_account:
+	err = -1;
 	po->stats.stats1.tp_drops++;
 	spin_unlock(&sk->sk_receive_queue.lock);
 
-- 
2.1.3

^ permalink raw reply related

* Re: [net-next 00/14][pull request] 40GbE Intel Wired LAN Driver Updates 2016-04-05
From: David Miller @ 2016-04-06 21:04 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, john.ronciak
In-Reply-To: <1459913769-56510-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue,  5 Apr 2016 20:35:55 -0700

> This series contains updates to i40e and i40evf only.

Pulled, thanks Jeff.

^ permalink raw reply

* Re: [PATCH] macvlan: Support interface operstate properly
From: Nikolay Aleksandrov @ 2016-04-06 21:03 UTC (permalink / raw)
  To: Debabrata Banerjee, Patrick McHardy, netdev
In-Reply-To: <1459974608-25324-1-git-send-email-dbanerje@akamai.com>

On 04/06/2016 10:30 PM, Debabrata Banerjee wrote:
> Set appropriate macvlan interface status based on lower device and our
> status. Can be up, down, or lowerlayerdown.
> 
> Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
> 

May I ask what is exactly that you're fixing here ? I recently had to make macvlan's
operstates more accurate and I haven't experienced any wrong behaviour since commit
de7d244d0a35 ("macvlan: make operstate and carrier more accurate").
Also it's the linkwatch's job to take care for the proper operstate, we can use
netif_stacked_transfer_operstate to help it, but I don't think directly setting
operstate is a good idea.

One more thing - you cannot use netdev_state_change() under the write_lock as it
may sleep.

^ permalink raw reply

* Re: [PATCH net-next] net: add the AF_KCM entries to family name tables
From: David Miller @ 2016-04-06 20:59 UTC (permalink / raw)
  To: decui; +Cc: netdev
In-Reply-To: <1459867271-14592-1-git-send-email-decui@microsoft.com>

From: Dexuan Cui <decui@microsoft.com>
Date: Tue,  5 Apr 2016 07:41:11 -0700

> This is for the recent kcm driver, which introduces AF_KCM(41) in
> b7ac4eb(kcm: Kernel Connection Multiplexor module).
> 
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Cc: Signed-off-by: Tom Herbert <tom@herbertland.com>

As this is a bug fix actually, applied to 'net'.

^ permalink raw reply

* Re: [PATCH net] MAINTAINERS: intel-wired-lan list is moderated
From: David Miller @ 2016-04-06 20:56 UTC (permalink / raw)
  To: jbenc
  Cc: netdev, jeffrey.t.kirsher, jesse.brandeburg, shannon.nelson,
	carolyn.wyborny, donald.c.skidmore, bruce.w.allan, john.ronciak,
	mitch.a.williams
In-Reply-To: <f06d4636c53b68b5368bfc817511d36a13c4dc8b.1459867159.git.jbenc@redhat.com>

From: Jiri Benc <jbenc@redhat.com>
Date: Tue,  5 Apr 2016 16:39:37 +0200

> I got the following message:
> 
>> Your mail to 'Intel-wired-lan' with the subject
>>
>>     [PATCH net-next] net: intel: remove dead links
>>
>> Is being held until the list moderator can review it for approval.
>>
>> The reason it is being held:
>>
>>     Post by non-member to a members-only list
> 
> Mark the list as moderated.
> 
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
> ---

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] net: intel: remove dead links
From: David Miller @ 2016-04-06 20:54 UTC (permalink / raw)
  To: jbenc
  Cc: netdev, jeffrey.t.kirsher, jesse.brandeburg, shannon.nelson,
	carolyn.wyborny, donald.c.skidmore, bruce.w.allan, john.ronciak,
	mitch.a.williams, intel-wired-lan
In-Reply-To: <3c9f8ea384ba033f83ec360eef17732ff0a5a8dd.1459866280.git.jbenc@redhat.com>

From: Jiri Benc <jbenc@redhat.com>
Date: Tue,  5 Apr 2016 16:25:07 +0200

> The Kconfig for Intel NICs references two different URLs for the "Adapter
> & Driver ID Guide". Neither of those two links works. The current URL seems
> to be
> http://www.intel.com/content/www/us/en/support/network-and-i-o/ethernet-products/000005584.html
> but given it's apparently constantly changing, there's no point in having it
> in the help text.
> 
> Just keep a generic pointer to http://support.intel.com. Hopefully, this one
> will have a longer live. It still works, at least.
> 
> Futhermore, remove a link to "the latest Intel PRO/100 network driver for
> Linux", this has no place in the mainline kernel and the latest Linux driver
> it offers is from 2006, anyway.
> 
> Signed-off-by: Jiri Benc <jbenc@redhat.com>

I expect Jeff to pull this into his tree, thanks.

^ permalink raw reply

* Re: [PATCH net-next v3 0/4] vxlan: implement Generic Protocol Extension (GPE)
From: David Miller @ 2016-04-06 20:50 UTC (permalink / raw)
  To: jbenc; +Cc: netdev, tom, jesse
In-Reply-To: <cover.1459860270.git.jbenc@redhat.com>

From: Jiri Benc <jbenc@redhat.com>
Date: Tue,  5 Apr 2016 14:47:09 +0200

> v3: just rebased on top of the current net-next, no changes
> 
> This patchset implements VXLAN-GPE. It follows the same model as the tun/tap
> driver: depending on the chosen mode, the vxlan interface is created either
> as ARPHRD_ETHER (non-GPE) or ARPHRD_NONE (GPE).
> 
> Note that the internal fdb control plane cannot be used together with
> VXLAN-GPE and attempt to configure it will be rejected by the driver. In
> fact, COLLECT_METADATA is required to be set for now. This can be relaxed in
> the future by adding support for static PtP configuration; it will be
> backward compatible and won't affect existing users.
> 
> The previous version of the patchset supported two GPE modes, L2 and L3. The
> L2 mode (now called "ether mode" in the code) was removed from this version.
> It can be easily added later if there's demand. The L3 mode is now called
> "raw mode" and supports also encapsulated Ethernet headers (via ETH_P_TEB).
> 
> The only limitation of not having "ether mode" for GPE is for ip route based
> encapsulation: with such setup, only IP packets can be encapsulated. Meaning
> no Ethernet encapsulation. It seems there's not much use for this, though.
> If it turns out to be useful, we'll add it.

Series applied, thanks Jiri.

^ permalink raw reply

* Re: [PATCH net 4/4] lib/test_bpf: Add additional BPF_ADD tests
From: David Miller @ 2016-04-06 20:48 UTC (permalink / raw)
  To: naveen.n.rao
  Cc: linux-kernel, linuxppc-dev, netdev, ast, daniel, ananth, mpe,
	paulus
In-Reply-To: <9b71e280481a9f84cd7dbb9e767fd08e6f4c0aef.1459850410.git.naveen.n.rao@linux.vnet.ibm.com>

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date: Tue,  5 Apr 2016 15:32:56 +0530

> Some of these tests proved useful with the powerpc eBPF JIT port due to
> sign-extended 16-bit immediate loads. Though some of these aspects get
> covered in other tests, it is better to have explicit tests so as to
> quickly tag the precise problem.
> 
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH net 3/4] lib/test_bpf: Add test to check for result of 32-bit add that overflows
From: David Miller @ 2016-04-06 20:48 UTC (permalink / raw)
  To: naveen.n.rao
  Cc: linux-kernel, linuxppc-dev, netdev, ast, daniel, ananth, mpe,
	paulus
In-Reply-To: <9c799e59e71c022271c6287769d45a32f29de4bd.1459850410.git.naveen.n.rao@linux.vnet.ibm.com>

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date: Tue,  5 Apr 2016 15:32:55 +0530

> BPF_ALU32 and BPF_ALU64 tests for adding two 32-bit values that results in
> 32-bit overflow.
> 
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH net 2/4] lib/test_bpf: Add tests for unsigned BPF_JGT
From: David Miller @ 2016-04-06 20:48 UTC (permalink / raw)
  To: naveen.n.rao
  Cc: linux-kernel, linuxppc-dev, netdev, ast, daniel, ananth, mpe,
	paulus
In-Reply-To: <6b946d54d20d96052ce4f4baec308cdb20ace39a.1459850410.git.naveen.n.rao@linux.vnet.ibm.com>

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date: Tue,  5 Apr 2016 15:32:54 +0530

> Unsigned Jump-if-Greater-Than.
> 
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH net 1/4] lib/test_bpf: Fix JMP_JSET tests
From: David Miller @ 2016-04-06 20:48 UTC (permalink / raw)
  To: naveen.n.rao
  Cc: linux-kernel, linuxppc-dev, netdev, ast, daniel, ananth, mpe,
	paulus
In-Reply-To: <5e3cf7c4a971e6d2ff7a2d50bbec2e6e26883b84.1459850410.git.naveen.n.rao@linux.vnet.ibm.com>

From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date: Tue,  5 Apr 2016 15:32:53 +0530

> JMP_JSET tests incorrectly used BPF_JNE. Fix the same.
> 
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied.

^ permalink raw reply

* Re: [PATCH (net.git)] stmmac: fix adjust link call in case of a switch is attached
From: David Miller @ 2016-04-06 20:35 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev, alexandre.torgue
In-Reply-To: <1459838817-24905-1-git-send-email-peppe.cavallaro@st.com>

From: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Date: Tue, 5 Apr 2016 08:46:57 +0200

> While initializing the phy, the stmmac driver sets the
> PHY_IGNORE_INTERRUPT so the PAL won't call the adjust hook
> that is needed, on some platforms, e.g. STi, to invoke the glue.
> 
> The patch allows the PAL to poll the stmmac_adjust_link just one time
> in case of a switch is attached, setting later the PHY_IGNORE_INTERRUPT
> flag.
> Moving this kind of logic inside the adjust_link it makes sense to
> anticipate the check for EEE that will never initialized in this
> scenario.
> 
> Reported-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Tested-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> Cc: Alexandre TORGUE <alexandre.torgue@st.com>

Applied, thank you.

^ permalink raw reply

* [PATCH] macvlan: Support interface operstate properly
From: Debabrata Banerjee @ 2016-04-06 20:30 UTC (permalink / raw)
  To: Patrick McHardy, netdev; +Cc: linux-kernel, Debabrata Banerjee

Set appropriate macvlan interface status based on lower device and our
status. Can be up, down, or lowerlayerdown.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 2bcf1f3..0f4b000 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -91,6 +91,7 @@ static struct macvlan_port *macvlan_port_get_rtnl(const struct net_device *dev)
 }
 
 #define macvlan_port_exists(dev) (dev->priv_flags & IFF_MACVLAN_PORT)
+#define is_macvlan(dev) (dev->priv_flags & IFF_MACVLAN)
 
 static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port,
 					       const unsigned char *addr)
@@ -1242,6 +1243,26 @@ static int macvlan_changelink_sources(struct macvlan_dev *vlan, u32 mode,
 	return 0;
 }
 
+static void macvlan_set_operstate(struct net_device *lowerdev,
+				  struct net_device *dev)
+{
+	unsigned char newstate = dev->operstate;
+
+	if (!(dev->flags & IFF_UP))
+		newstate = IF_OPER_DOWN;
+	else if ((lowerdev->flags & IFF_UP) && netif_oper_up(lowerdev))
+		newstate = IF_OPER_UP;
+	else
+		newstate = IF_OPER_LOWERLAYERDOWN;
+
+	if (dev->operstate != newstate) {
+		write_lock_bh(&dev_base_lock);
+		dev->operstate = newstate;
+		netdev_state_change(dev);
+		write_unlock_bh(&dev_base_lock);
+	}
+}
+
 int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
 			   struct nlattr *tb[], struct nlattr *data[])
 {
@@ -1324,6 +1345,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
 
 	list_add_tail_rcu(&vlan->list, &port->vlans);
 	netif_stacked_transfer_operstate(lowerdev, dev);
+	macvlan_set_operstate(lowerdev, dev);
 	linkwatch_fire_event(dev);
 
 	return 0;
@@ -1518,17 +1540,36 @@ static int macvlan_device_event(struct notifier_block *unused,
 	struct macvlan_port *port;
 	LIST_HEAD(list_kill);
 
-	if (!macvlan_port_exists(dev))
+	if (!macvlan_port_exists(dev) && !is_macvlan(dev))
 		return NOTIFY_DONE;
 
+	if (is_macvlan(dev)) {
+		vlan = netdev_priv(dev);
+
+		switch (event) {
+		case NETDEV_UP:
+		case NETDEV_DOWN:
+		case NETDEV_CHANGE:
+			netif_stacked_transfer_operstate(vlan->lowerdev,
+							 vlan->dev);
+			macvlan_set_operstate(vlan->lowerdev, vlan->dev);
+			break;
+		}
+
+		return NOTIFY_DONE;
+	}
+
 	port = macvlan_port_get_rtnl(dev);
 
 	switch (event) {
 	case NETDEV_UP:
+	case NETDEV_DOWN:
 	case NETDEV_CHANGE:
-		list_for_each_entry(vlan, &port->vlans, list)
+		list_for_each_entry(vlan, &port->vlans, list) {
 			netif_stacked_transfer_operstate(vlan->lowerdev,
 							 vlan->dev);
+			macvlan_set_operstate(vlan->lowerdev, vlan->dev);
+		}
 		break;
 	case NETDEV_FEAT_CHANGE:
 		list_for_each_entry(vlan, &port->vlans, list) {
-- 
2.8.0

^ permalink raw reply related

* Re: [PATCH net-next v2 0/3] net: dsa: voidify STP setter and FDB/VLAN add ops
From: Florian Fainelli @ 2016-04-06 20:27 UTC (permalink / raw)
  To: Vivien Didelot
  Cc: netdev, linux-kernel@vger.kernel.org, kernel, David S. Miller,
	Andrew Lunn, Jiri Pirko, Scott Feldman
In-Reply-To: <1459958105-1090-1-git-send-email-vivien.didelot@savoirfairelinux.com>

2016-04-06 8:55 GMT-07:00 Vivien Didelot <vivien.didelot@savoirfairelinux.com>:
> Neither the DSA layer nor the bridge code (see br_set_state) really care
> about eventual errors from STP state setters, so make it void.
>
> The DSA layer separates the prepare and commit phases of switchdev in
> two different functions. Logical errors must not happen in commit
> routines, so make them void.
>
> Changes v1 -> v2:
>   - rename port_stp_update to port_stp_state_set
>   - don't change code flow of bcm_sf2_sw_br_set_stp_state
>   - prefer netdev_err over netdev_warn
>
> Vivien Didelot (3):
>   net: dsa: make the STP state function return void
>   net: dsa: make the FDB add function return void
>   net: dsa: make the VLAN add function return void

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

^ permalink raw reply

* Re: [PATCH net-next] net: bcmgenet: add BQL support
From: Florian Fainelli @ 2016-04-06 20:25 UTC (permalink / raw)
  To: Petri Gynther; +Cc: netdev, David Miller, opendmb, Jaedon Shin
In-Reply-To: <1459903801-83727-1-git-send-email-pgynther@google.com>

2016-04-05 17:50 GMT-07:00 Petri Gynther <pgynther@google.com>:
> Add Byte Queue Limits (BQL) support to bcmgenet driver.
>
> Signed-off-by: Petri Gynther <pgynther@google.com>

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks!
-- 
Florian

^ permalink raw reply

* [PATCH 1/3] bonding: do not allow rlb updates to invalid mac
From: Debabrata Banerjee @ 2016-04-06 20:24 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, netdev
  Cc: linux-kernel, Debabrata Banerjee

Make sure multicast, broadcast, and zero mac's cannot be the output of rlb
updates, which should all be directed arps. Receive load balancing will be
collapsed if any of these happen, as the switch will broadcast.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index c5ac160..1b45378 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -453,7 +453,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
 {
 	int i;
 
-	if (!client_info->slave)
+	if (!client_info->slave || !is_valid_ether_addr(client_info->mac_dst))
 		return;
 
 	for (i = 0; i < RLB_ARP_BURST_SIZE; i++) {
-- 
2.8.0

^ permalink raw reply related

* [PATCH 3/3] bonding: use common broadcast addr checks
From: Debabrata Banerjee @ 2016-04-06 20:24 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, netdev
  Cc: linux-kernel, Debabrata Banerjee
In-Reply-To: <1459974275-24944-1-git-send-email-dbanerje@akamai.com>

Replace homegrown broadcast checks with faster defs from etherdevice.h

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b7c7027..27238f3 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -45,9 +45,6 @@
 #ifndef __long_aligned
 #define __long_aligned __attribute__((aligned((sizeof(long)))))
 #endif
-static const u8 mac_bcast[ETH_ALEN] __long_aligned = {
-	0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-};
 static const u8 mac_v6_allmcast[ETH_ALEN] __long_aligned = {
 	0x33, 0x33, 0x00, 0x00, 0x00, 0x01
 };
@@ -423,8 +420,8 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
 
 			if (assigned_slave) {
 				rx_hash_table[index].slave = assigned_slave;
-				if (!ether_addr_equal_64bits(rx_hash_table[index].mac_dst,
-							     mac_bcast) &&
+
+				if (!is_broadcast_ether_addr(rx_hash_table[index].mac_dst) &&
 				    !is_zero_ether_addr(rx_hash_table[index].mac_dst)) {
 					bond_info->rx_hashtbl[index].ntt = 1;
 					bond_info->rx_ntt = 1;
@@ -528,7 +525,7 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
 
 		if ((client_info->slave == slave) &&
-		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		    !is_broadcast_ether_addr(client_info->mac_dst) &&
 		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			ntt = 1;
@@ -570,7 +567,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
 		if ((client_info->ip_src == src_ip) &&
 		    !ether_addr_equal_64bits(client_info->slave->dev->dev_addr,
 					     bond->dev->dev_addr) &&
-		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		    !is_broadcast_ether_addr(client_info->mac_dst) &&
 		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			bond_info->rx_ntt = 1;
@@ -599,7 +596,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
 		if ((client_info->ip_src == arp->ip_src) &&
 		    (client_info->ip_dst == arp->ip_dst)) {
 			/* the entry is already assigned to this client */
-			if (!ether_addr_equal_64bits(arp->mac_dst, mac_bcast)) {
+			if (!is_broadcast_ether_addr(arp->mac_dst)) {
 				/* update mac address from arp */
 				ether_addr_copy(client_info->mac_dst, arp->mac_dst);
 			}
@@ -647,7 +644,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
 		ether_addr_copy(client_info->mac_src, arp->mac_src);
 		client_info->slave = assigned_slave;
 
-		if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		if (!is_broadcast_ether_addr(client_info->mac_dst) &&
 		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			bond->alb_info.rx_ntt = 1;
@@ -1386,7 +1383,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
 	case ETH_P_IP: {
 		const struct iphdr *iph = ip_hdr(skb);
 
-		if (ether_addr_equal_64bits(eth_data->h_dest, mac_bcast) ||
+		if (is_broadcast_ether_addr(eth_data->h_dest) ||
 		    (iph->daddr == ip_bcast) ||
 		    (iph->protocol == IPPROTO_IGMP)) {
 			do_tx_balance = false;
@@ -1400,7 +1397,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
 		/* IPv6 doesn't really use broadcast mac address, but leave
 		 * that here just in case.
 		 */
-		if (ether_addr_equal_64bits(eth_data->h_dest, mac_bcast)) {
+		if (is_broadcast_ether_addr(eth_data->h_dest)) {
 			do_tx_balance = false;
 			break;
 		}
-- 
2.8.0

^ permalink raw reply related

* [PATCH 2/3] bonding: don't request extraneous rlb updates
From: Debabrata Banerjee @ 2016-04-06 20:24 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, netdev
  Cc: linux-kernel, Debabrata Banerjee
In-Reply-To: <1459974275-24944-1-git-send-email-dbanerje@akamai.com>

Don't attempt to send rlb updates for incomplete entries, which can't be
sent anyway.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 1b45378..b7c7027 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -424,7 +424,8 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
 			if (assigned_slave) {
 				rx_hash_table[index].slave = assigned_slave;
 				if (!ether_addr_equal_64bits(rx_hash_table[index].mac_dst,
-							     mac_bcast)) {
+							     mac_bcast) &&
+				    !is_zero_ether_addr(rx_hash_table[index].mac_dst)) {
 					bond_info->rx_hashtbl[index].ntt = 1;
 					bond_info->rx_ntt = 1;
 					/* A slave has been removed from the
@@ -527,7 +528,8 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla
 		client_info = &(bond_info->rx_hashtbl[hash_index]);
 
 		if ((client_info->slave == slave) &&
-		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) {
+		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			ntt = 1;
 		}
@@ -568,7 +570,8 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
 		if ((client_info->ip_src == src_ip) &&
 		    !ether_addr_equal_64bits(client_info->slave->dev->dev_addr,
 					     bond->dev->dev_addr) &&
-		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) {
+		    !ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			bond_info->rx_ntt = 1;
 		}
@@ -644,7 +647,8 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
 		ether_addr_copy(client_info->mac_src, arp->mac_src);
 		client_info->slave = assigned_slave;
 
-		if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) {
+		if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast) &&
+		    !is_zero_ether_addr(client_info->mac_dst)) {
 			client_info->ntt = 1;
 			bond->alb_info.rx_ntt = 1;
 		} else {
@@ -735,8 +739,10 @@ static void rlb_rebalance(struct bonding *bond)
 		assigned_slave = __rlb_next_rx_slave(bond);
 		if (assigned_slave && (client_info->slave != assigned_slave)) {
 			client_info->slave = assigned_slave;
-			client_info->ntt = 1;
-			ntt = 1;
+			if (!is_zero_ether_addr(client_info->mac_dst)) {
+				client_info->ntt = 1;
+				ntt = 1;
+			}
 		}
 	}
 
-- 
2.8.0

^ permalink raw reply related

* Re: [PATCH net-next 0/7] sctp: support sctp_diag in kernel
From: David Miller @ 2016-04-06 20:13 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, vyasevich, daniel
In-Reply-To: <cover.1459829123.git.lucien.xin@gmail.com>

From: Xin Long <lucien.xin@gmail.com>
Date: Tue,  5 Apr 2016 12:06:25 +0800

> This patchset will add sctp_diag module to implement diag interface on
> sctp in kernel.
 ...

This series looks generally fine to me, but I'd like to see some review from
SCTP experts before I apply this series.

Thanks.

^ permalink raw reply

* Re: [PATCHv2 net-next 3/6] bridge: simplify the stp_state_store by calling store_bridge_parm
From: David Miller @ 2016-04-06 20:10 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: lucien.xin, nikolay, netdev, bridge
In-Reply-To: <5703483D.80109@lab.ntt.co.jp>

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Tue, 5 Apr 2016 14:08:13 +0900

> On 2016/04/05 12:32, Xin Long wrote:
>> There are some repetitive codes in stp_state_store, we can remove
>> them by calling store_bridge_parm.
>> 
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>>  net/bridge/br_sysfs_br.c | 24 +++++++-----------------
>>  1 file changed, 7 insertions(+), 17 deletions(-)
>> 
>> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
>> index 137cd3b..9918763 100644
>> --- a/net/bridge/br_sysfs_br.c
>> +++ b/net/bridge/br_sysfs_br.c
>> @@ -128,27 +128,17 @@ static ssize_t stp_state_show(struct device *d,
>>  }
>>  
>>  
>> +static int set_stp_state(struct net_bridge *br, unsigned long val)
>> +{
> 
> You forgot to add rtnl lock here?
> The missing lock is restored in patch 4, but at this point bisect could
> break..

Agreed, this has to be fixed.

^ permalink raw reply

* Re: [PATCH net-next 3/3] net: bcmgenet: fix dmadesc_set()
From: David Miller @ 2016-04-06 20:09 UTC (permalink / raw)
  To: pgynther; +Cc: netdev, f.fainelli, jaedon.shin
In-Reply-To: <1459815001-91703-3-git-send-email-pgynther@google.com>

From: Petri Gynther <pgynther@google.com>
Date: Mon,  4 Apr 2016 17:10:01 -0700

> dmadesc_set() is used for setting the Tx buffer DMA address, length,
> and status bits on a Tx ring descriptor when a frame is being Tx'ed.
> 
> Always set the Tx buffer DMA address first, before updating the length
> and status bits, i.e. giving the Tx descriptor to the hardware.
> 
> Signed-off-by: Petri Gynther <pgynther@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 2/3] net: bcmgenet: cleanup for bcmgenet_xmit_frag()
From: David Miller @ 2016-04-06 20:09 UTC (permalink / raw)
  To: pgynther; +Cc: netdev, f.fainelli, jaedon.shin
In-Reply-To: <1459815001-91703-2-git-send-email-pgynther@google.com>

From: Petri Gynther <pgynther@google.com>
Date: Mon,  4 Apr 2016 17:10:00 -0700

> Add frag_size = skb_frag_size(frag) and use it when needed.
> 
> Signed-off-by: Petri Gynther <pgynther@google.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 1/3] net: bcmgenet: cleanup for bcmgenet_xmit()
From: David Miller @ 2016-04-06 20:09 UTC (permalink / raw)
  To: pgynther; +Cc: netdev, f.fainelli, jaedon.shin
In-Reply-To: <1459815001-91703-1-git-send-email-pgynther@google.com>

From: Petri Gynther <pgynther@google.com>
Date: Mon,  4 Apr 2016 17:09:59 -0700

> 1. Readability: Move nr_frags assignment a few lines down in order
>    to bundle index -> ring -> txq calculations together.
> 2. Readability: Add parentheses around nr_frags + 1.
> 3. Minor fix: Stop the Tx queue and throw the error message only if
>    the Tx queue hasn't already been stopped.
> 
> Signed-off-by: Petri Gynther <pgynther@google.com>

Applied.

^ permalink raw reply

* Re: [RFC PATCH 0/2] selinux: avoid nf hooks overhead when not needed
From: Paul Moore @ 2016-04-06 20:07 UTC (permalink / raw)
  To: David Miller
  Cc: pabeni, linux-security-module, James Morris, agruenba,
	Stephen Smalley, fw, netdev, selinux
In-Reply-To: <20160406.153955.2244652846180310527.davem@davemloft.net>

On Wed, Apr 6, 2016 at 3:39 PM, David Miller <davem@davemloft.net> wrote:
> From: Paul Moore <paul@paul-moore.com>
> Date: Wed, 6 Apr 2016 14:36:43 -0400
>
>> On Wed, Apr 6, 2016 at 2:23 PM, David Miller <davem@davemloft.net> wrote:
>>> From: Paul Moore <paul@paul-moore.com>
>>> Date: Wed, 6 Apr 2016 10:07:27 -0400
>>>
>>>> "While marking the LSM hook structure doesn't directly affect the
>>>> SELinux netfilter hooks, once we remove the ability to deregister the
>>>> LSM hooks we will have no need to support deregistering netfilter
>>>> hooks and I expect we will drop that functionality as well to help
>>>> decrease the risk of tampering."
>>>
>>> This is not a reasonable postiion.
>>>
>>> The performance implications are non-trivial for using netfilter hooks
>>> when they aren't actually needed.
>>
>> With all due respect, I think you've taken what I consider to be some
>> unreasonable positions when it comes to the network stack and LSMs in
>> the past.  We have different perspectives and different priorities as
>> a result, from my perspective the security advantage gained by
>> eliminating the ability to disable SELinux at runtime is more
>> important.
>
> SELinux folks seem to get rather upset to people outright disabling
> the facility, but many users still do exactly that.

My opinion is that SELinux isn't for everyone; I think it would be
great if everyone enabled it, but I recognize that it isn't the best
fit for everyone's needs.  If users want to disable it in order to
better meet their needs, who am I to argue?

Or perhaps I should be upset?  I dunno, please tell me how I should
feel.  Like most people, I *love* when I'm told how I should react.

> In my opinion, it's uncompromising positions like the one you are
> having here is part of the reason that issue will continue.

Once again, I suspect this all a matter of perspective; from my point
of view the SELinux code has compromised quite a lot, especially in
the case of the networking controls.

> It is not AND, it's an OR, people want choice, and if you don't give
> it to them they will find a way to achieve what they want with or
> without your help.  And you might not like what they come up with.
>
> If distributions are turning SELinux on by default, then we have to
> care about whather netfilter performance should suffer for facilities
> which are unused.

I think you've made your point known, and I believe I've been clear
about the reasoning behind my decision as well.  I would suggest we
leave it at that until/unless someone has something constructive to
add to the conversation.

-- 
paul moore
www.paul-moore.com

^ permalink raw reply

* Re: af_packet: tone down the Tx-ring unsupported spew.
From: David Miller @ 2016-04-06 20:05 UTC (permalink / raw)
  To: davej; +Cc: netdev
In-Reply-To: <20160404191150.GA7224@codemonkey.org.uk>

From: Dave Jones <davej@codemonkey.org.uk>
Date: Mon, 4 Apr 2016 15:11:50 -0400

> Trinity and other fuzzers can hit this WARN on far too easily,
> resulting in a tainted kernel that hinders automated fuzzing.
> 
> Replace it with a rate-limited printk.
> 
> Signed-off-by: Dave Jones <davej@codemonkey.org.uk>

Looks good, thanks Dave.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox