* Re: [PATCH] net: ethernet : stmicro: fixed power suspend and resume failure in stmmac driver
From: Giuseppe CAVALLARO @ 2014-10-16 8:58 UTC (permalink / raw)
To: hliang1025; +Cc: David Miller, netdev, linux-kernel, adi-linux-docs
In-Reply-To: <20141001.134508.1301867654128829684.davem@davemloft.net>
Hello Hao Liang
On 10/1/2014 7:45 PM, David Miller wrote:
> From: Hao Liang <hliang1025@gmail.com>
> Date: Wed, 1 Oct 2014 14:08:28 +0800
>
>> I double-check my patch and the ->mac->xxx calls are still under the lock.
>> I think that lock is trying to protect priv struct and related data, so i
>> just remove some functions have no bearing on priv struct.
>
> It's preventing parallel invocations of the ->mac->xxx calls.
>
> The other instances are in device open/close, where RTNL semaphore is
> held, and no other code paths in the driver can be active.
>
> You need the lock.
Do you have a new patch for this problem after David's advice?
I am reviewing the patches sent some weeks ago for driver looking
and I can also try to fix this in case of you have no news.
Let me know,
Regards,
peppe
^ permalink raw reply
* [PATCH] vxlan: small improvements
From: roy.qing.li @ 2014-10-16 9:00 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
1. remove the dead codes, pr_fmt definition and vxlan_salt variable
2. pskb_may_pull() can change skb->data, so we have to reload eth in vxlan_xmit.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
drivers/net/vxlan.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 77ab844..3a07fbf 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -8,8 +8,6 @@
* published by the Free Software Foundation.
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/module.h>
@@ -152,8 +150,6 @@ struct vxlan_dev {
struct hlist_head fdb_head[FDB_HASH_SIZE];
};
-/* salt for hash table */
-static u32 vxlan_salt __read_mostly;
static struct workqueue_struct *vxlan_wq;
static void vxlan_sock_work(struct work_struct *work);
@@ -1890,6 +1886,7 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
#endif
}
+ eth = eth_hdr(skb);
f = vxlan_find_mac(vxlan, eth->h_dest);
did_rsc = false;
@@ -2797,8 +2794,6 @@ static int __init vxlan_init_module(void)
if (!vxlan_wq)
return -ENOMEM;
- get_random_bytes(&vxlan_salt, sizeof(vxlan_salt));
-
rc = register_pernet_subsys(&vxlan_net_ops);
if (rc)
goto out1;
--
1.7.10.4
^ permalink raw reply related
* [PATCH] openvswitch: fix a use after free
From: roy.qing.li @ 2014-10-16 9:01 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
pskb_may_pull() called by arphdr_ok can change skb->data, so put the arp
setting after arphdr_ok to avoid the use the freed memory
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/openvswitch/flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 62db02b..b13ba5e 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -557,10 +557,11 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
} else if (key->eth.type == htons(ETH_P_ARP) ||
key->eth.type == htons(ETH_P_RARP)) {
struct arp_eth_header *arp;
+ bool arp_t = arphdr_ok(skb);
arp = (struct arp_eth_header *)skb_network_header(skb);
- if (arphdr_ok(skb) &&
+ if (arp_t &&
arp->ar_hrd == htons(ARPHRD_ETHER) &&
arp->ar_pro == htons(ETH_P_IP) &&
arp->ar_hln == ETH_ALEN &&
--
1.7.10.4
^ permalink raw reply related
* [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-16
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to fm10k and ixgbe.
Matthew provides two fixes for fm10k, first sets the flag to fetch the
host state before kicking off the service task that reads the host
state when bringing the interface up. The second makes sure that we
release the mailbox lock after detecting an error and before we return
the error code.
Andy Zhou provides a compile fix for fm10k, when the driver is compiled
into the kernel and the VXLAN driver is compiled as a module.
Emil provides a fix for ixgbe to prevent against a panic by trying
to dereference a NULL pointer in ixgbe_ndo_set_vf_spoofchk().
The following are changes since commit 91269e390d062b526432f2ef1352b8df82e0e0bc:
vxlan: using pskb_may_pull as early as possible
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master
Andy Zhou (1):
fm10k: Add CONFIG_FM10K_VXLAN configuration option
Emil Tantilov (1):
ixgbe: check for vfs outside of sriov_num_vfs before dereference
Matthew Vick (2):
fm10k: Check the host state when bringing the interface up
fm10k: Unlock mailbox on VLAN addition failures
drivers/net/ethernet/intel/Kconfig | 11 +++++++++++
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 13 +++++++------
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 1 +
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +++
4 files changed, 22 insertions(+), 6 deletions(-)
--
1.9.3
^ permalink raw reply
* [net 2/4] fm10k: Unlock mailbox on VLAN addition failures
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Matthew Vick, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1413452187-2950-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Matthew Vick <matthew.vick@intel.com>
After grabbing the mailbox lock and detecting an error, the lock must be
released before the error code can be returned.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index bf44a8f..b57ea1c 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -785,14 +785,14 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
if (!(netdev->flags & IFF_PROMISC)) {
err = hw->mac.ops.update_vlan(hw, vid, 0, set);
if (err)
- return err;
+ goto err_out;
}
/* update our base MAC address */
err = hw->mac.ops.update_uc_addr(hw, interface->glort, hw->mac.addr,
vid, set, 0);
if (err)
- return err;
+ goto err_out;
/* set vid prior to syncing/unsyncing the VLAN */
interface->vid = vid + (set ? VLAN_N_VID : 0);
@@ -801,9 +801,10 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)
__dev_uc_unsync(netdev, fm10k_uc_vlan_unsync);
__dev_mc_unsync(netdev, fm10k_mc_vlan_unsync);
+err_out:
fm10k_mbx_unlock(interface);
- return 0;
+ return err;
}
static int fm10k_vlan_rx_add_vid(struct net_device *netdev,
--
1.9.3
^ permalink raw reply related
* [net 1/4] fm10k: Check the host state when bringing the interface up
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Matthew Vick, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1413452187-2950-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Matthew Vick <matthew.vick@intel.com>
Set the flag to fetch the host state before kicking off the service task
that reads the host state when bringing the interface back up.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index e02036c..a0cb74a 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1489,6 +1489,7 @@ void fm10k_up(struct fm10k_intfc *interface)
netif_tx_start_all_queues(interface->netdev);
/* kick off the service timer */
+ hw->mac.get_host_state = 1;
mod_timer(&interface->service_timer, jiffies);
}
--
1.9.3
^ permalink raw reply related
* [net 4/4] ixgbe: check for vfs outside of sriov_num_vfs before dereference
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1413452187-2950-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Emil Tantilov <emil.s.tantilov@intel.com>
The check for vfinfo is not sufficient because it does not protect
against specifying vf that is outside of sriov_num_vfs range.
All of the ndo functions have a check for it except for
ixgbevf_ndo_set_spoofcheck().
The following patch is all we need to protect against this panic:
ip link set p96p1 vf 0 spoofchk off
BUG: unable to handle kernel NULL pointer dereference at 0000000000000052
IP: [<ffffffffa044a1c1>]
ixgbe_ndo_set_vf_spoofchk+0x51/0x150 [ixgbe]
Reported-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 706fc69..97c85b8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -1261,6 +1261,9 @@ int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
struct ixgbe_hw *hw = &adapter->hw;
u32 regval;
+ if (vf >= adapter->num_vfs)
+ return -EINVAL;
+
adapter->vfinfo[vf].spoofchk_enabled = setting;
regval = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
--
1.9.3
^ permalink raw reply related
* [net 3/4] fm10k: Add CONFIG_FM10K_VXLAN configuration option
From: Jeff Kirsher @ 2014-10-16 9:36 UTC (permalink / raw)
To: davem; +Cc: Andy Zhou, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1413452187-2950-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Andy Zhou <azhou@nicira.com>
Compiling with CONFIG_FM10K=y and VXLAN=m resulting in linking error:
drivers/built-in.o: In function `fm10k_open':
(.text+0x1f9d7a): undefined reference to `vxlan_get_rx_port'
make: *** [vmlinux] Error 1
The fix follows the same strategy as I40E.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/Kconfig | 11 +++++++++++
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 6919adb..5b8300a 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -320,4 +320,15 @@ config FM10K
To compile this driver as a module, choose M here. The module
will be called fm10k. MSI-X interrupt support is required
+config FM10K_VXLAN
+ bool "Virtual eXtensible Local Area Network Support"
+ default n
+ depends on FM10K && VXLAN && !(FM10K=y && VXLAN=m)
+ ---help---
+ This allows one to create VXLAN virtual interfaces that provide
+ Layer 2 Networks over Layer 3 Networks. VXLAN is often used
+ to tunnel virtual network infrastructure in virtualized environments.
+ Say Y here if you want to use Virtual eXtensible Local Area Network
+ (VXLAN) in the driver.
+
endif # NET_VENDOR_INTEL
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index b57ea1c..8811364 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -20,9 +20,9 @@
#include "fm10k.h"
#include <linux/vmalloc.h>
-#if IS_ENABLED(CONFIG_VXLAN)
+#if IS_ENABLED(CONFIG_FM10K_VXLAN)
#include <net/vxlan.h>
-#endif /* CONFIG_VXLAN */
+#endif /* CONFIG_FM10K_VXLAN */
/**
* fm10k_setup_tx_resources - allocate Tx resources (Descriptors)
@@ -556,7 +556,7 @@ int fm10k_open(struct net_device *netdev)
if (err)
goto err_set_queues;
-#if IS_ENABLED(CONFIG_VXLAN)
+#if IS_ENABLED(CONFIG_FM10K_VXLAN)
/* update VXLAN port configuration */
vxlan_get_rx_port(netdev);
--
1.9.3
^ permalink raw reply related
* Re: [PATCH RFT 0/8] Marvell PXA168 libphy handling and Berlin Ethernet
From: Antoine Tenart @ 2014-10-16 9:53 UTC (permalink / raw)
To: Sebastian Hesselbarth
Cc: David S. Miller, Antoine Ténart, Florian Fainelli, Eric Miao,
Haojian Zhuang, linux-arm-kernel, netdev, devicetree,
linux-kernel
In-Reply-To: <1412858346-11334-1-git-send-email-sebastian.hesselbarth@gmail.com>
Hi Sebastian,
On Thu, Oct 09, 2014 at 02:38:58PM +0200, Sebastian Hesselbarth wrote:
> This patch series deals with a removing a IP feature that can be found
> on all currently supported Marvell Ethernet IP (pxa168_eth, mv643xx_eth,
> mvneta). The MAC IP allows to automatically perform PHY auto-negotiation
> without software interaction.
>
> However, this feature (a) fundamentally clashes with the way libphy works
> and (b) is unable to deal with quirky PHYs that require special treatment.
> In this series, pxa168_eth driver is rewritten to completely disable that
> feature and properly deal with libphy provided PHYs. The other two drivers
> are suspect to future patch sets, also removing the code related with it.
>
> Currently, the patches are based on next-20141009 and will be resent once
> v3.18-rc1 drops. This is a Request-For-Test on both BG2Q and MMP/gplug as
I tested the series on a BG2Q, it worked well.
Antoine
> these are the current users of pxa168_eth. A branch with this patches on
> top of next-20141009 can be found at
>
> git://git.infradead.org/users/hesselba/linux-berlin.git devel/bg2-bg2cd-eth-v1
>
> It would be great to get a Tested-byfrom MMP guys on gplug - if they
> have that board somewhere. Also, BG2Q (Antoine) needs a phy-connection-type
> property. My guess is that, if it is using internal PHY, it is "mii", too.
--
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH] vxlan: small improvements
From: Stephen Hemminger @ 2014-10-16 13:05 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
In-Reply-To: <1413450045-5008-1-git-send-email-roy.qing.li@gmail.com>
On Thu, 16 Oct 2014 17:00:44 +0800
roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> 1. remove the dead codes, pr_fmt definition and vxlan_salt variable
> 2. pskb_may_pull() can change skb->data, so we have to reload eth in vxlan_xmit.
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
You are doing 4 things in one patch.
The pr_fmt definition is standard way to identify where log messages orginate
^ permalink raw reply
* [PATCH net] netlink: fix description of portid
From: Nicolas Dichtel @ 2014-10-16 13:47 UTC (permalink / raw)
To: davem; +Cc: netdev, Nicolas Dichtel
Avoid confusion between pid and portid.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
include/net/netlink.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 6c1076275aaa..7b903e1bdbbb 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -431,7 +431,7 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh)
/**
* nlmsg_put - Add a new netlink message to an skb
* @skb: socket buffer to store message in
- * @portid: netlink process id
+ * @portid: netlink PORTID of requesting application
* @seq: sequence number of message
* @type: message type
* @payload: length of message payload
--
2.1.0
^ permalink raw reply related
* Re: [PATCH] vxlan: small improvements
From: Eric Dumazet @ 2014-10-16 14:05 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
In-Reply-To: <1413450045-5008-1-git-send-email-roy.qing.li@gmail.com>
On Thu, 2014-10-16 at 17:00 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> 1. remove the dead codes, pr_fmt definition and vxlan_salt variable
> 2. pskb_may_pull() can change skb->data, so we have to reload eth in vxlan_xmit.
I do not see this particular bug in my tree ???
Wait, you added this in a recent commit. Please add
Fixes: 91269e390d062 ("vxlan: using pskb_may_pull as early as possible")
Do not be shy, or hide, try to ease stable teams work, please ?
Thanks.
^ permalink raw reply
* Re: [PATCH] openvswitch: fix a use after free
From: Eric Dumazet @ 2014-10-16 14:12 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev, Jesse Gross, Andy Zhou, Pravin B Shelar
In-Reply-To: <1413450075-5044-1-git-send-email-roy.qing.li@gmail.com>
On Thu, 2014-10-16 at 17:01 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> pskb_may_pull() called by arphdr_ok can change skb->data, so put the arp
> setting after arphdr_ok to avoid the use the freed memory
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> net/openvswitch/flow.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
> index 62db02b..b13ba5e 100644
> --- a/net/openvswitch/flow.c
> +++ b/net/openvswitch/flow.c
> @@ -557,10 +557,11 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
> } else if (key->eth.type == htons(ETH_P_ARP) ||
> key->eth.type == htons(ETH_P_RARP)) {
> struct arp_eth_header *arp;
> + bool arp_t = arphdr_ok(skb);
This is a strange name for a bool. _t suffix is normally used by
typedef.
>
> arp = (struct arp_eth_header *)skb_network_header(skb);
>
> - if (arphdr_ok(skb) &&
> + if (arp_t &&
> arp->ar_hrd == htons(ARPHRD_ETHER) &&
> arp->ar_pro == htons(ETH_P_IP) &&
> arp->ar_hln == ETH_ALEN &&
Fixes: 0714812134d7d ("openvswitch: Eliminate memset() from flow_extract.")
By doing this bug hunting, you also can CC bug author so that he knows
what happened. Maybe he will avoid similar mistakes in the future.
^ permalink raw reply
* [PATCH iproute2] ss: Use generic handle_netlink_request for packet
From: Vadim Kochan @ 2014-10-16 14:40 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
Get rid of self-handling and creating of Netlink socket for show packet
socket stats.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
misc/ss.c | 80 +++------------------------------------------------------------
1 file changed, 3 insertions(+), 77 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 2420b51..b3cc455 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2777,17 +2777,11 @@ static int packet_show_sock(struct nlmsghdr *nlh, struct filter *f)
static int packet_show_netlink(struct filter *f, FILE *dump_fp)
{
- int fd;
struct {
struct nlmsghdr nlh;
struct packet_diag_req r;
- } req;
- char buf[8192];
-
- if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG)) < 0)
- return -1;
+ } req = {};
- memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = sizeof(req);
req.nlh.nlmsg_type = SOCK_DIAG_BY_FAMILY;
req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST;
@@ -2796,76 +2790,8 @@ static int packet_show_netlink(struct filter *f, FILE *dump_fp)
req.r.sdiag_family = AF_PACKET;
req.r.pdiag_show = PACKET_SHOW_INFO | PACKET_SHOW_MEMINFO | PACKET_SHOW_FILTER;
- if (send(fd, &req, sizeof(req), 0) < 0) {
- close(fd);
- return -1;
- }
-
- while (1) {
- ssize_t status;
- struct nlmsghdr *h;
- struct sockaddr_nl nladdr;
- socklen_t slen = sizeof(nladdr);
-
- status = recvfrom(fd, buf, sizeof(buf), 0,
- (struct sockaddr *) &nladdr, &slen);
- if (status < 0) {
- if (errno == EINTR)
- continue;
- perror("OVERRUN");
- continue;
- }
- if (status == 0) {
- fprintf(stderr, "EOF on netlink\n");
- goto close_it;
- }
-
- if (dump_fp)
- fwrite(buf, 1, NLMSG_ALIGN(status), dump_fp);
-
- h = (struct nlmsghdr*)buf;
- while (NLMSG_OK(h, status)) {
- int err;
-
- if (h->nlmsg_seq != 123456)
- goto skip_it;
-
- if (h->nlmsg_type == NLMSG_DONE)
- goto close_it;
-
- if (h->nlmsg_type == NLMSG_ERROR) {
- struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
- if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
- fprintf(stderr, "ERROR truncated\n");
- } else {
- errno = -err->error;
- if (errno != ENOENT)
- fprintf(stderr, "UDIAG answers %d\n", errno);
- }
- close(fd);
- return -1;
- }
- if (!dump_fp) {
- err = packet_show_sock(h, f);
- if (err < 0) {
- close(fd);
- return err;
- }
- }
-
-skip_it:
- h = NLMSG_NEXT(h, status);
- }
-
- if (status) {
- fprintf(stderr, "!!!Remnant of size %zd\n", status);
- exit(1);
- }
- }
-
-close_it:
- close(fd);
- return 0;
+ return handle_netlink_request(f, dump_fp, &req.nlh, sizeof(req),
+ packet_show_sock);
}
--
2.1.0
^ permalink raw reply related
* Re: [PATCH] openvswitch: fix a use after free
From: Jesse Gross @ 2014-10-16 14:58 UTC (permalink / raw)
To: Eric Dumazet; +Cc: roy.qing.li, netdev, Andy Zhou, Pravin B Shelar
In-Reply-To: <1413468747.28798.19.camel@edumazet-glaptop2.roam.corp.google.com>
On Thu, Oct 16, 2014 at 4:12 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2014-10-16 at 17:01 +0800, roy.qing.li@gmail.com wrote:
>>
>> arp = (struct arp_eth_header *)skb_network_header(skb);
>>
>> - if (arphdr_ok(skb) &&
>> + if (arp_t &&
>> arp->ar_hrd == htons(ARPHRD_ETHER) &&
>> arp->ar_pro == htons(ETH_P_IP) &&
>> arp->ar_hln == ETH_ALEN &&
>
> Fixes: 0714812134d7d ("openvswitch: Eliminate memset() from flow_extract.")
>
> By doing this bug hunting, you also can CC bug author so that he knows
> what happened. Maybe he will avoid similar mistakes in the future.
Yes, this one is my fault. Thanks for tracking it down.
^ permalink raw reply
* [PATCH] [trivial] treewide: Fix company name in module descriptions
From: Masanari Iida @ 2014-10-16 15:09 UTC (permalink / raw)
To: linux-kernel, mturquette, trivial, linus.walleij, gnurou,
jcliburn, chris.snook, viresh.linux, inki.dae, dh09.lee,
kgene.kim, rdunlap
Cc: netdev, Masanari Iida
This patch fix company name's spelling typo in module descriptions
and a Kconfig.
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
---
drivers/clk/Kconfig | 2 +-
drivers/gpio/gpio-spear-spics.c | 2 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
drivers/pinctrl/spear/pinctrl-plgpio.c | 2 +-
drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 2 +-
drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 455fd17..3f44f29 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -28,7 +28,7 @@ config COMMON_CLK_WM831X
depends on MFD_WM831X
---help---
Supports the clocking subsystem of the WM831x/2x series of
- PMICs from Wolfson Microlectronics.
+ PMICs from Wolfson Microelectronics.
source "drivers/clk/versatile/Kconfig"
diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
index 353263c..506a2ea 100644
--- a/drivers/gpio/gpio-spear-spics.c
+++ b/drivers/gpio/gpio-spear-spics.c
@@ -204,5 +204,5 @@ static int __init spics_gpio_init(void)
subsys_initcall(spics_gpio_init);
MODULE_AUTHOR("Shiraz Hashim <shiraz.linux.kernel@gmail.com>");
-MODULE_DESCRIPTION("ST Microlectronics SPEAr SPI Chip Select Abstraction");
+MODULE_DESCRIPTION("STMicroelectronics SPEAr SPI Chip Select Abstraction");
MODULE_LICENSE("GPL");
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 72fb86b..c9946c6 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -48,7 +48,7 @@ MODULE_DEVICE_TABLE(pci, atl1c_pci_tbl);
MODULE_AUTHOR("Jie Yang");
MODULE_AUTHOR("Qualcomm Atheros Inc., <nic-devel@qualcomm.com>");
-MODULE_DESCRIPTION("Qualcom Atheros 100/1000M Ethernet Network Driver");
+MODULE_DESCRIPTION("Qualcomm Atheros 100/1000M Ethernet Network Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(ATL1C_DRV_VERSION);
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index bddb791..ce5f22c 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -724,5 +724,5 @@ static int __init plgpio_init(void)
subsys_initcall(plgpio_init);
MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>");
-MODULE_DESCRIPTION("ST Microlectronics SPEAr PLGPIO driver");
+MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
index cee9602..716bfad 100644
--- a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
@@ -570,5 +570,5 @@ static struct platform_driver exynos_mipi_dsi_driver = {
module_platform_driver(exynos_mipi_dsi_driver);
MODULE_AUTHOR("InKi Dae <inki.dae@samsung.com>");
-MODULE_DESCRIPTION("Samusung SoC MIPI-DSI driver");
+MODULE_DESCRIPTION("Samsung SoC MIPI-DSI driver");
MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
index 85edabf..2358a2f 100644
--- a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
+++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
@@ -876,5 +876,5 @@ int exynos_mipi_dsi_fifo_clear(struct mipi_dsim_device *dsim,
}
MODULE_AUTHOR("InKi Dae <inki.dae@samsung.com>");
-MODULE_DESCRIPTION("Samusung SoC MIPI-DSI common driver");
+MODULE_DESCRIPTION("Samsung SoC MIPI-DSI common driver");
MODULE_LICENSE("GPL");
--
2.1.2.443.g670a3c1
^ permalink raw reply related
* Re: [PATCH] net: use hardware buffer pool to allocate skb
From: Alexander Duyck @ 2014-10-16 15:28 UTC (permalink / raw)
To: Jiafei.Pan@freescale.com, Eric Dumazet
Cc: David Miller, jkosina@suse.cz, netdev@vger.kernel.org,
LeoLi@freescale.com, linux-doc@vger.kernel.org
In-Reply-To: <aeef795129504782ae1e9f91467d243e@BLUPR03MB517.namprd03.prod.outlook.com>
On 10/15/2014 10:15 PM, Jiafei.Pan@freescale.com wrote:
>> -----Original Message-----
>> From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
>> Sent: Thursday, October 16, 2014 12:15 PM
>> To: Pan Jiafei-B37022
>> Cc: David Miller; jkosina@suse.cz; netdev@vger.kernel.org; Li Yang-Leo-R58472;
>> linux-doc@vger.kernel.org
>> Subject: Re: [PATCH] net: use hardware buffer pool to allocate skb
>>
>> On Thu, 2014-10-16 at 02:17 +0000, Jiafei.Pan@freescale.com wrote:
>>
>>> Thanks for your comments and suggestion. In my case, I want to build skb
>>> from hardware block specified memory, I only can see two ways, one is modified
>>> net card driver replace common skb allocation function with my specially
>>> functions, another way is to hack common skb allocation function in which
>>> redirect to my specially functions. My patch is just for the second way.
>>> Except these two ways, would you please give me some advice for some other
>>> ways for my case? Thanks
>> I suggest you read drivers/net/ethernet numerous examples.
>>
>> No need to change anything in net/* or include/*, really.
>>
>> For a start, look at drivers/net/ethernet/intel/igb/igb_main.c
>>
>> Mentioning 'hack' in your mails simply should hint you are doing
>> something very wrong.
>>
>> What makes you think your hardware is so special ?
>>
> In fact, I am developing a bridge driver, it can bridge between any other the
> third party net card and my own net card. My target is to let any other the
> third party net card can directly use my own net card specified buffer, then
> there will be no memory copy in the whole bridge process.
> By the way, I don’t see any similar between igb_main.c and my case. And also
> My bridge also can’t implemented with "skb frag" in order to aim at zero memory
> copy.
I think the part you are not getting is that is how buffers are
essentially handled now. So for example in the case if igb the only
part we have copied out is usually the header, or the entire frame in
the case of small packets. This has to happen in order to allow for
changes to the header for routing and such. Beyond that the frags that
are passed are the buffers that igb is still holding onto. So
effectively what the other device transmits in a bridging/routing
scenario is my own net card specified buffer plus the copied/modified
header.
For a brief period igb used build_skb but that isn't valid on most
systems as memory mapped for a device can be overwritten if the page is
unmapped resulting in any changes to the header for routing/bridging
purposes being invalidated. Thus we cannot use the buffers for both the
skb->data header which may be changed and Rx DMA simultaneously.
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH RFC net-next] sfc: add support for skb->xmit_more
From: Jonathan Cooper @ 2014-10-16 15:42 UTC (permalink / raw)
To: David Miller; +Cc: ecree, dborkman, nikolay, netdev, sshah, linux-net-drivers
In-Reply-To: <20141015.122034.126232757997381022.davem@davemloft.net>
On 15/10/14 17:20, David Miller wrote:
> From: Edward Cree <ecree@solarflare.com>
> Date: Wed, 15 Oct 2014 12:05:35 +0100
>
>> On 14/10/14 22:15, David Miller wrote:
>>> From: Edward Cree <ecree@solarflare.com>
>>> Date: Tue, 14 Oct 2014 19:41:37 +0100
>>>
>>>> Don't ring the doorbell, and don't do PIO. This will also prevent
>>>> TX Push, because there will be more than one buffer waiting when
>>>> the doorbell is rung.
>>>>
>>>> Signed-off-by: Edward Cree <ecree@solarflare.com>
>>> This looks good to me, mind if I apply this now?
>> I'd rather wait until Jon Cooper's had a chance to look at it; he
>> understands our TX path better than I.
> Ok.
Looks good to me.
Acked-by: Jon Cooper <jcooper@solarflare.com>
^ permalink raw reply
* Re: [PATCH RFC net-next] sfc: add support for skb->xmit_more
From: Robert Stonehouse @ 2014-10-16 16:36 UTC (permalink / raw)
To: Edward Cree, Daniel Borkmann
Cc: davem, nikolay, netdev, Shradha Shah, Jon Cooper,
linux-net-drivers
In-Reply-To: <alpine.LFD.2.03.1410141933500.26972@solarflare.com>
On 14/10/14 19:41, Edward Cree wrote:
> Don't ring the doorbell, and don't do PIO. This will also prevent
> TX Push, because there will be more than one buffer waiting when
> the doorbell is rung.
>
> Signed-off-by: Edward Cree <ecree@solarflare.com>
> ---
>
> @@ -351,8 +343,6 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb)
> unsigned short dma_flags;
> int i = 0;
>
> - EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count);
> -
> if (skb_shinfo(skb)->gso_size)
> return efx_enqueue_skb_tso(tx_queue, skb);
Would it be possible to keep a weaker version of this check i.e.
EFX_BUG_ON_PARANOID(tx_queue->write_count > tx_queue->insert_count);
> @@ -1258,14 +1249,13 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue,
> struct sk_buff *skb)
> {
> struct efx_nic *efx = tx_queue->efx;
> + unsigned int old_insert_count = tx_queue->insert_count;
> int frag_i, rc;
> struct tso_state state;
>
> /* Find the packet protocol and sanity-check it */
> state.protocol = efx_tso_check_protocol(skb);
>
> - EFX_BUG_ON_PARANOID(tx_queue->write_count != tx_queue->insert_count);
> -
> rc = tso_start(&state, efx, skb);
> if (rc)
> goto mem_err;
The same would apply here.
Thanks
Rob
^ permalink raw reply
* [PATCH iproute2] ss: Identify a lot of netlink protocol names
From: Vadim Kochan @ 2014-10-16 16:46 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
There were only few Netlink protocol names:
rtnl, fw, tcpdiag
which were printed on output.
So added the other ones.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
misc/ss.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 55 insertions(+), 6 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 2420b51..576db4e 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2960,12 +2960,63 @@ static int packet_show(struct filter *f)
return 0;
}
+static char *netlink_proto_name(int proto)
+{
+ switch (proto)
+ {
+ case NETLINK_ROUTE:
+ return "rtnl";
+ case NETLINK_USERSOCK:
+ return "user";
+ case NETLINK_FIREWALL:
+ return "fw";
+ case NETLINK_SOCK_DIAG:
+ return "tcpdiag";
+ case NETLINK_NFLOG:
+ return "nflog";
+ case NETLINK_XFRM:
+ return "xfrm";
+ case NETLINK_SELINUX:
+ return "selinux";
+ case NETLINK_ISCSI:
+ return "iscsi";
+ case NETLINK_AUDIT:
+ return "audit";
+ case NETLINK_FIB_LOOKUP:
+ return "fiblookup";
+ case NETLINK_CONNECTOR:
+ return "conn";
+ case NETLINK_NETFILTER:
+ return "nft";
+ case NETLINK_IP6_FW:
+ return "ip6fw";
+ case NETLINK_DNRTMSG:
+ return "decrt";
+ case NETLINK_KOBJECT_UEVENT:
+ return "uevent";
+ case NETLINK_GENERIC:
+ return "genl";
+ case NETLINK_SCSITRANSPORT:
+ return "scsitrans";
+ case NETLINK_ECRYPTFS:
+ return "ecryptfs";
+ case NETLINK_RDMA:
+ return "rdma";
+ case NETLINK_CRYPTO:
+ return "crypto";
+ }
+
+ return NULL;
+};
+
static void netlink_show_one(struct filter *f,
int prot, int pid, unsigned groups,
int state, int dst_pid, unsigned dst_group,
int rq, int wq,
unsigned long long sk, unsigned long long cb)
{
+ char *prot_name;
+
if (f->f) {
struct tcpstat tst;
tst.local.family = AF_NETLINK;
@@ -2983,14 +3034,12 @@ static void netlink_show_one(struct filter *f,
if (state_width)
printf("%-*s ", state_width, "UNCONN");
printf("%-6d %-6d ", rq, wq);
- if (resolve_services && prot == 0)
- printf("%*s:", addr_width, "rtnl");
- else if (resolve_services && prot == 3)
- printf("%*s:", addr_width, "fw");
- else if (resolve_services && prot == 4)
- printf("%*s:", addr_width, "tcpdiag");
+
+ if (resolve_services && (prot_name = netlink_proto_name(prot)))
+ printf("%*s:", addr_width, prot_name);
else
printf("%*d:", addr_width, prot);
+
if (pid == -1) {
printf("%-*s ", serv_width, "*");
} else if (resolve_services) {
--
2.1.0
^ permalink raw reply related
* Re: [PATCH] net: use hardware buffer pool to allocate skb
From: Eric Dumazet @ 2014-10-16 16:57 UTC (permalink / raw)
To: Alexander Duyck
Cc: Jiafei.Pan@freescale.com, David Miller, jkosina@suse.cz,
netdev@vger.kernel.org, LeoLi@freescale.com,
linux-doc@vger.kernel.org
In-Reply-To: <543FE413.6030406@redhat.com>
On Thu, 2014-10-16 at 08:28 -0700, Alexander Duyck wrote:
> I think the part you are not getting is that is how buffers are
> essentially handled now. So for example in the case if igb the only
> part we have copied out is usually the header, or the entire frame in
> the case of small packets. This has to happen in order to allow for
> changes to the header for routing and such. Beyond that the frags that
> are passed are the buffers that igb is still holding onto. So
> effectively what the other device transmits in a bridging/routing
> scenario is my own net card specified buffer plus the copied/modified
> header.
>
> For a brief period igb used build_skb but that isn't valid on most
> systems as memory mapped for a device can be overwritten if the page is
> unmapped resulting in any changes to the header for routing/bridging
> purposes being invalidated. Thus we cannot use the buffers for both the
> skb->data header which may be changed and Rx DMA simultaneously.
This reminds me that igb still has skb->truesize underestimation by 100%
If a fragment is held in some socket receive buffer, a full page is
consumed, not 2048 bytes.
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a21b14495ebd..56ca6c78985e 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6586,9 +6586,11 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
struct page *page = rx_buffer->page;
unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
#if (PAGE_SIZE < 8192)
- unsigned int truesize = IGB_RX_BUFSZ;
+ unsigned int segsize = IGB_RX_BUFSZ;
+ unsigned int truesize = PAGE_SIZE;
#else
- unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
+ unsigned int segsize = ALIGN(size, L1_CACHE_BYTES);
+ unsigned int truesize = segsize;
#endif
if ((size <= IGB_RX_HDR_LEN) && !skb_is_nonlinear(skb)) {
@@ -6614,7 +6616,7 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
rx_buffer->page_offset, size, truesize);
- return igb_can_reuse_rx_page(rx_buffer, page, truesize);
+ return igb_can_reuse_rx_page(rx_buffer, page, segsize);
}
static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring,
^ permalink raw reply related
* Re: [PATCH] [trivial] treewide: Fix company name in module descriptions
From: Randy Dunlap @ 2014-10-16 17:01 UTC (permalink / raw)
To: Masanari Iida, linux-kernel, mturquette, trivial, linus.walleij,
gnurou, jcliburn, chris.snook, viresh.linux, inki.dae, dh09.lee,
kgene.kim
Cc: netdev
In-Reply-To: <1413472164-22366-1-git-send-email-standby24x7@gmail.com>
On 10/16/14 08:09, Masanari Iida wrote:
> This patch fix company name's spelling typo in module descriptions
> and a Kconfig.
>
> Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> drivers/clk/Kconfig | 2 +-
> drivers/gpio/gpio-spear-spics.c | 2 +-
> drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
> drivers/pinctrl/spear/pinctrl-plgpio.c | 2 +-
> drivers/video/fbdev/exynos/exynos_mipi_dsi.c | 2 +-
> drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c | 2 +-
> 6 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 455fd17..3f44f29 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -28,7 +28,7 @@ config COMMON_CLK_WM831X
> depends on MFD_WM831X
> ---help---
> Supports the clocking subsystem of the WM831x/2x series of
> - PMICs from Wolfson Microlectronics.
> + PMICs from Wolfson Microelectronics.
>
> source "drivers/clk/versatile/Kconfig"
>
> diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
> index 353263c..506a2ea 100644
> --- a/drivers/gpio/gpio-spear-spics.c
> +++ b/drivers/gpio/gpio-spear-spics.c
> @@ -204,5 +204,5 @@ static int __init spics_gpio_init(void)
> subsys_initcall(spics_gpio_init);
>
> MODULE_AUTHOR("Shiraz Hashim <shiraz.linux.kernel@gmail.com>");
> -MODULE_DESCRIPTION("ST Microlectronics SPEAr SPI Chip Select Abstraction");
> +MODULE_DESCRIPTION("STMicroelectronics SPEAr SPI Chip Select Abstraction");
> MODULE_LICENSE("GPL");
> diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
> index 72fb86b..c9946c6 100644
> --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
> +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
> @@ -48,7 +48,7 @@ MODULE_DEVICE_TABLE(pci, atl1c_pci_tbl);
>
> MODULE_AUTHOR("Jie Yang");
> MODULE_AUTHOR("Qualcomm Atheros Inc., <nic-devel@qualcomm.com>");
> -MODULE_DESCRIPTION("Qualcom Atheros 100/1000M Ethernet Network Driver");
> +MODULE_DESCRIPTION("Qualcomm Atheros 100/1000M Ethernet Network Driver");
> MODULE_LICENSE("GPL");
> MODULE_VERSION(ATL1C_DRV_VERSION);
>
> diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
> index bddb791..ce5f22c 100644
> --- a/drivers/pinctrl/spear/pinctrl-plgpio.c
> +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
> @@ -724,5 +724,5 @@ static int __init plgpio_init(void)
> subsys_initcall(plgpio_init);
>
> MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>");
> -MODULE_DESCRIPTION("ST Microlectronics SPEAr PLGPIO driver");
> +MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> index cee9602..716bfad 100644
> --- a/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> +++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi.c
> @@ -570,5 +570,5 @@ static struct platform_driver exynos_mipi_dsi_driver = {
> module_platform_driver(exynos_mipi_dsi_driver);
>
> MODULE_AUTHOR("InKi Dae <inki.dae@samsung.com>");
> -MODULE_DESCRIPTION("Samusung SoC MIPI-DSI driver");
> +MODULE_DESCRIPTION("Samsung SoC MIPI-DSI driver");
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> index 85edabf..2358a2f 100644
> --- a/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> +++ b/drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c
> @@ -876,5 +876,5 @@ int exynos_mipi_dsi_fifo_clear(struct mipi_dsim_device *dsim,
> }
>
> MODULE_AUTHOR("InKi Dae <inki.dae@samsung.com>");
> -MODULE_DESCRIPTION("Samusung SoC MIPI-DSI common driver");
> +MODULE_DESCRIPTION("Samsung SoC MIPI-DSI common driver");
> MODULE_LICENSE("GPL");
>
--
~Randy
^ permalink raw reply
* Re: [PATCH] net: use hardware buffer pool to allocate skb
From: Alexander Duyck @ 2014-10-16 17:10 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jiafei.Pan@freescale.com, David Miller, jkosina@suse.cz,
netdev@vger.kernel.org, LeoLi@freescale.com,
linux-doc@vger.kernel.org
In-Reply-To: <1413478657.28798.22.camel@edumazet-glaptop2.roam.corp.google.com>
On 10/16/2014 09:57 AM, Eric Dumazet wrote:
> On Thu, 2014-10-16 at 08:28 -0700, Alexander Duyck wrote:
>
>> I think the part you are not getting is that is how buffers are
>> essentially handled now. So for example in the case if igb the only
>> part we have copied out is usually the header, or the entire frame in
>> the case of small packets. This has to happen in order to allow for
>> changes to the header for routing and such. Beyond that the frags that
>> are passed are the buffers that igb is still holding onto. So
>> effectively what the other device transmits in a bridging/routing
>> scenario is my own net card specified buffer plus the copied/modified
>> header.
>>
>> For a brief period igb used build_skb but that isn't valid on most
>> systems as memory mapped for a device can be overwritten if the page is
>> unmapped resulting in any changes to the header for routing/bridging
>> purposes being invalidated. Thus we cannot use the buffers for both the
>> skb->data header which may be changed and Rx DMA simultaneously.
> This reminds me that igb still has skb->truesize underestimation by 100%
>
> If a fragment is held in some socket receive buffer, a full page is
> consumed, not 2048 bytes.
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index a21b14495ebd..56ca6c78985e 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -6586,9 +6586,11 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
> struct page *page = rx_buffer->page;
> unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
> #if (PAGE_SIZE < 8192)
> - unsigned int truesize = IGB_RX_BUFSZ;
> + unsigned int segsize = IGB_RX_BUFSZ;
> + unsigned int truesize = PAGE_SIZE;
> #else
> - unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
> + unsigned int segsize = ALIGN(size, L1_CACHE_BYTES);
> + unsigned int truesize = segsize;
> #endif
So if a page is used twice we are double counting the page size for the
socket then, is that correct? I just want to make sure because prior to
this patch both flows did the same thing and counted the portion of the
page used in this pass, now with this change for PAGE_SIZE of 4K we
count the entire page, and for all other cases we count the portion of
the page used.
Thanks,
Alex
^ permalink raw reply
* Re: Regarding tx-nocache-copy in the Sheevaplug
From: Benjamin Poirier @ 2014-10-16 17:34 UTC (permalink / raw)
To: Eric Dumazet
Cc: Lluís Batlle i Rossell, linux-kernel, netdev,
Carles Pagès, linux-arm-kernel
In-Reply-To: <1413413127.17186.5.camel@edumazet-glaptop2.roam.corp.google.com>
On 2014/10/15 15:45, Eric Dumazet wrote:
> On Wed, 2014-10-15 at 14:57 -0700, Benjamin Poirier wrote:
> > On 2014/10/13 12:52, Lluís Batlle i Rossell wrote:
> > > Hello,
> > >
> > > on the 7th of January 2014 ths patch was applied:
> > > https://lkml.org/lkml/2014/1/7/307
> > >
> > > [PATCH v2] net: Do not enable tx-nocache-copy by default
> > >
> > > In the Sheevaplug (ARM Feroceon 88FR131 from Marvell) this made packets to be
> > > sent corrupted. I think this machine has something special about the cache.
> > >
> > > Enabling back this tx-nocache-copy (as it used to be before the patch) the
> > > transfers work fine again. I think that most people, encountering this problem,
> > > completely disable the tx offload instead of enabling back this setting.
> > >
> > > Is this an ARM kernel problem regarding this platform?
> >
> > This is odd, only x86 defines ARCH_HAS_NOCACHE_UACCESS. On arm,
> > skb_do_copy_data_nocache() should end up using __copy_from_user()
> > regardless of tx-nocache-copy.
>
> kmap_atomic()/kunmap_atomic() is missing, so we lack
> __cpuc_flush_dcache_area() operations.
>
You lost me there.
1) I don't see the link
2) It seems kmap_atomic and so on are there:
$ grep kmap_atomic System.map-3.16-2-kirkwood
c0014838 T kmap_atomic
c001491c T kmap_atomic_pfn
c00149a4 T kmap_atomic_to_page
MACH_KIRKWOOD selects CPU_FEROCEON which has
__cpuc_flush_dcache_area ->
cpu_cache.flush_kern_dcache_area ->
feroceon_flush_kern_dcache_area
^ permalink raw reply
* Re: [PATCH] net: use hardware buffer pool to allocate skb
From: Eric Dumazet @ 2014-10-16 17:45 UTC (permalink / raw)
To: Alexander Duyck
Cc: Jiafei.Pan@freescale.com, David Miller, jkosina@suse.cz,
netdev@vger.kernel.org, LeoLi@freescale.com,
linux-doc@vger.kernel.org
In-Reply-To: <543FFC03.1060207@redhat.com>
On Thu, 2014-10-16 at 10:10 -0700, Alexander Duyck wrote:
> So if a page is used twice we are double counting the page size for the
> socket then, is that correct? I just want to make sure because prior to
> this patch both flows did the same thing and counted the portion of the
> page used in this pass, now with this change for PAGE_SIZE of 4K we
> count the entire page, and for all other cases we count the portion of
> the page used.
When a page is split in 2 parts only, probability that a segment holds
the 4K page is quite high (There is a single half page)
When we split say 64KB in 42 segments, the probability a single segment
hold the full 64KB block is very low, so we can almost be safe when we
consider 'truesize = 1536'
Of course there are pathological cases, but attacker has to be quite
smart.
I am just saying that counting 2048 might have a big impact on memory
consumption if all these incoming segments are stored a long time in
receive queues (TCP receive queues or out of order queues) : We might be
off by a factor of 2 on the real memory usage, and delay the TCP
collapsing too much.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox