Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: ipv4: handle DSA enabled master network devices
From: Florian Fainelli @ 2015-01-14 17:52 UTC (permalink / raw)
  To: netdev; +Cc: davem, stephen, kaber, bridge, buytenh, Florian Fainelli
In-Reply-To: <1421257932-11073-1-git-send-email-f.fainelli@gmail.com>

The logic to configure a network interface for kernel IP
auto-configuration is very simplistic, and does not handle the case
where a device is stacked onto another such as with DSA. This causes the
kernel not to open and configure the master network device in a DSA
switch tree, and therefore slave network devices using this master
network devices as conduit device cannot be open.

This restriction comes from a check in net/dsa/slave.c, which is
basically checking the master netdev flags for IFF_UP and returns
-ENETDOWN if it is not the case.

Automatically bringing-up DSA master network devices allows DSA slave
network devices to be used as valid interfaces for e.g: NFS root booting
by allowing kernel IP autoconfiguration to succeed on these interfaces.

On the reverse path, make sure we do not attempt to close a DSA-enabled
device as this would implicitely prevent the slave DSA network device
from operating.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/ipv4/ipconfig.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 7fa18bc7e47f..d10073d2be0f 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -209,9 +209,9 @@ static int __init ic_open_devs(void)
 	last = &ic_first_dev;
 	rtnl_lock();
 
-	/* bring loopback device up first */
+	/* bring loopback an DSA master network devices up first */
 	for_each_netdev(&init_net, dev) {
-		if (!(dev->flags & IFF_LOOPBACK))
+		if (!(dev->flags & IFF_LOOPBACK) && !netdev_uses_dsa(dev))
 			continue;
 		if (dev_change_flags(dev, dev->flags | IFF_UP) < 0)
 			pr_err("IP-Config: Failed to open %s\n", dev->name);
@@ -228,6 +228,7 @@ static int __init ic_open_devs(void)
 			if (!(dev->flags & IFF_NOARP))
 				able |= IC_RARP;
 			able &= ic_proto_enabled;
+
 			if (ic_proto_enabled && !able)
 				continue;
 			oflags = dev->flags;
@@ -306,7 +307,10 @@ static void __init ic_close_devs(void)
 	while ((d = next)) {
 		next = d->next;
 		dev = d->dev;
-		if (dev != ic_dev) {
+		/* Only bring down unused devices and not DSA enabled master
+		 * devices
+		 */
+		if (dev != ic_dev && !netdev_uses_dsa(dev)) {
 			DBG(("IP-Config: Downing %s\n", dev->name));
 			dev_change_flags(dev, d->flags);
 		}
-- 
2.1.0

^ permalink raw reply related

* [PATCH net-next 2/2] net: bridge: reject DSA-enabled master netdevices as bridge members
From: Florian Fainelli @ 2015-01-14 17:52 UTC (permalink / raw)
  To: netdev; +Cc: davem, stephen, kaber, bridge, buytenh, Florian Fainelli
In-Reply-To: <1421257932-11073-1-git-send-email-f.fainelli@gmail.com>

DSA-enabled master network devices with a switch tagging protocol should
strip the protocol specific format before handing the frame over to
higher layer.

When adding such a DSA master network device as a bridge member, we go
through the following code path when receiving a frame:

__netif_receive_skb_core
	-> first ptype check against ptype_all is not returning any
	   handler for this skb

	-> check and invoke rx_handler:
		-> deliver frame to the bridge layer: br_handle_frame

DSA registers a ptype handler with the fake ETH_XDSA ethertype, which is
called *after* the bridge-layer rx_handler has run. br_handle_frame()
tries to parse the frame it received from the DSA master network device,
and will not be able to match any of its conditions and jumps straight
at the end of the end of br_handle_frame() and returns
RX_HANDLER_CONSUMED there.

Since we returned RX_HANDLER_CONSUMED, __netif_receive_skb_core() stops
RX processing for this frame and returns NET_RX_SUCCESS, so we never get
a chance to call our switch tag packet processing logic and deliver
frames to the DSA slave network devices, and so we do not get any
functional bridge members at all.

Instead of cluttering the bridge receive path with DSA-specific checks,
and rely on assumptions about how __netif_receive_skb_core() is
processing frames, we simply deny adding the DSA master network device
(conduit interface) as a bridge member, leaving only the slave DSA
network devices to be bridge members, since those will work correctly in
all circumstances.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/bridge/br_if.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 81e49fb73169..b087d278c679 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -436,10 +436,16 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 	int err = 0;
 	bool changed_addr;
 
-	/* Don't allow bridging non-ethernet like devices */
+	/* Don't allow bridging non-ethernet like devices, or DSA-enabled
+	 * master network devices since the bridge layer rx_handler prevents
+	 * the DSA fake ethertype handler to be invoked, so we do not strip off
+	 * the DSA switch tag protocol header and the bridge layer just return
+	 * RX_HANDLER_CONSUMED, stopping RX processing for these frames.
+	 */
 	if ((dev->flags & IFF_LOOPBACK) ||
 	    dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN ||
-	    !is_valid_ether_addr(dev->dev_addr))
+	    !is_valid_ether_addr(dev->dev_addr) ||
+	    netdev_uses_dsa(dev))
 		return -EINVAL;
 
 	/* No bridging of bridges */
-- 
2.1.0

^ permalink raw reply related

* [PATCH v2 net] be2net: Allow GRE to work concurrently while a VxLAN tunnel is configured
From: Sriharsha Basavapatna @ 2015-01-15 10:38 UTC (permalink / raw)
  To: netdev

Other tunnels like GRE break while VxLAN offloads are enabled in Skyhawk-R. To
avoid this, we should restrict offload features on a per-packet basis in such
conditions.

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
---
v2 changes: fixed minor nits pointed out by Sergei Shtylyov
---
 drivers/net/ethernet/emulex/benet/be_main.c |   41 +++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 41a0a54..d48806b 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4383,8 +4383,9 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
  * distinguish various types of transports (VxLAN, GRE, NVGRE ..). So, offload
  * is expected to work across all types of IP tunnels once exported. Skyhawk
  * supports offloads for either VxLAN or NVGRE, exclusively. So we export VxLAN
- * offloads in hw_enc_features only when a VxLAN port is added. Note this only
- * ensures that other tunnels work fine while VxLAN offloads are not enabled.
+ * offloads in hw_enc_features only when a VxLAN port is added. If other (non
+ * VxLAN) tunnels are configured while VxLAN offloads are enabled, offloads for
+ * those other tunnels are unexported on the fly through ndo_features_check().
  *
  * Skyhawk supports VxLAN offloads only for one UDP dport. So, if the stack
  * adds more than one port, disable offloads and don't re-enable them again
@@ -4463,7 +4464,41 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
 					   struct net_device *dev,
 					   netdev_features_t features)
 {
-	return vxlan_features_check(skb, features);
+	struct be_adapter *adapter = netdev_priv(dev);
+	u8 l4_hdr = 0;
+
+	/* The code below restricts offload features for some tunneled packets.
+	 * Offload features for normal (non tunnel) packets are unchanged.
+	 */
+	if (!skb->encapsulation ||
+	    !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS))
+		return features;
+
+	/* It's an encapsulated packet and VxLAN offloads are enabled. We
+	 * should disable tunnel offload features if it's not a VxLAN packet,
+	 * as tunnel offloads have been enabled only for VxLAN. This is done to
+	 * allow other tunneled traffic like GRE work fine while VxLAN
+	 * offloads are configured in Skyhawk-R.
+	 */
+	switch (vlan_get_protocol(skb)) {
+	case htons(ETH_P_IP):
+		l4_hdr = ip_hdr(skb)->protocol;
+		break;
+	case htons(ETH_P_IPV6):
+		l4_hdr = ipv6_hdr(skb)->nexthdr;
+		break;
+	default:
+		return features;
+	}
+
+	if (l4_hdr != IPPROTO_UDP ||
+	    skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
+	    skb->inner_protocol != htons(ETH_P_TEB) ||
+	    skb_inner_mac_header(skb) - skb_transport_header(skb) !=
+	    sizeof(struct udphdr) + sizeof(struct vxlanhdr))
+		return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
+
+	return features;
 }
 #endif
 
-- 
1.7.9.5

^ permalink raw reply related

* Re: [net-next PATCH v1 00/11] A flow API
From: Thomas Graf @ 2015-01-14 19:02 UTC (permalink / raw)
  To: John Fastabend
  Cc: Jamal Hadi Salim, sfeldma, jiri, simon.horman, netdev, davem,
	andy, Shrijeet Mukherjee
In-Reply-To: <54B01DA2.9090104@gmail.com>

On 01/09/15 at 10:27am, John Fastabend wrote:
> Yes we are providing an interface for userspace to interrogate the
> hardware and program it. My take on this is even if you embed this
> into another netlink family OVS, NFT, TCA you end up with the same
> operations w.r.t. table support (a) query hardware for
> resources/constraints/etc and (b) an API to add/del rules in those
> tables. It seems the intersection of these features with existing
> netlink families is fairly small so I opted to create a new family.
> The underlying hardware offload mechanisms in flow_table.c here could
> be used by in-kernel consumers as well as user space. For some
> consumers 'tc' perhaps this makes good sense for others 'OVS'
> it does not IMO.

+1

> [...]
>
> But in many cases my goal is to unify them in userspace
> where it is easier to make policy decisions. For OVS, NFT it
> seems to me that user space libraries can handle the unification
> of hardware/software dataplanes. Further I think it is the correct
> place to unify the dataplanes. I don't want to encode complex
> policies into the kernel. Even if you embed the netlink UAPI into
> another netlink family the semantics look the same.

I think we want the kernel to remain in control but it does not
necessarily have to hold the offload decision logic for all users.
I think this is compareable to routing daemons. We do not want to
talk BPF or OSPF in the kernel and we don't need to know about all
of the selection logic behind it but we want to be in charge of
keeping track of the actual datapath routes.

Also, I think this is still an option to emebed the proposed
attribtues in existing Netlink families even if we shoot for a new
family for now. So far the attributes seem to be defined in a way
that would allow them to be embedded into other existing Netlink
families.

> Maybe I need to be enlightened but I thought for a bit about some grand
> unification of ovs, bridge, tc, netlink, et. al. but that seems like
> an entirely different scope of project. (side note: filters/actions
> are no longer locked by qdisc and could stand on their own) My thoughts
> on this are not yet organized.

I think everybody had this in the back of their mind at some point.
Be it based on BPF, NFT or TC. I don't think it's undoable but it
takes a lot of effort as each is based on a slightly different set
of assumptions with corresponding focus derived from that.

^ permalink raw reply

* Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency
From: Tony Lindgren @ 2015-01-14 19:10 UTC (permalink / raw)
  To: David Miller; +Cc: thomas.lendacky, netdev, linux-omap, b.hutchman, balbi
In-Reply-To: <20150113.160522.558845761776458001.davem@davemloft.net>

* David Miller <davem@davemloft.net> [150113 13:08]:
> From: Tony Lindgren <tony@atomide.com>
> Date: Tue, 13 Jan 2015 11:54:16 -0800
> 
> > * Tom Lendacky <thomas.lendacky@amd.com> [150113 11:51]:
> >> On 01/13/2015 01:29 PM, Tony Lindgren wrote:
> >> >We only use clk_get() to get the frequency, the rest is done by
> >> >the runtime PM calls. Let's free the clock too.
> >> >
> >> >Cc: Brian Hutchinson <b.hutchman@gmail.com>
> >> >Cc: Felipe Balbi <balbi@ti.com>
> >> >Signed-off-by: Tony Lindgren <tony@atomide.com>
> >> >---
> >> >  drivers/net/ethernet/ti/davinci_emac.c | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> >diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> >> >index deb43b3..e9efc74 100644
> >> >--- a/drivers/net/ethernet/ti/davinci_emac.c
> >> >+++ b/drivers/net/ethernet/ti/davinci_emac.c
> >> >@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >> >  		return -EBUSY;
> >> >  	}
> >> >  	emac_bus_frequency = clk_get_rate(emac_clk);
> >> >+	clk_put(emac_clk);
> >> 
> >> The devm_clk_get call is used to get the clock so either a devm_clk_put
> >> needs to be used here or just let the devm_ call do its thing and
> >> automatically do the put when the module is unloaded.
> > 
> > Thanks good catch, updated patch below.
> 
> Please, once all the feedback has been addressed, repost the entire
> series.

Sure, will repost on Thursday in case there will be more comments.

Regards,

Tony

^ permalink raw reply

* [RFC PATCH] net: ipv6: Make address flushing on ifdown optional
From: David Ahern @ 2015-01-14 19:17 UTC (permalink / raw)
  To: netdev; +Cc: hannes, David Ahern

Currently, ipv6 addresses are flushed when the interface is configured down:

[root@f20 ~]# ip -6 addr add dev eth1 2000:11:1:1::1/64
[root@f20 ~]# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
    inet6 2000:11:1:1::1/64 scope global tentative
       valid_lft forever preferred_lft forever
[root@f20 ~]# ip link set dev eth1 up
[root@f20 ~]# ip link set dev eth1 down
[root@f20 ~]# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff

Add a new sysctl to make this behavior optional. Setting defaults to flush
addresses to maintain backwards compatibility. When reset flushing is bypassed:

[root@f20 ~]# echo 0 > /proc/sys/net/ipv6/conf/eth1/flush_addr_on_down
[root@f20 ~]# ip -6 addr add dev eth1 2000:11:1:1::1/64
[root@f20 ~]# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
    inet6 2000:11:1:1::1/64 scope global tentative
       valid_lft forever preferred_lft forever
[root@f20 ~]#  ip link set dev eth1 up
[root@f20 ~]#  ip link set dev eth1 down
[root@f20 ~]# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
    inet6 2000:11:1:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::4:11ff:fe22:3301/64 scope link
       valid_lft forever preferred_lft forever

Suggested-by: Hannes Frederic Sowa <hannes@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Hannes Frederic Sowa <hannes@redhat.com>
---
 include/linux/ipv6.h      |  1 +
 include/uapi/linux/ipv6.h |  1 +
 net/ipv6/addrconf.c       | 15 +++++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c694e7baa621..1d726e39f09f 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -52,6 +52,7 @@ struct ipv6_devconf {
 	__s32		force_tllao;
 	__s32           ndisc_notify;
 	__s32		suppress_frag_ndisc;
+	__s32		flush_addr_on_down;
 	void		*sysctl;
 };
 
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index e863d088b9a5..c7cb79e0f0fe 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -165,6 +165,7 @@ enum {
 	DEVCONF_SUPPRESS_FRAG_NDISC,
 	DEVCONF_ACCEPT_RA_FROM_LOCAL,
 	DEVCONF_USE_OPTIMISTIC,
+	DEVCONF_FLUSH_ON_DOWN,
 	DEVCONF_MAX
 };
 
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f7c8bbeb27b7..5c0d49073cb1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -201,6 +201,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
 	.disable_ipv6		= 0,
 	.accept_dad		= 1,
 	.suppress_frag_ndisc	= 1,
+	.flush_addr_on_down	= 1,
 };
 
 static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
@@ -238,6 +239,7 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
 	.disable_ipv6		= 0,
 	.accept_dad		= 1,
 	.suppress_frag_ndisc	= 1,
+	.flush_addr_on_down	= 1,
 };
 
 /* Check if a valid qdisc is available */
@@ -3083,6 +3085,9 @@ static int addrconf_ifdown(struct net_device *dev, int how)
 	if (how && del_timer(&idev->regen_timer))
 		in6_dev_put(idev);
 
+	if (!how && !idev->cnf.flush_addr_on_down)
+		goto unlock;
+
 	/* Step 3: clear tempaddr list */
 	while (!list_empty(&idev->tempaddr_list)) {
 		ifa = list_first_entry(&idev->tempaddr_list,
@@ -3123,6 +3128,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
 		write_lock_bh(&idev->lock);
 	}
 
+unlock:
 	write_unlock_bh(&idev->lock);
 
 	/* Step 5: Discard anycast and multicast list */
@@ -4376,6 +4382,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
 	array[DEVCONF_NDISC_NOTIFY] = cnf->ndisc_notify;
 	array[DEVCONF_SUPPRESS_FRAG_NDISC] = cnf->suppress_frag_ndisc;
 	array[DEVCONF_ACCEPT_RA_FROM_LOCAL] = cnf->accept_ra_from_local;
+	array[DEVCONF_FLUSH_ON_DOWN] = cnf->flush_addr_on_down;
 }
 
 static inline size_t inet6_ifla6_size(void)
@@ -5253,6 +5260,14 @@ static struct addrconf_sysctl_table
 			.proc_handler	= proc_dointvec,
 		},
 		{
+			.procname       = "flush_addr_on_down",
+			.data           = &ipv6_devconf.flush_addr_on_down,
+			.maxlen         = sizeof(int),
+			.mode           = 0644,
+			.proc_handler   = proc_dointvec,
+
+		},
+		{
 			/* sentinel */
 		}
 	},
-- 
1.9.3 (Apple Git-50)

^ permalink raw reply related

* Re: [PATCH net 0/3]tg3: synchronize_irq() should be called without taking locks
From: Prashant Sreedharan @ 2015-01-14 19:04 UTC (permalink / raw)
  To: Peter Hurley; +Cc: davem, netdev, mchan
In-Reply-To: <54B691FE.50903@hurleysoftware.com>

On Wed, 2015-01-14 at 10:57 -0500, Peter Hurley wrote:
> On 01/14/2015 01:30 AM, Prashant Sreedharan wrote:
> > Prashant Sreedharan (3):
> >   tg3_timer() should grab tp->lock before checking for tp->irq_sync
> >   tg3_reset_task() needs to use rtnl_lock to synchronize
> >   Release tp->lock before invoking synchronize_irq()
> 
> Thanks!
> 
> For series:
> 
> Reported-by: Peter Hurley <peter@hurleysoftware.com>
> Tested-by: Peter Hurley <peter@hurleysoftware.com>
> 
> But maybe one of these patches should reference that this fixes
> BUG: sleeping function... so that others can quickly find this
> fix (if they're bisecting or whatever). 

Sure will add

> For the same reason, it
> might be useful for this series to be just one patch.

These are logical different sections of code, I prefer them to be small
patches.

> 
> Regards,
> Peter Hurley
> 

^ permalink raw reply

* Re: [patch net-next v4 1/2] tc: add BPF based action
From: Cong Wang @ 2015-01-14 19:27 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, David Miller, Jamal Hadi Salim, Daniel Borkmann,
	Alexei Starovoitov, Hannes Frederic Sowa
In-Reply-To: <1421257404-25452-1-git-send-email-jiri@resnulli.us>

On Wed, Jan 14, 2015 at 9:43 AM, Jiri Pirko <jiri@resnulli.us> wrote:
> This action provides a possibility to exec custom BPF code.
>

I still don't like it, sorry, not just for your patch, I never like
cls_bpf either, in terms of the user interface and the duplicated
functionalities: cls_bpf vs u32, act_bpf vs gact.

Ideally we should be able to implement them with the same
interface, transparent to users, I think probably because
the nature of bpf implementation somewhat enforces such
interface everywhere, it is clearly overrated.

(I have no idea about eBPF though.)

^ permalink raw reply

* Re: [PATCH net-next] bridge: fix setlink/dellink notifications
From: Thomas Graf @ 2015-01-14 19:41 UTC (permalink / raw)
  To: roopa
  Cc: netdev, shemminger, vyasevic, john.fastabend, jhs, sfeldma, jiri,
	wkok
In-Reply-To: <1421218123-18346-1-git-send-email-roopa@cumulusnetworks.com>

On 01/13/15 at 10:48pm, roopa@cumulusnetworks.com wrote:
> 2) Generate one notification from master and the other notification from
>    self (This seems to be ideal):
>      For master: the master driver will send notification (bridge in this
> 	example)
>      For self: the self driver will send notification (rocker in the above
> 	example. It can use helpers from rtnetlink.c to do so. Like the
> 	ndo_dflt_bridge_getlink api).
> 
> This patch implements 2) (leaving the 'rtnl_bridge_notify' around to be used
> with 'self').
> 
> CC'ing others who might be affected by this change for review.
> 
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

I haven't digested this line by line yet but I agree that what you
describe above would be a good end state.

If I read the patch correctly then we would omit one notification
for the master case. Were both notifications exactly identical
previously?

This has the chance of breaking existing users terribly.

^ permalink raw reply

* Re: [net-next PATCH v2 02/12] net: flow_table: add flow, delete flow
From: Thomas Graf @ 2015-01-14 19:50 UTC (permalink / raw)
  To: John Fastabend
  Cc: Alexei Starovoitov, simon.horman, Scott Feldman,
	netdev@vger.kernel.org, gerlitz.or@gmail.com, Jamal Hadi Salim,
	Andy Gospodarek, David S. Miller
In-Reply-To: <54B68349.3080603@gmail.com>

On 01/14/15 at 06:55am, John Fastabend wrote:
> If one of the actions supported by the device is forward_to_queue() or
> forward_to_socket() we can use the API to steer potentially interesting
> packets to a user space application for processing.

+1

Ideally using NFQUEUE so we can leverage existing infrastructure.

^ permalink raw reply

* [PATCH net 0/3 v2]tg3: synchronize_irq() should be called without taking locks
From: Prashant Sreedharan @ 2015-01-14 19:33 UTC (permalink / raw)
  To: davem; +Cc: netdev, mchan, peter, Prashant Sreedharan

v2: Added Reported-by, Tested-by fields and reference to the thread that
    reported the problem

This series addresses the problem reported by Peter Hurley in mail thread
https://lkml.org/lkml/2015/1/12/1082

Prashant Sreedharan (3):
  tg3_timer() should grab tp->lock before checking for tp->irq_sync
  tg3_reset_task() needs to use rtnl_lock to synchronize
  Release tp->lock before invoking synchronize_irq()

Our QA team also has validated this patch series. Thanks.

 drivers/net/ethernet/broadcom/tg3.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

^ permalink raw reply

* [PATCH net 1/3 v2]tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
From: Prashant Sreedharan @ 2015-01-14 19:33 UTC (permalink / raw)
  To: davem; +Cc: netdev, peter, Prashant Sreedharan, Michael Chan

This is to avoid the race between tg3_timer() and the execution paths
which does not invoke tg3_timer_stop() and releases tp->lock before
calling synchronize_irq()

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 553dcd8..2dbd4ae 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10903,11 +10903,13 @@ static void tg3_timer(unsigned long __opaque)
 {
 	struct tg3 *tp = (struct tg3 *) __opaque;
 
-	if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING))
-		goto restart_timer;
-
 	spin_lock(&tp->lock);
 
+	if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) {
+		spin_unlock(&tp->lock);
+		goto restart_timer;
+	}
+
 	if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
 	    tg3_flag(tp, 57765_CLASS))
 		tg3_chk_missed_msi(tp);
-- 
1.7.1

^ permalink raw reply related

* [PATCH net 2/3 v2]tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
From: Prashant Sreedharan @ 2015-01-14 19:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, peter, Prashant Sreedharan, Michael Chan

Currently tg3_reset_task() uses only tp->lock for synchronizing with code
paths like tg3_open() etc. But since tp->lock is released before doing
synchronize_irq(), rtnl_lock should be taken in tg3_reset_task() to
synchronize it with other code paths.

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 2dbd4ae..9247ae1 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -11103,11 +11103,13 @@ static void tg3_reset_task(struct work_struct *work)
 	struct tg3 *tp = container_of(work, struct tg3, reset_task);
 	int err;
 
+	rtnl_lock();
 	tg3_full_lock(tp, 0);
 
 	if (!netif_running(tp->dev)) {
 		tg3_flag_clear(tp, RESET_TASK_PENDING);
 		tg3_full_unlock(tp);
+		rtnl_unlock();
 		return;
 	}
 
@@ -11140,6 +11142,7 @@ out:
 		tg3_phy_start(tp);
 
 	tg3_flag_clear(tp, RESET_TASK_PENDING);
+	rtnl_unlock();
 }
 
 static int tg3_request_irq(struct tg3 *tp, int irq_num)
-- 
1.7.1

^ permalink raw reply related

* [PATCH net 3/3 v2]tg3: Release tp->lock before invoking synchronize_irq()
From: Prashant Sreedharan @ 2015-01-14 19:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, peter, Prashant Sreedharan, Michael Chan

synchronize_irq() can sleep waiting, for pending IRQ handlers so driver
should release the tp->lock spin lock before invoking synchronize_irq()

Reported-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 9247ae1..96bf01b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7413,6 +7413,8 @@ static inline void tg3_netif_start(struct tg3 *tp)
 }
 
 static void tg3_irq_quiesce(struct tg3 *tp)
+	__releases(tp->lock)
+	__acquires(tp->lock)
 {
 	int i;
 
@@ -7421,8 +7423,12 @@ static void tg3_irq_quiesce(struct tg3 *tp)
 	tp->irq_sync = 1;
 	smp_mb();
 
+	spin_unlock_bh(&tp->lock);
+
 	for (i = 0; i < tp->irq_cnt; i++)
 		synchronize_irq(tp->napi[i].irq_vec);
+
+	spin_lock_bh(&tp->lock);
 }
 
 /* Fully shutdown all tg3 driver activity elsewhere in the system.
@@ -9018,6 +9024,8 @@ static void tg3_restore_clk(struct tg3 *tp)
 
 /* tp->lock is held. */
 static int tg3_chip_reset(struct tg3 *tp)
+	__releases(tp->lock)
+	__acquires(tp->lock)
 {
 	u32 val;
 	void (*write_op)(struct tg3 *, u32, u32);
@@ -9073,9 +9081,13 @@ static int tg3_chip_reset(struct tg3 *tp)
 	}
 	smp_mb();
 
+	tg3_full_unlock(tp);
+
 	for (i = 0; i < tp->irq_cnt; i++)
 		synchronize_irq(tp->napi[i].irq_vec);
 
+	tg3_full_lock(tp, 0);
+
 	if (tg3_asic_rev(tp) == ASIC_REV_57780) {
 		val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
 		tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS);
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH net-next] r8152: replace tasklet with NAPI
From: David Miller @ 2015-01-14 20:06 UTC (permalink / raw)
  To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-117-Taiwan-albertk@realtek.com>

From: Hayes Wang <hayeswang@realtek.com>
Date: Mon, 12 Jan 2015 12:06:23 +0800

> Replace tasklet with NAPI.
> 
> Add rx_queue to queue the remaining rx packets if the number of the
> rx packets is more than the request from poll().
> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] bridge: only provide proxy ARP when CONFIG_INET is enabled
From: David Miller @ 2015-01-14 20:08 UTC (permalink / raw)
  To: arnd; +Cc: netdev, kyeyoonp, bridge
In-Reply-To: <56868207.rHBDZL3pbk@wuerfel>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 13 Jan 2015 15:10:27 +0100

> When IPV4 support is disabled, we cannot call arp_send from
> the bridge code, which would result in a kernel link error:
> 
> net/built-in.o: In function `br_handle_frame_finish':
> :(.text+0x59914): undefined reference to `arp_send'
> :(.text+0x59a50): undefined reference to `arp_tbl'
> 
> This makes the newly added proxy ARP support in the bridge
> code depend on the CONFIG_INET symbol and lets the compiler
> optimize the code out to avoid the link error.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 958501163ddd ("bridge: Add support for IEEE 802.11 Proxy ARP")

Applied, thanks Arnd.

^ permalink raw reply

* [PATCH 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier
From: Xander Huff @ 2015-01-14 20:21 UTC (permalink / raw)
  To: nicolas.ferre, netdev, davem
  Cc: jaeden.amero, rich.tollerton, ben.shelton, brad.mouring,
	linux-kernel, cyrille.pitchen, Xander Huff
In-Reply-To: <54B690F5.5080308@atmel.com>

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.h | 107 +++++++++---------------------------
 1 file changed, 26 insertions(+), 81 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 378b218..d7b93d0 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -275,9 +275,7 @@
 #define MACB_THALT_SIZE				1
 #define MACB_NCR_TPF_OFFSET			11 /* Transmit pause frame */
 #define MACB_NCR_TPF_SIZE			1
-#define MACB_TZQ_OFFSET				12 /* Transmit zero quantum
-						    * pause frame
-						    */
+#define MACB_TZQ_OFFSET				12 /* Transmit zero quantum pause frame */
 #define MACB_TZQ_SIZE				1
 
 /* Bitfields in NCFGR */
@@ -299,9 +297,7 @@
 #define MACB_UNI_SIZE				1
 #define MACB_BIG_OFFSET				8 /* Receive 1536 byte frames */
 #define MACB_BIG_SIZE				1
-#define MACB_EAE_OFFSET				9 /* External address match
-						   * enable
-						   */
+#define MACB_EAE_OFFSET				9 /* External address match enable */
 #define MACB_EAE_SIZE				1
 #define MACB_CLK_OFFSET				10
 #define MACB_CLK_SIZE				2
@@ -313,9 +309,7 @@
 #define MACB_RM9200_RMII_SIZE			1  /* AT91RM9200 only */
 #define MACB_RBOF_OFFSET			14 /* Receive buffer offset */
 #define MACB_RBOF_SIZE				2
-#define MACB_RLCE_OFFSET			16 /* Length field error frame
-						    * discard
-						    */
+#define MACB_RLCE_OFFSET			16 /* Length field error frame discard */
 #define MACB_RLCE_SIZE				1
 #define MACB_DRFCS_OFFSET			17 /* FCS remove */
 #define MACB_DRFCS_SIZE				1
@@ -335,41 +329,22 @@
 #define GEM_RXCOEN_SIZE				1
 
 /* Constants for data bus width. */
-#define GEM_DBW32				0 /* 32 bit AMBA AHB data bus
-						   * width
-						   */
-#define GEM_DBW64				1 /* 64 bit AMBA AHB data bus
-						   * width
-						   */
-#define GEM_DBW128				2 /* 128 bit AMBA AHB data bus
-						   * width
-						   */
+#define GEM_DBW32				0 /* 32 bit AMBA AHB data bus width */
+#define GEM_DBW64				1 /* 64 bit AMBA AHB data bus width */
+#define GEM_DBW128				2 /* 128 bit AMBA AHB data bus width */
 
 /* Bitfields in DMACFG. */
-#define GEM_FBLDO_OFFSET			0 /* AHB fixed burst length for
-						   * DMA data operations
-						   */
+#define GEM_FBLDO_OFFSET			0 /* AHB fixed burst length for DMA data operations */
 #define GEM_FBLDO_SIZE				5
-#define GEM_ENDIA_OFFSET			7 /* AHB endian swap mode enable
-						   * for packet data accesses
-						   */
+#define GEM_ENDIA_OFFSET			7 /* AHB endian swap mode enable for packet data accesses */
 #define GEM_ENDIA_SIZE				1
-#define GEM_RXBMS_OFFSET			8 /* Receiver packet buffer
-						   * memory size select
-						   */
+#define GEM_RXBMS_OFFSET			8 /* Receiver packet buffer memory size select */
 #define GEM_RXBMS_SIZE				2
-#define GEM_TXPBMS_OFFSET			10 /* Transmitter packet buffer
-						    * memory size select
-						    */
+#define GEM_TXPBMS_OFFSET			10 /* Transmitter packet buffer memory size select */
 #define GEM_TXPBMS_SIZE				1
-#define GEM_TXCOEN_OFFSET			11 /* Transmitter IP, TCP and
-						    * UDP checksum generation
-						    * offload enable
-						    */
+#define GEM_TXCOEN_OFFSET			11 /* Transmitter IP, TCP and UDP checksum generation offload enable */
 #define GEM_TXCOEN_SIZE				1
-#define GEM_RXBS_OFFSET				16 /* DMA receive buffer size in
-						    * AHB system memory
-						    */
+#define GEM_RXBS_OFFSET				16 /* DMA receive buffer size in AHB system memory */
 #define GEM_RXBS_SIZE				8
 #define GEM_DDRP_OFFSET				24 /* disc_when_no_ahb */
 #define GEM_DDRP_SIZE				1
@@ -378,13 +353,9 @@
 /* Bitfields in NSR */
 #define MACB_NSR_LINK_OFFSET			0 /* pcs_link_state */
 #define MACB_NSR_LINK_SIZE			1
-#define MACB_MDIO_OFFSET			1 /* status of the mdio_in
-						   * pin
-						   */
+#define MACB_MDIO_OFFSET			1 /* status of the mdio_in pin */
 #define MACB_MDIO_SIZE				1
-#define MACB_IDLE_OFFSET			2 /* The PHY management logic is
-						   * idle (i.e. has completed)
-						   */
+#define MACB_IDLE_OFFSET			2 /* The PHY management logic is idle (i.e. has completed) */
 #define MACB_IDLE_SIZE				1
 
 /* Bitfields in TSR */
@@ -396,9 +367,7 @@
 #define MACB_TSR_RLE_SIZE			1
 #define MACB_TGO_OFFSET				3 /* Transmit go */
 #define MACB_TGO_SIZE				1
-#define MACB_BEX_OFFSET				4 /* Transmit frame corruption
-						   * due to AHB error
-						   */
+#define MACB_BEX_OFFSET				4 /* Transmit frame corruption due to AHB error */
 #define MACB_BEX_SIZE				1
 #define MACB_RM9200_BNQ_OFFSET			4 /* AT91RM9200 only */
 #define MACB_RM9200_BNQ_SIZE			1 /* AT91RM9200 only */
@@ -424,43 +393,23 @@
 #define MACB_RXUBR_SIZE				1
 #define MACB_TXUBR_OFFSET			3 /* TX used bit read */
 #define MACB_TXUBR_SIZE				1
-#define MACB_ISR_TUND_OFFSET			4 /* Enable trnasmit buffer
-						   * under run interrupt
-						   */
+#define MACB_ISR_TUND_OFFSET			4 /* Enable trnasmit buffer under run interrupt */
 #define MACB_ISR_TUND_SIZE			1
-#define MACB_ISR_RLE_OFFSET			5 /* Enable retry limit exceeded
-						   * or late collision interrupt
-						   */
+#define MACB_ISR_RLE_OFFSET			5 /* Enable retry limit exceeded or late collision interrupt */
 #define MACB_ISR_RLE_SIZE			1
-#define MACB_TXERR_OFFSET			6 /* Enable transmit frame
-						   * corruption due to AHB error
-						   * interrupt
-						   */
+#define MACB_TXERR_OFFSET			6 /* Enable transmit frame corruption due to AHB error interrupt */
 #define MACB_TXERR_SIZE				1
-#define MACB_TCOMP_OFFSET			7 /* Enable transmit complete
-						   * interrupt
-						   */
+#define MACB_TCOMP_OFFSET			7 /* Enable transmit complete interrupt */
 #define MACB_TCOMP_SIZE				1
-#define MACB_ISR_LINK_OFFSET			9 /* Enable link change
-						   * interrupt
-						   */
+#define MACB_ISR_LINK_OFFSET			9 /* Enable link change interrupt */
 #define MACB_ISR_LINK_SIZE			1
-#define MACB_ISR_ROVR_OFFSET			10 /* Enable receive overrun
-						    * interrupt
-						    */
+#define MACB_ISR_ROVR_OFFSET			10 /* Enable receive overrun interrupt */
 #define MACB_ISR_ROVR_SIZE			1
-#define MACB_HRESP_OFFSET			11 /* Enable hrsep not OK
-						    * interrupt
-						    */
+#define MACB_HRESP_OFFSET			11 /* Enable hrsep not OK interrupt */
 #define MACB_HRESP_SIZE				1
-#define MACB_PFR_OFFSET				12 /* Enable pause frame with
-						    * non-zero pause quantum
-						    * interrupt
-						    */
+#define MACB_PFR_OFFSET				12 /* Enable pause frame with non-zero pause quantum interrupt */
 #define MACB_PFR_SIZE				1
-#define MACB_PTZ_OFFSET				13 /* Enable pause time zero
-						    * interrupt
-						    */
+#define MACB_PTZ_OFFSET				13 /* Enable pause time zero interrupt */
 #define MACB_PTZ_SIZE				1
 
 /* Bitfields in MAN */
@@ -472,13 +421,9 @@
 #define MACB_REGA_SIZE				5
 #define MACB_PHYA_OFFSET			23 /* PHY address */
 #define MACB_PHYA_SIZE				5
-#define MACB_RW_OFFSET				28 /* Operation. 10 is read. 01
-						    * is write.
-						    */
+#define MACB_RW_OFFSET				28 /* Operation. 10 is read. 01 is write. */
 #define MACB_RW_SIZE				2
-#define MACB_SOF_OFFSET				30 /* Must be written to 1 for
-						    * Clause 22 operation
-						    */
+#define MACB_SOF_OFFSET				30 /* Must be written to 1 for Clause 22 operation */
 #define MACB_SOF_SIZE				2
 
 /* Bitfields in USRIO (AVR32) */
-- 
1.9.1

^ permalink raw reply related

* [PATCH 2/2] fixup! net/macb: improved ethtool statistics support
From: Xander Huff @ 2015-01-14 20:21 UTC (permalink / raw)
  To: nicolas.ferre, netdev, davem
  Cc: jaeden.amero, rich.tollerton, ben.shelton, brad.mouring,
	linux-kernel, cyrille.pitchen, Xander Huff
In-Reply-To: <1421266881-17314-1-git-send-email-xander.huff@ni.com>

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
 drivers/net/ethernet/cadence/macb.c |  25 +++--
 drivers/net/ethernet/cadence/macb.h | 203 +++++++++---------------------------
 2 files changed, 68 insertions(+), 160 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index dd8c202..f60f8f8 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1832,15 +1832,15 @@ static void gem_update_stats(struct macb *bp)
 
 	for (i = 0; i < GEM_STATS_LEN; ++i, ++p) {
 		u32 offset = gem_statistics[i].offset;
-		u64 val = __raw_readl(bp->regs+offset);
+		u64 val = __raw_readl(bp->regs + offset);
 
 		bp->ethtool_stats[i] += val;
 		*p += val;
 
 		if (offset == GEM_OCTTXL || offset == GEM_OCTRXL) {
 			/* Add GEM_OCTTXH, GEM_OCTRXH */
-			val = __raw_readl(bp->regs+offset+4);
-			bp->ethtool_stats[i] += ((u64)val)<<32;
+			val = __raw_readl(bp->regs+offset + 4);
+			bp->ethtool_stats[i] += ((u64)val) << 32;
 			*(++p) += val;
 		}
 	}
@@ -1891,7 +1891,7 @@ static void gem_get_ethtool_stats(struct net_device *dev,
 
 	bp = netdev_priv(dev);
 	gem_update_stats(bp);
-	memcpy(data, &bp->ethtool_stats, sizeof(u64)*GEM_STATS_LEN);
+	memcpy(data, &bp->ethtool_stats, sizeof(u64) * GEM_STATS_LEN);
 }
 
 static int gem_get_sset_count(struct net_device *dev, int sset)
@@ -2032,11 +2032,21 @@ const struct ethtool_ops macb_ethtool_ops = {
 	.get_regs		= macb_get_regs,
 	.get_link		= ethtool_op_get_link,
 	.get_ts_info		= ethtool_op_get_ts_info,
+};
+EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+
+const struct ethtool_ops gem_ethtool_ops = {
+	.get_settings		= macb_get_settings,
+	.set_settings		= macb_set_settings,
+	.get_regs_len		= macb_get_regs_len,
+	.get_regs		= macb_get_regs,
+	.get_link		= ethtool_op_get_link,
+	.get_ts_info		= ethtool_op_get_ts_info,
 	.get_ethtool_stats	= gem_get_ethtool_stats,
 	.get_strings		= gem_get_ethtool_strings,
 	.get_sset_count		= gem_get_sset_count,
 };
-EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+EXPORT_SYMBOL_GPL(gem_ethtool_ops);
 
 int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
@@ -2325,7 +2335,10 @@ static int __init macb_probe(struct platform_device *pdev)
 
 	dev->netdev_ops = &macb_netdev_ops;
 	netif_napi_add(dev, &bp->napi, macb_poll, 64);
-	dev->ethtool_ops = &macb_ethtool_ops;
+	if (macb_is_gem(bp))
+		dev->ethtool_ops = &gem_ethtool_ops;
+	else
+		dev->ethtool_ops = &macb_ethtool_ops;
 
 	dev->base_addr = regs->start;
 
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index d7b93d0..2ea5355 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -82,159 +82,52 @@
 #define GEM_SA4B				0x00A0 /* Specific4 Bottom */
 #define GEM_SA4T				0x00A4 /* Specific4 Top */
 #define GEM_OTX					0x0100 /* Octets transmitted */
-#define GEM_OCTTXL				0x0100 /* Octets transmitted
-							* [31:0]
-							*/
-#define GEM_OCTTXH				0x0104 /* Octets transmitted
-							* [47:32]
-							*/
-#define GEM_TXCNT				0x0108 /* Error-free Frames
-							* Transmitted counter
-							*/
-#define GEM_TXBCCNT				0x010c /* Error-free Broadcast
-							* Frames counter
-							*/
-#define GEM_TXMCCNT				0x0110 /* Error-free Multicast
-							* Frames counter
-							*/
-#define GEM_TXPAUSECNT				0x0114 /* Pause Frames
-							* Transmitted Counter
-							*/
-#define GEM_TX64CNT				0x0118 /* Error-free 64 byte
-							* Frames Transmitted
-							* counter
-							*/
-#define GEM_TX65CNT				0x011c /* Error-free 65-127 byte
-							* Frames Transmitted
-							* counter
-							*/
-#define GEM_TX128CNT				0x0120 /* Error-free 128-255
-							* byte Frames
-							* Transmitted counter
-							*/
-#define GEM_TX256CNT				0x0124 /* Error-free 256-511
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX512CNT				0x0128 /* Error-free 512-1023
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX1024CNT				0x012c /* Error-free 1024-1518
-							* byte Frames
-							* transmitted counter
-							*/
-#define GEM_TX1519CNT				0x0130 /* Error-free larger than
-							* 1519 byte Frames
-							* tranmitted counter
-							*/
-#define GEM_TXURUNCNT				0x0134 /* TX under run error
-							* counter
-							*/
-#define GEM_SNGLCOLLCNT				0x0138 /* Single Collision Frame
-							* Counter
-							*/
-#define GEM_MULTICOLLCNT			0x013c /* Multiple Collision
-							* Frame Counter
-							*/
-#define GEM_EXCESSCOLLCNT			0x0140 /* Excessive Collision
-							* Frame Counter
-							*/
-#define GEM_LATECOLLCNT				0x0144 /* Late Collision Frame
-							* Counter
-							*/
-#define GEM_TXDEFERCNT				0x0148 /* Deferred Transmission
-							* Frame Counter
-							*/
-#define GEM_TXCSENSECNT				0x014c /* Carrier Sense Error
-							* Counter
-							*/
+#define GEM_OCTTXL				0x0100 /* Octets transmitted [31:0] */
+#define GEM_OCTTXH				0x0104 /* Octets transmitted [47:32] */
+#define GEM_TXCNT				0x0108 /* Error-free Frames Transmitted counter */
+#define GEM_TXBCCNT				0x010c /* Error-free Broadcast Frames counter */
+#define GEM_TXMCCNT				0x0110 /* Error-free Multicast Frames counter */
+#define GEM_TXPAUSECNT				0x0114 /* Pause Frames Transmitted Counter */
+#define GEM_TX64CNT				0x0118 /* Error-free 64 byte Frames Transmitted counter */
+#define GEM_TX65CNT				0x011c /* Error-free 65-127 byte Frames Transmitted counter */
+#define GEM_TX128CNT				0x0120 /* Error-free 128-255 byte Frames Transmitted counter */
+#define GEM_TX256CNT				0x0124 /* Error-free 256-511 byte Frames transmitted counter */
+#define GEM_TX512CNT				0x0128 /* Error-free 512-1023 byte Frames transmitted counter */
+#define GEM_TX1024CNT				0x012c /* Error-free 1024-1518 byte Frames transmitted counter */
+#define GEM_TX1519CNT				0x0130 /* Error-free larger than 1519 byte Frames tranmitted counter */
+#define GEM_TXURUNCNT				0x0134 /* TX under run error counter */
+#define GEM_SNGLCOLLCNT				0x0138 /* Single Collision Frame Counter */
+#define GEM_MULTICOLLCNT			0x013c /* Multiple Collision Frame Counter */
+#define GEM_EXCESSCOLLCNT			0x0140 /* Excessive Collision Frame Counter */
+#define GEM_LATECOLLCNT				0x0144 /* Late Collision Frame Counter */
+#define GEM_TXDEFERCNT				0x0148 /* Deferred Transmission Frame Counter */
+#define GEM_TXCSENSECNT				0x014c /* Carrier Sense Error Counter */
 #define GEM_ORX					0x0150 /* Octets received */
-#define GEM_OCTRXL				0x0150 /* Octets received
-							* [31:0]
-							*/
-#define GEM_OCTRXH				0x0154 /* Octets received
-							* [47:32]
-							*/
-#define GEM_RXCNT				0x0158 /* Error-free Frames
-							* Received Counter
-							*/
-#define GEM_RXBROADCNT				0x015c /* Error-free Broadcast
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RXMULTICNT				0x0160 /* Error-free Multicast
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RXPAUSECNT				0x0164 /* Error-free Pause
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX64CNT				0x0168 /* Error-free 64 byte
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX65CNT				0x016c /* Error-free 65-127 byte
-							* Frames Received
-							* Counter
-							*/
-#define GEM_RX128CNT				0x0170 /* Error-free 128-255
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX256CNT				0x0174 /* Error-free 256-511
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX512CNT				0x0178 /* Error-free 512-1023
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX1024CNT				0x017c /* Error-free 1024-1518
-							* byte Frames Received
-							* Counter
-							*/
-#define GEM_RX1519CNT				0x0180 /* Error-free larger than
-							* 1519 Frames Received
-							* Counter
-							*/
-#define GEM_RXUNDRCNT				0x0184 /* Undersize Frames
-							* Received Counter
-							*/
-#define GEM_RXOVRCNT				0x0188 /* Oversize Frames
-							* Received Counter
-							*/
-#define GEM_RXJABCNT				0x018c /* Jabbers Received
-							* Counter
-							*/
-#define GEM_RXFCSCNT				0x0190 /* Frame Check Sequence
-							* Error Counter
-							*/
-#define GEM_RXLENGTHCNT				0x0194 /* Length Field Error
-							* Counter
-							*/
-#define GEM_RXSYMBCNT				0x0198 /* Symbol Error
-							* Counter
-							*/
-#define GEM_RXALIGNCNT				0x019c /* Alignment Error
-							* Counter
-							*/
-#define GEM_RXRESERRCNT				0x01a0 /* Receive Resource Error
-							* Counter
-							*/
-#define GEM_RXORCNT				0x01a4 /* Receive Overrun
-							* Counter
-							*/
-#define GEM_RXIPCCNT				0x01a8 /* IP header Checksum
-							* Error Counter
-							*/
-#define GEM_RXTCPCCNT				0x01ac /* TCP Checksum Error
-							* Counter
-							*/
-#define GEM_RXUDPCCNT				0x01b0 /* UDP Checksum Error
-							* Counter
-							*/
+#define GEM_OCTRXL				0x0150 /* Octets received [31:0] */
+#define GEM_OCTRXH				0x0154 /* Octets received [47:32] */
+#define GEM_RXCNT				0x0158 /* Error-free Frames Received Counter */
+#define GEM_RXBROADCNT				0x015c /* Error-free Broadcast Frames Received Counter */
+#define GEM_RXMULTICNT				0x0160 /* Error-free Multicast Frames Received Counter */
+#define GEM_RXPAUSECNT				0x0164 /* Error-free Pause Frames Received Counter */
+#define GEM_RX64CNT				0x0168 /* Error-free 64 byte Frames Received Counter */
+#define GEM_RX65CNT				0x016c /* Error-free 65-127 byte Frames Received Counter */
+#define GEM_RX128CNT				0x0170 /* Error-free 128-255 byte Frames Received Counter */
+#define GEM_RX256CNT				0x0174 /* Error-free 256-511 byte Frames Received Counter */
+#define GEM_RX512CNT				0x0178 /* Error-free 512-1023 byte Frames Received Counter */
+#define GEM_RX1024CNT				0x017c /* Error-free 1024-1518 byte Frames Received Counter */
+#define GEM_RX1519CNT				0x0180 /* Error-free larger than 1519 Frames Received Counter */
+#define GEM_RXUNDRCNT				0x0184 /* Undersize Frames Received Counter */
+#define GEM_RXOVRCNT				0x0188 /* Oversize Frames Received Counter */
+#define GEM_RXJABCNT				0x018c /* Jabbers Received Counter */
+#define GEM_RXFCSCNT				0x0190 /* Frame Check Sequence Error Counter */
+#define GEM_RXLENGTHCNT				0x0194 /* Length Field Error Counter */
+#define GEM_RXSYMBCNT				0x0198 /* Symbol Error Counter */
+#define GEM_RXALIGNCNT				0x019c /* Alignment Error Counter */
+#define GEM_RXRESERRCNT				0x01a0 /* Receive Resource Error Counter */
+#define GEM_RXORCNT				0x01a4 /* Receive Overrun Counter */
+#define GEM_RXIPCCNT				0x01a8 /* IP header Checksum Error Counter */
+#define GEM_RXTCPCCNT				0x01ac /* TCP Checksum Error Counter */
+#define GEM_RXUDPCCNT				0x01b0 /* UDP Checksum Error Counter */
 #define GEM_DCFG1				0x0280 /* Design Config 1 */
 #define GEM_DCFG2				0x0284 /* Design Config 2 */
 #define GEM_DCFG3				0x0288 /* Design Config 3 */
@@ -748,7 +641,8 @@ struct gem_stats {
 	u32	rx_udp_checksum_errors;
 };
 
-/* Describes the name and offset of an individual statistic register, as
+/*
+ * Describes the name and offset of an individual statistic register, as
  * returned by `ethtool -S`. Also describes which net_device_stats statistics
  * this register should contribute to.
  */
@@ -778,7 +672,8 @@ struct gem_statistic {
 	.stat_bits = bits				\
 }
 
-/* list of gem statistic registers. The names MUST match the
+/*
+ * list of gem statistic registers. The names MUST match the
  * corresponding GEM_* definitions.
  */
 static const struct gem_statistic gem_statistics[] = {
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH net-next v2 0/2] net: Remote checksum offload for VXLAN
From: David Miller @ 2015-01-14 20:21 UTC (permalink / raw)
  To: therbert; +Cc: netdev
In-Reply-To: <1421110838-5146-1-git-send-email-therbert@google.com>

From: Tom Herbert <therbert@google.com>
Date: Mon, 12 Jan 2015 17:00:36 -0800

> This patch set adds support for remote checksum offload in VXLAN.
> 
> The remote checksum offload is generalized by creating a common
> function (remcsum_adjust) that does the work of modifying the
> checksum in remote checksum offload. This function can be called
> from normal or GRO path. GUE was modified to use this function.
> 
> To support RCO is VXLAN we use the 9th bit in the reserved
> flags to indicated remote checksum offload. The start and offset
> values are encoded n a compressed form in the low order (reserved)
> byte of the vni field.
> 
> Remote checksum offload is described in
> https://tools.ietf.org/html/draft-herbert-remotecsumoffload-01

Tom's arguments for why he separates RX and TX paths seem completely
reasonable, and match my own understanding of the various tunneling
technologies we support.

Therefore, series applied, thanks!

^ permalink raw reply

* [PATCH 0/8] netfilter updates for net-next
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev

Hi David,

The following patchset contains netfilter updates for net-next, just a
bunch of cleanups and small enhancement to selectively flush conntracks
in ctnetlink, more specifically the patches are:

1) Rise default number of buckets in conntrack from 16384 to 65536 in
   systems with >= 4GBytes, patch from Marcelo Leitner.

2) Small refactor to save one level on indentation in xt_osf, from
   Joe Perches.

3) Remove unnecessary sizeof(char) in nf_log, from Fabian Frederick.

4) Another small cleanup to remove redundant variable in nfnetlink,
   from Duan Jiong.

5) Fix compilation warning in nfnetlink_cthelper on parisc, from
   Chen Gang.

6) Fix wrong format in debugging for ctseqadj, from Gao feng.

7) Selective conntrack flushing through the mark for ctnetlink, patch
   from Kristian Evensen.

8) Remove nf_ct_conntrack_flush_report() exported symbol now that is
   not required anymore after the selective flushing patch, again from
   Kristian.

You can pull these changes from:

  git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git

Thanks!

----------------------------------------------------------------

The following changes since commit f96fe225677b3efb74346ebd56fafe3997b02afa:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2014-12-12 16:11:12 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master

for you to fetch changes up to ae406bd0572be97a46d72e8a5e97c33c3168388c:

  netfilter: conntrack: Remove nf_ct_conntrack_flush_report (2015-01-08 12:16:58 +0100)

----------------------------------------------------------------
Chen Gang (1):
      netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings

Duan Jiong (1):
      netfilter: nfnetlink: remove redundant variable nskb

Fabian Frederick (1):
      netfilter: log: remove unnecessary sizeof(char)

Gao feng (1):
      netfilter: nf_ct_seqadj: print ack seq in the right host byte order

Joe Perches (1):
      netfilter: xt_osf: Use continue to reduce indentation

Kristian Evensen (2):
      netfilter: conntrack: Flush connections with a given mark
      netfilter: conntrack: Remove nf_ct_conntrack_flush_report

Marcelo Leitner (1):
      netfilter: conntrack: adjust nf_conntrack_buckets default value

 Documentation/networking/nf_conntrack-sysctl.txt |    3 +-
 include/net/netfilter/nf_conntrack.h             |    2 -
 net/netfilter/nf_conntrack_core.c                |   17 +--
 net/netfilter/nf_conntrack_netlink.c             |   89 ++++++++----
 net/netfilter/nf_conntrack_seqadj.c              |    6 +-
 net/netfilter/nf_log.c                           |    3 +-
 net/netfilter/nfnetlink.c                        |   15 +-
 net/netfilter/nfnetlink_cthelper.c               |    4 +-
 net/netfilter/xt_osf.c                           |  169 +++++++++++-----------
 9 files changed, 172 insertions(+), 136 deletions(-)

^ permalink raw reply

* [PATCH 4/8] netfilter: nfnetlink: remove redundant variable nskb
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1421267689-24894-1-git-send-email-pablo@netfilter.org>

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>

Actually after netlink_skb_clone() is called, the nskb and
skb will point to the same thing, but they are used just like
they are different, sometimes this is confusing, so i think
there is no necessary to keep nskb anymore.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
---
 net/netfilter/nfnetlink.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 13c2e17..a7a7e82 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -272,7 +272,7 @@ static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb)
 static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
 				u_int16_t subsys_id)
 {
-	struct sk_buff *nskb, *oskb = skb;
+	struct sk_buff *oskb = skb;
 	struct net *net = sock_net(skb->sk);
 	const struct nfnetlink_subsystem *ss;
 	const struct nfnl_callback *nc;
@@ -283,12 +283,11 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (subsys_id >= NFNL_SUBSYS_COUNT)
 		return netlink_ack(skb, nlh, -EINVAL);
 replay:
-	nskb = netlink_skb_clone(oskb, GFP_KERNEL);
-	if (!nskb)
+	skb = netlink_skb_clone(oskb, GFP_KERNEL);
+	if (!skb)
 		return netlink_ack(oskb, nlh, -ENOMEM);
 
-	nskb->sk = oskb->sk;
-	skb = nskb;
+	skb->sk = oskb->sk;
 
 	nfnl_lock(subsys_id);
 	ss = rcu_dereference_protected(table[subsys_id].subsys,
@@ -305,7 +304,7 @@ replay:
 		{
 			nfnl_unlock(subsys_id);
 			netlink_ack(skb, nlh, -EOPNOTSUPP);
-			return kfree_skb(nskb);
+			return kfree_skb(skb);
 		}
 	}
 
@@ -385,7 +384,7 @@ replay:
 				nfnl_err_reset(&err_list);
 				ss->abort(oskb);
 				nfnl_unlock(subsys_id);
-				kfree_skb(nskb);
+				kfree_skb(skb);
 				goto replay;
 			}
 		}
@@ -426,7 +425,7 @@ done:
 
 	nfnl_err_deliver(&err_list, oskb);
 	nfnl_unlock(subsys_id);
-	kfree_skb(nskb);
+	kfree_skb(skb);
 }
 
 static void nfnetlink_rcv(struct sk_buff *skb)
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 5/8] netfilter: nfnetlink_cthelper: Remove 'const' and '&' to avoid warnings
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1421267689-24894-1-git-send-email-pablo@netfilter.org>

From: Chen Gang <gang.chen.5i5j@gmail.com>

The related code can be simplified, and also can avoid related warnings
(with allmodconfig under parisc):

    CC [M]  net/netfilter/nfnetlink_cthelper.o
  net/netfilter/nfnetlink_cthelper.c: In function ‘nfnl_cthelper_from_nlattr’:
  net/netfilter/nfnetlink_cthelper.c:97:9: warning: passing argument 1 o ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
    memcpy(&help->data, nla_data(attr), help->helper->data_len);
           ^
  In file included from include/linux/string.h:17:0,
                   from include/uapi/linux/uuid.h:25,
                   from include/linux/uuid.h:23,
                   from include/linux/mod_devicetable.h:12,
                   from ./arch/parisc/include/asm/hardware.h:4,
                   from ./arch/parisc/include/asm/processor.h:15,
                   from ./arch/parisc/include/asm/spinlock.h:6,
                   from ./arch/parisc/include/asm/atomic.h:21,
                   from include/linux/atomic.h:4,
                   from ./arch/parisc/include/asm/bitops.h:12,
                   from include/linux/bitops.h:36,
                   from include/linux/kernel.h:10,
                   from include/linux/list.h:8,
                   from include/linux/module.h:9,
                   from net/netfilter/nfnetlink_cthelper.c:11:
  ./arch/parisc/include/asm/string.h:8:8: note: expected ‘void *’ but argument is of type ‘const char (*)[]’
   void * memcpy(void * dest,const void *src,size_t count);
          ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
---
 net/netfilter/nfnetlink_cthelper.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
index 9e287cb..a5599fc 100644
--- a/net/netfilter/nfnetlink_cthelper.c
+++ b/net/netfilter/nfnetlink_cthelper.c
@@ -86,7 +86,7 @@ nfnl_cthelper_parse_tuple(struct nf_conntrack_tuple *tuple,
 static int
 nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
 {
-	const struct nf_conn_help *help = nfct_help(ct);
+	struct nf_conn_help *help = nfct_help(ct);
 
 	if (attr == NULL)
 		return -EINVAL;
@@ -94,7 +94,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
 	if (help->helper->data_len == 0)
 		return -EINVAL;
 
-	memcpy(&help->data, nla_data(attr), help->helper->data_len);
+	memcpy(help->data, nla_data(attr), help->helper->data_len);
 	return 0;
 }
 
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 6/8] netfilter: nf_ct_seqadj: print ack seq in the right host byte order
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1421267689-24894-1-git-send-email-pablo@netfilter.org>

From: Gao feng <gaofeng@cn.fujitsu.com>

new_start_seq and new_end_seq are network byte order,
print the host byte order in debug message and print
seq number as the type of unsigned int.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
---
 net/netfilter/nf_conntrack_seqadj.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index f6e2ae9..ce3e840c8 100644
--- a/net/netfilter/nf_conntrack_seqadj.c
+++ b/net/netfilter/nf_conntrack_seqadj.c
@@ -98,9 +98,9 @@ static void nf_ct_sack_block_adjust(struct sk_buff *skb,
 			new_end_seq = htonl(ntohl(sack->end_seq) -
 				      seq->offset_before);
 
-		pr_debug("sack_adjust: start_seq: %d->%d, end_seq: %d->%d\n",
-			 ntohl(sack->start_seq), new_start_seq,
-			 ntohl(sack->end_seq), new_end_seq);
+		pr_debug("sack_adjust: start_seq: %u->%u, end_seq: %u->%u\n",
+			 ntohl(sack->start_seq), ntohl(new_start_seq),
+			 ntohl(sack->end_seq), ntohl(new_end_seq));
 
 		inet_proto_csum_replace4(&tcph->check, skb,
 					 sack->start_seq, new_start_seq, 0);
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 3/8] netfilter: log: remove unnecessary sizeof(char)
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1421267689-24894-1-git-send-email-pablo@netfilter.org>

From: Fabian Frederick <fabf@skynet.be>

sizeof(char) is always 1.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_log.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 43c926c..0d8448f 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -425,8 +425,7 @@ static int netfilter_log_sysctl_init(struct net *net)
 			nf_log_sysctl_table[i].procname	=
 				nf_log_sysctl_fnames[i];
 			nf_log_sysctl_table[i].data = NULL;
-			nf_log_sysctl_table[i].maxlen =
-				NFLOGGER_NAME_LEN * sizeof(char);
+			nf_log_sysctl_table[i].maxlen = NFLOGGER_NAME_LEN;
 			nf_log_sysctl_table[i].mode = 0644;
 			nf_log_sysctl_table[i].proc_handler =
 				nf_log_proc_dostring;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 8/8] netfilter: conntrack: Remove nf_ct_conntrack_flush_report
From: Pablo Neira Ayuso @ 2015-01-14 20:34 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev
In-Reply-To: <1421267689-24894-1-git-send-email-pablo@netfilter.org>

From: Kristian Evensen <kristian.evensen@gmail.com>

The only user of nf_ct_conntrack_flush_report() was ctnetlink_del_conntrack().
After adding support for flushing connections with a given mark, this function
is no longer called.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/net/netfilter/nf_conntrack.h |    2 --
 net/netfilter/nf_conntrack_core.c    |    6 ------
 2 files changed, 8 deletions(-)

diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index f0daed2..74f271a 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -191,8 +191,6 @@ __nf_conntrack_find(struct net *net, u16 zone,
 int nf_conntrack_hash_check_insert(struct nf_conn *ct);
 bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
 
-void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
-
 bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
 		       u_int16_t l3num, struct nf_conntrack_tuple *tuple);
 bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index da58cd4..5a6990b 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1426,12 +1426,6 @@ void nf_ct_free_hashtable(void *hash, unsigned int size)
 }
 EXPORT_SYMBOL_GPL(nf_ct_free_hashtable);
 
-void nf_conntrack_flush_report(struct net *net, u32 portid, int report)
-{
-	nf_ct_iterate_cleanup(net, kill_all, NULL, portid, report);
-}
-EXPORT_SYMBOL_GPL(nf_conntrack_flush_report);
-
 static int untrack_refs(void)
 {
 	int cnt = 0, cpu;
-- 
1.7.10.4

^ permalink raw reply related


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