* [PATCH V2 5/7] e1000: rename struct e1000_buffer to e1000_tx_buffer
From: Florian Westphal @ 2014-09-02 12:24 UTC (permalink / raw)
To: e1000-devel; +Cc: netdev, Florian Westphal
In-Reply-To: <1409660690-10391-1-git-send-email-fw@strlen.de>
and remove *page, its only used for rx.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
no changes since v1.
drivers/net/ethernet/intel/e1000/e1000.h | 9 ++++-----
drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 2 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 23 ++++++++++++-----------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000.h b/drivers/net/ethernet/intel/e1000/e1000.h
index 81efe33..4c2a102 100644
--- a/drivers/net/ethernet/intel/e1000/e1000.h
+++ b/drivers/net/ethernet/intel/e1000/e1000.h
@@ -148,16 +148,15 @@ struct e1000_adapter;
/* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer
*/
-struct e1000_buffer {
+struct e1000_tx_buffer {
struct sk_buff *skb;
dma_addr_t dma;
- struct page *page;
unsigned long time_stamp;
u16 length;
u16 next_to_watch;
- unsigned int segs;
+ bool mapped_as_page;
+ unsigned short segs;
unsigned int bytecount;
- u16 mapped_as_page;
};
struct e1000_rx_buffer {
@@ -180,7 +179,7 @@ struct e1000_tx_ring {
/* next descriptor to check for DD status bit */
unsigned int next_to_clean;
/* array of buffer information structs */
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
u16 tdh;
u16 tdt;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
index fbf7a4d..380a730 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
@@ -1010,7 +1010,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
if (!txdr->count)
txdr->count = E1000_DEFAULT_TXD;
- txdr->buffer_info = kcalloc(txdr->count, sizeof(struct e1000_buffer),
+ txdr->buffer_info = kcalloc(txdr->count, sizeof(struct e1000_tx_buffer),
GFP_KERNEL);
if (!txdr->buffer_info) {
ret_val = 1;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 5ff48af..73cd509 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1497,7 +1497,7 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
struct pci_dev *pdev = adapter->pdev;
int size;
- size = sizeof(struct e1000_buffer) * txdr->count;
+ size = sizeof(struct e1000_tx_buffer) * txdr->count;
txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info)
return -ENOMEM;
@@ -1947,8 +1947,9 @@ void e1000_free_all_tx_resources(struct e1000_adapter *adapter)
e1000_free_tx_resources(adapter, &adapter->tx_ring[i]);
}
-static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
- struct e1000_buffer *buffer_info)
+static void
+e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
+ struct e1000_tx_buffer *buffer_info)
{
if (buffer_info->dma) {
if (buffer_info->mapped_as_page)
@@ -1977,7 +1978,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring)
{
struct e1000_hw *hw = &adapter->hw;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
unsigned long size;
unsigned int i;
@@ -1989,7 +1990,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
}
netdev_reset_queue(adapter->netdev);
- size = sizeof(struct e1000_buffer) * tx_ring->count;
+ size = sizeof(struct e1000_tx_buffer) * tx_ring->count;
memset(tx_ring->buffer_info, 0, size);
/* Zero out the descriptor ring */
@@ -2677,7 +2678,7 @@ static int e1000_tso(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
{
struct e1000_context_desc *context_desc;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
unsigned int i;
u32 cmd_length = 0;
u16 ipcse = 0, tucse, mss;
@@ -2748,7 +2749,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring, struct sk_buff *skb)
{
struct e1000_context_desc *context_desc;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
unsigned int i;
u8 css;
u32 cmd_len = E1000_TXD_CMD_DEXT;
@@ -2807,7 +2808,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
{
struct e1000_hw *hw = &adapter->hw;
struct pci_dev *pdev = adapter->pdev;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
unsigned int len = skb_headlen(skb);
unsigned int offset = 0, size, count = 0, i;
unsigned int f, bytecount, segs;
@@ -2953,7 +2954,7 @@ static void e1000_tx_queue(struct e1000_adapter *adapter,
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_tx_desc *tx_desc = NULL;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
u32 txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS;
unsigned int i;
@@ -3370,7 +3371,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
- struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i];
+ struct e1000_tx_buffer *buffer_info = &tx_ring->buffer_info[i];
struct my_u { __le64 a; __le64 b; };
struct my_u *u = (struct my_u *)tx_desc;
const char *type;
@@ -3808,7 +3809,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
struct e1000_tx_desc *tx_desc, *eop_desc;
- struct e1000_buffer *buffer_info;
+ struct e1000_tx_buffer *buffer_info;
unsigned int i, eop;
unsigned int count = 0;
unsigned int total_tx_bytes=0, total_tx_packets=0;
--
1.8.1.5
^ permalink raw reply related
* [PATCH] netfilter: fix missing dependencies in NETFILTER_XT_TARGET_LOG
From: Pablo Neira Ayuso @ 2014-09-02 12:26 UTC (permalink / raw)
To: netfilter-devel; +Cc: davem, netdev
make defconfig reports:
warning: (NETFILTER_XT_TARGET_LOG) selects NF_LOG_IPV6 which has unmet direct dependencies (NET && INET && IPV6 && NETFILTER && NETFILTER_ADVANCED)
Fixes: d79a61d netfilter: NETFILTER_XT_TARGET_LOG selects NF_LOG_*
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
~
@David, if you pull this request:
http://patchwork.ozlabs.org/patch/385042/
Could you also manually apply this patch to calm down kbuild robot?
Thanks!
net/ipv6/netfilter/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
index cf0b88f..2812816 100644
--- a/net/ipv6/netfilter/Kconfig
+++ b/net/ipv6/netfilter/Kconfig
@@ -57,7 +57,7 @@ config NFT_REJECT_IPV6
config NF_LOG_IPV6
tristate "IPv6 packet logging"
- depends on NETFILTER_ADVANCED
+ default m if NETFILTER_ADVANCED=n
select NF_LOG_COMMON
config NF_NAT_IPV6
--
1.7.10.4
^ permalink raw reply related
* [PATCH] openvswitch: fix a memory leak
From: roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w @ 2014-09-02 12:52 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, dev-yBygre7rU0TnMu66kgdUjQ,
pshelar-l0M0P4e3n4LQT0dZR+AlfA
From: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The user_skb maybe be leaked if the operation on it failed and codes
skipped into the label "out:" without calling genlmsg_unicast.
Cc: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/openvswitch/datapath.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 7228ec3..35d866f 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -404,7 +404,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
{
struct ovs_header *upcall;
struct sk_buff *nskb = NULL;
- struct sk_buff *user_skb; /* to be queued to userspace */
+ struct sk_buff *user_skb = NULL; /* to be queued to userspace */
struct nlattr *nla;
struct genl_info info = {
.dst_sk = ovs_dp_get_net(dp)->genl_sock,
@@ -494,9 +494,11 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
((struct nlmsghdr *) user_skb->data)->nlmsg_len = user_skb->len;
err = genlmsg_unicast(ovs_dp_get_net(dp), user_skb, upcall_info->portid);
+ user_skb = NULL;
out:
if (err)
skb_tx_error(skb);
+ kfree_skb(user_skb);
kfree_skb(nskb);
return err;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH] openvswitch: distinguish between the dropped and consumed skb
From: roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w @ 2014-09-02 12:52 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, dev-yBygre7rU0TnMu66kgdUjQ,
pshelar-l0M0P4e3n4LQT0dZR+AlfA
From: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
distinguish between the dropped and consumed skb, not assume the skb
is consumed always
Cc: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
net/openvswitch/datapath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 35d866f..dacf56f 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -266,7 +266,6 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
upcall.userdata = NULL;
upcall.portid = ovs_vport_find_upcall_portid(p, skb);
ovs_dp_upcall(dp, skb, &upcall);
- consume_skb(skb);
stats_counter = &stats->n_missed;
goto out;
}
@@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
if (err)
goto err;
+ consume_skb(skb);
return 0;
err:
+ kfree_skb(skb);
stats = this_cpu_ptr(dp->stats_percpu);
u64_stats_update_begin(&stats->syncp);
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH net-next 2/2] r8152: use eth_hw_addr_random
From: Sergei Shtylyov @ 2014-09-02 12:53 UTC (permalink / raw)
To: Hayes Wang, netdev; +Cc: nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-28-Taiwan-albertk@realtek.com>
Hello.
On 9/2/2014 1:55 PM, Hayes Wang wrote:
> If the hw doesn't have a valid MAC address, give a random one and
> set it to the hw.
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> ---
> drivers/net/usb/r8152.c | 39 ++++++++++++++++++++++++---------------
> 1 file changed, 24 insertions(+), 15 deletions(-)
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index b5ff933..2bc1b8d 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -992,32 +992,41 @@ static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
> return 0;
> }
>
> -static inline void set_ethernet_addr(struct r8152 *tp)
> +static int set_ethernet_addr(struct r8152 *tp)
> {
> struct net_device *dev = tp->netdev;
> + struct sockaddr sa;
> int ret;
> - u8 node_id[8] = {0};
>
> if (tp->version == RTL_VER_01)
> - ret = pla_ocp_read(tp, PLA_IDR, sizeof(node_id), node_id);
> + ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
> else
> - ret = pla_ocp_read(tp, PLA_BACKUP, sizeof(node_id), node_id);
> + ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data);
>
> if (ret < 0) {
> - netif_notice(tp, probe, dev, "inet addr fail\n");
> + netif_err(tp, probe, dev, "Get ether addr fail\n");
> + } else if (!is_valid_ether_addr(sa.sa_data)) {
> + netif_err(tp, probe, dev,
> + "Invalid ether addr %02x:%02x:%02x:%02x:%02x:%02x\n",
There's now "%pM" format specifier for printing a MAC address.
> + sa.sa_data[0], sa.sa_data[1], sa.sa_data[2],
> + sa.sa_data[3], sa.sa_data[4], sa.sa_data[5]);
> + eth_hw_addr_random(dev);
> + ether_addr_copy(sa.sa_data, dev->dev_addr);
> + ret = rtl8152_set_mac_address(dev, &sa);
> + netif_info(tp, probe, dev,
> + "Random ether addr %02x:%02x:%02x:%02x:%02x:%02x\n",
Likewise.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 1/2] ipv6: add sysctl_mld_qrv to configure query robustness variable
From: Flavio Leitner @ 2014-09-02 12:57 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: netdev
In-Reply-To: <1409650342.22584.14.camel@localhost>
On Tue, Sep 02, 2014 at 11:32:22AM +0200, Hannes Frederic Sowa wrote:
> Hi Flavio,
>
> On Mo, 2014-09-01 at 21:05 -0300, Flavio Leitner wrote:
> > Hi Hannes,
> >
> > On Mon, Sep 01, 2014 at 09:55:34PM +0200, Hannes Frederic Sowa wrote:
> > > This patch adds a new sysctl_mld_qrv knob to configure the mldv1/v2 query
> > > robustness variable. It specifies how many retransmit of unsolicited mld
> > > retransmit should happen. Admins might want to tune this on lossy links.
> > >
> > > Also reset mld state on interface down/up, so we pick up new sysctl
> > > settings during interface up event.
> > >
> > > IPv6 certification requests this knob to be available.
> > >
> > > I didn't make this knob netns specific, as it is mostly a setting in a
> > > physical environment and should be per host.
> > >
[...]
> > > @@ -1196,7 +1197,7 @@ static void mld_update_qrv(struct inet6_dev *idev,
> > > if (mlh2->mld2q_qrv > 0)
> > > idev->mc_qrv = mlh2->mld2q_qrv;
> > >
> > > - if (unlikely(idev->mc_qrv < 2)) {
> > > + if (unlikely(idev->mc_qrv < MLD_QRV_DEFAULT)) {
> > > net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n",
> > > idev->mc_qrv, MLD_QRV_DEFAULT);
> > > idev->mc_qrv = MLD_QRV_DEFAULT;
> >
> > You allow the sysctl to be 1, but here it is limited to 2?
>
> I wanted to keep limiting the remotely set value to at least 2.
>
> Is this more reasonable?
>
> const int min_qrv = min(MLD_QRV_DEFAULT, sysctl_mld_qrv);
> if (unlikely(idev->mc_qrv < min_qrv)) {
> net_warn_ratelimited(...);
> idev->mc_qrv = min_qrv;
> }
Yeah, that makes sense to me.
[...]
> > > +static int one = 1;
> > > +
> > Although that can be reused later for other purposes, it's nice to
> > have a comment telling where that value came from. Since you have
> > defined MLD_QRV_DEFAULT, it helps. Still I didn't know about
> > rfc6636#section-4.5, so I'd appreciate if you include that info
> > either in ip-sysctl.txt or close to MLD_QRV_DEFAULT.
>
> I think ip-sysctl.txt is a good place, do you agree?
Yes, I think so.
[...]
> > Actually, maybe that int could be something not specific to ipv6
> > because I believe there are more users of the same thing. That's ok,
> > just a comment and it's not part of this patch.
>
> Sorry, I did not understand that. ;)
> Do you propose to use one sysctl variable for igmp and mld?
Sorry, I wasn't clear. I was saying that 'int one' is used in other
places as well. So, it would be better if that integer is somehow
placed in a common place instead. But that would be a clean up and
certainly not part of this patch. Your patch is good as is now.
Thanks Hannes!
fbl
^ permalink raw reply
* Please respond/-1/
From: laurencesweio @ 2014-09-02 5:20 UTC (permalink / raw)
To: netdev
Attn ,
My name is Laurence Palmer, a banker at STB SA. I have a beneficial business propsal worth $15 Million for you. You are not going to spend any of your personal savings on this business transaction.
I shall cover all expenses which might be necessary for this transaction to go through. I just need a honest individual as a partner. I will give 40% of the proceeds to you.
Respond by email: palmerlaurence6@gmail.com
Mr. Laurence Palmer
^ permalink raw reply
* Re: [ovs-dev] [PATCH] openvswitch: distinguish between the dropped and consumed skb
From: Thomas Graf @ 2014-09-02 13:14 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev, dev, pshelar
In-Reply-To: <1409662369-2528-1-git-send-email-roy.qing.li@gmail.com>
On 09/02/14 at 08:52pm, roy.qing.li@gmail.com wrote:
> @@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
> if (err)
> goto err;
>
> + consume_skb(skb);
> return 0;
What about the path from output_userspace()?
^ permalink raw reply
* Re: [PATCH] Next branch: authgss: authgss.c: Fix warnings for uninitizlized variable expire
From: Bruce Fields @ 2014-09-02 13:21 UTC (permalink / raw)
To: Boaz Harrosh
Cc: Trond Myklebust, Shakil A Khan, Linux NFS Mailing List,
Linux Kernel mailing list,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Peter Zijlstra,
Paul McKenney, William Andros Adamson, Jeffrey Layton,
David S. Miller
In-Reply-To: <5405A15F.2060002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Tue, Sep 02, 2014 at 01:52:15PM +0300, Boaz Harrosh wrote:
> On 09/01/2014 04:50 PM, Trond Myklebust wrote:
> > On Mon, Sep 1, 2014 at 7:32 AM, Shakil A Khan <shakilk1729-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> Signed-off-by : Shakil A Khan <shakilk1729-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >> ---
> >> net/sunrpc/auth_gss/auth_gss.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> >> index afb292c..bea0951 100644
> >> --- a/net/sunrpc/auth_gss/auth_gss.c
> >> +++ b/net/sunrpc/auth_gss/auth_gss.c
> >> @@ -1387,7 +1387,7 @@ gss_key_timeout(struct rpc_cred *rc)
> >> struct gss_cred *gss_cred = container_of(rc, struct gss_cred, gc_base);
> >> struct gss_cl_ctx *ctx;
> >> unsigned long now = jiffies;
> >> - unsigned long expire;
> >> + unsigned long expire = 0;
> >>
> >> rcu_read_lock();
> >> ctx = rcu_dereference(gss_cred->gc_ctx);
> >> --
> >> 1.7.1
> >
> > That would be a compiler bug, not a kernel bug. The kernel code is
> > perfectly correct as it stands, and will never access the
> > uninitialised variable.
> >
>
> Than you will need the infamous uninitialised_var()
You'd rather avoid sprinkling that all over, though. If nothing else it
increases the chances you'll suppress a legimate warning some day.
And unless I'm missing something this one really does look like an
unambiguous compiler bug.
--b.
>
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index afb292c..bea0951 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -1387,7 +1387,7 @@ gss_key_timeout(struct rpc_cred *rc)
> struct gss_cred *gss_cred = container_of(rc, struct gss_cred, gc_base);
> struct gss_cl_ctx *ctx;
> unsigned long now = jiffies;
> - unsigned long expire;
> + unsigned long uninitialised_var(expire);
>
> rcu_read_lock();
> ctx = rcu_dereference(gss_cred->gc_ctx);
>
> Cheers
> Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH net-next v3 2/2] ipv4: implement igmp_qrv sysctl to tune igmp robustness variable
From: Hannes Frederic Sowa @ 2014-09-02 13:49 UTC (permalink / raw)
To: netdev; +Cc: Flavio Leitner
In-Reply-To: <3f38fb1c0c5544de4cea8bb13e0adcbba17bebd3.1409665378.git.hannes@stressinduktion.org>
As in IPv6 people might increase the igmp query robustness variable to
make sure unsolicited state change reports aren't lost on the network. Add
and document this new knob to igmp code.
RFCs allow tuning this parameter back to first IGMP RFC, so we also use
this setting for all counters, including source specific multicast.
Also take over sysctl value when upping the interface and don't reuse
the last one seen on the interface.
Cc: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
v2) Guard sysctl_igmp_qrv with CONFIG_IP_MULTICAST so we don't use
IGMP_Query_Robustness_Variable without it being defined.
v3) document minimum and default values of igmp_qrv
Documentation/networking/ip-sysctl.txt | 5 +++++
include/linux/igmp.h | 1 +
net/ipv4/igmp.c | 31 +++++++++++++++----------------
net/ipv4/sysctl_net_ipv4.c | 10 ++++++++++
4 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index cfc71ac..db2383c 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -844,6 +844,11 @@ igmp_max_memberships - INTEGER
conf/all/* is special, changes the settings for all interfaces
+igmp_qrv - INTEGER
+ Controls the IGMP query robustness variable (see RFC2236 8.1).
+ Default: 2 (as specified by RFC2236 8.1)
+ Minimum: 1 (as specified by RFC6636 4.5)
+
log_martians - BOOLEAN
Log packets with impossible addresses to kernel log.
log_martians for the interface will be enabled if at least one of
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index f47550d..2c677af 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -39,6 +39,7 @@ static inline struct igmpv3_query *
extern int sysctl_igmp_max_memberships;
extern int sysctl_igmp_max_msf;
+extern int sysctl_igmp_qrv;
struct ip_sf_socklist {
unsigned int sl_max;
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 890c425..4146153 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -117,7 +117,7 @@
#define IGMP_V2_Unsolicited_Report_Interval (10*HZ)
#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)
#define IGMP_Query_Response_Interval (10*HZ)
-#define IGMP_Unsolicited_Report_Count 2
+#define IGMP_Query_Robustness_Variable 2
#define IGMP_Initial_Report_Delay (1)
@@ -756,8 +756,7 @@ static void igmp_ifc_event(struct in_device *in_dev)
{
if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev))
return;
- in_dev->mr_ifc_count = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ in_dev->mr_ifc_count = in_dev->mr_qrv ?: sysctl_igmp_qrv;
igmp_ifc_start_timer(in_dev, 1);
}
@@ -1086,8 +1085,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im)
pmc->interface = im->interface;
in_dev_hold(in_dev);
pmc->multiaddr = im->multiaddr;
- pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv;
pmc->sfmode = im->sfmode;
if (pmc->sfmode == MCAST_INCLUDE) {
struct ip_sf_list *psf;
@@ -1226,8 +1224,7 @@ static void igmp_group_added(struct ip_mc_list *im)
}
/* else, v3 */
- im->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ im->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv;
igmp_ifc_event(in_dev);
#endif
}
@@ -1322,7 +1319,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
spin_lock_init(&im->lock);
#ifdef CONFIG_IP_MULTICAST
setup_timer(&im->timer, igmp_timer_expire, (unsigned long)im);
- im->unsolicit_count = IGMP_Unsolicited_Report_Count;
+ im->unsolicit_count = sysctl_igmp_qrv;
#endif
im->next_rcu = in_dev->mc_list;
@@ -1460,7 +1457,7 @@ void ip_mc_init_dev(struct in_device *in_dev)
(unsigned long)in_dev);
setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire,
(unsigned long)in_dev);
- in_dev->mr_qrv = IGMP_Unsolicited_Report_Count;
+ in_dev->mr_qrv = sysctl_igmp_qrv;
#endif
spin_lock_init(&in_dev->mc_tomb_lock);
@@ -1474,6 +1471,9 @@ void ip_mc_up(struct in_device *in_dev)
ASSERT_RTNL();
+#ifdef CONFIG_IP_MULTICAST
+ in_dev->mr_qrv = sysctl_igmp_qrv;
+#endif
ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS);
for_each_pmc_rtnl(in_dev, pmc)
@@ -1540,7 +1540,9 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
*/
int sysctl_igmp_max_memberships __read_mostly = IP_MAX_MEMBERSHIPS;
int sysctl_igmp_max_msf __read_mostly = IP_MAX_MSF;
-
+#ifdef CONFIG_IP_MULTICAST
+int sysctl_igmp_qrv __read_mostly = IGMP_Query_Robustness_Variable;
+#endif
static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode,
__be32 *psfsrc)
@@ -1575,8 +1577,7 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode,
#ifdef CONFIG_IP_MULTICAST
if (psf->sf_oldin &&
!IGMP_V1_SEEN(in_dev) && !IGMP_V2_SEEN(in_dev)) {
- psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ psf->sf_crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv;
psf->sf_next = pmc->tomb;
pmc->tomb = psf;
rv = 1;
@@ -1639,8 +1640,7 @@ static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
/* filter mode change */
pmc->sfmode = MCAST_INCLUDE;
#ifdef CONFIG_IP_MULTICAST
- pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv;
in_dev->mr_ifc_count = pmc->crcount;
for (psf = pmc->sources; psf; psf = psf->sf_next)
psf->sf_crcount = 0;
@@ -1818,8 +1818,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
#ifdef CONFIG_IP_MULTICAST
/* else no filters; keep old mode for reports */
- pmc->crcount = in_dev->mr_qrv ? in_dev->mr_qrv :
- IGMP_Unsolicited_Report_Count;
+ pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv;
in_dev->mr_ifc_count = pmc->crcount;
for (psf = pmc->sources; psf; psf = psf->sf_next)
psf->sf_crcount = 0;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 79a007c..45d156d 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -450,6 +450,16 @@ static struct ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
+#ifdef CONFIG_IP_MULTICAST
+ {
+ .procname = "igmp_qrv",
+ .data = &sysctl_igmp_qrv,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &one
+ },
+#endif
{
.procname = "inet_peer_threshold",
.data = &inet_peer_threshold,
--
1.9.3
^ permalink raw reply related
* [PATCH net-next v3 1/2] ipv6: add sysctl_mld_qrv to configure query robustness variable
From: Hannes Frederic Sowa @ 2014-09-02 13:49 UTC (permalink / raw)
To: netdev; +Cc: Flavio Leitner
This patch adds a new sysctl_mld_qrv knob to configure the mldv1/v2 query
robustness variable. It specifies how many retransmit of unsolicited mld
retransmit should happen. Admins might want to tune this on lossy links.
Also reset mld state on interface down/up, so we pick up new sysctl
settings during interface up event.
IPv6 certification requests this knob to be available.
I didn't make this knob netns specific, as it is mostly a setting in a
physical environment and should be per host.
Cc: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
v2) no changes to original version
v3) - enhance Documentation/networking/ip-sysctl.txt with sysctl limits
- fix clamping of remotely received mld_qrv value
Documentation/networking/ip-sysctl.txt | 5 +++++
include/net/ipv6.h | 1 +
net/ipv6/mcast.c | 25 +++++++++++++++----------
net/ipv6/sysctl_net_ipv6.c | 10 ++++++++++
4 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 3cce8ea..cfc71ac 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1152,6 +1152,11 @@ anycast_src_echo_reply - BOOLEAN
FALSE: disabled
Default: FALSE
+mld_qrv - INTEGER
+ Controls the MLD query robustness variable (see RFC3810 9.1).
+ Default: 2 (as specified by RFC3810 9.1)
+ Minimum: 1 (as specified by RFC6636 4.5)
+
IPv6 Fragmentation:
ip6frag_high_thresh - INTEGER
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index a2db816..7e247e9 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -121,6 +121,7 @@ struct frag_hdr {
/* sysctls */
extern int sysctl_mld_max_msf;
+extern int sysctl_mld_qrv;
#define _DEVINC(net, statname, modifier, idev, field) \
({ \
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 7088179..6491942 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -121,6 +121,7 @@ static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
#define IPV6_MLD_MAX_MSF 64
int sysctl_mld_max_msf __read_mostly = IPV6_MLD_MAX_MSF;
+int sysctl_mld_qrv __read_mostly = MLD_QRV_DEFAULT;
/*
* socket join on multicast group
@@ -1191,15 +1192,16 @@ static void mld_update_qrv(struct inet6_dev *idev,
* and SHOULD NOT be one. Catch this here if we ever run
* into such a case in future.
*/
+ const int min_qrv = min(MLD_QRV_DEFAULT, sysctl_mld_qrv);
WARN_ON(idev->mc_qrv == 0);
if (mlh2->mld2q_qrv > 0)
idev->mc_qrv = mlh2->mld2q_qrv;
- if (unlikely(idev->mc_qrv < 2)) {
+ if (unlikely(idev->mc_qrv < min_qrv)) {
net_warn_ratelimited("IPv6: MLD: clamping QRV from %u to %u!\n",
- idev->mc_qrv, MLD_QRV_DEFAULT);
- idev->mc_qrv = MLD_QRV_DEFAULT;
+ idev->mc_qrv, min_qrv);
+ idev->mc_qrv = min_qrv;
}
}
@@ -2478,6 +2480,14 @@ void ipv6_mc_down(struct inet6_dev *idev)
mld_clear_delrec(idev);
}
+static void ipv6_mc_reset(struct inet6_dev *idev)
+{
+ idev->mc_qrv = sysctl_mld_qrv;
+ idev->mc_qi = MLD_QI_DEFAULT;
+ idev->mc_qri = MLD_QRI_DEFAULT;
+ idev->mc_v1_seen = 0;
+ idev->mc_maxdelay = unsolicited_report_interval(idev);
+}
/* Device going up */
@@ -2488,6 +2498,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
/* Install multicast list, except for all-nodes (already installed) */
read_lock_bh(&idev->lock);
+ ipv6_mc_reset(idev);
for (i = idev->mc_list; i; i = i->next)
igmp6_group_added(i);
read_unlock_bh(&idev->lock);
@@ -2508,13 +2519,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
(unsigned long)idev);
setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire,
(unsigned long)idev);
-
- idev->mc_qrv = MLD_QRV_DEFAULT;
- idev->mc_qi = MLD_QI_DEFAULT;
- idev->mc_qri = MLD_QRI_DEFAULT;
-
- idev->mc_maxdelay = unsolicited_report_interval(idev);
- idev->mc_v1_seen = 0;
+ ipv6_mc_reset(idev);
write_unlock_bh(&idev->lock);
}
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 0c56c93..c5c10fa 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -16,6 +16,8 @@
#include <net/addrconf.h>
#include <net/inet_frag.h>
+static int one = 1;
+
static struct ctl_table ipv6_table_template[] = {
{
.procname = "bindv6only",
@@ -63,6 +65,14 @@ static struct ctl_table ipv6_rotable[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
+ {
+ .procname = "mld_qrv",
+ .data = &sysctl_mld_qrv,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &one
+ },
{ }
};
--
1.9.3
^ permalink raw reply related
* [PATCH net] core: Don't attempt to load the "" driver.
From: David Laight @ 2014-09-02 13:48 UTC (permalink / raw)
To: Linux Netdev List, David Miller
Requests like 'ifconfig ""' cause dev_load(net, "") be called, since
request_module("") return 0 (success) this generates the error message:
"Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev- instead."
Since dev_load() doesn't have to work, just ignore such names.
---
If you search for the above error message, you'll find a lot of complaints.
While the applications shouldn't be calling an SIOCxxx ioctl with ifr_name[0] == 0
the kernel shouldn't be tracing the error either.
Due to the complaints from users, this might be a backport candidate.
net/core/dev_ioctl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index cf999e0..84edf16 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -358,6 +358,9 @@ void dev_load(struct net *net, const char *name)
struct net_device *dev;
int no_module;
+ if (!name[0])
+ return;
+
rcu_read_lock();
dev = dev_get_by_name_rcu(net, name);
rcu_read_unlock();
--
1.8.1.2
^ permalink raw reply related
* [PATCH net-next] core: Simplify logic in dev_load().
From: David Laight @ 2014-09-02 13:51 UTC (permalink / raw)
To: Linux Netdev List, David Miller
The code in dev_load() is convoluted.
Return early and remove the 'no_module' variable.
---
Note that this patch will only apply after the one that adds the
check for name[0].
net/core/dev_ioctl.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 84edf16..4b7ab54 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -356,7 +356,6 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
void dev_load(struct net *net, const char *name)
{
struct net_device *dev;
- int no_module;
if (!name[0])
return;
@@ -364,15 +363,15 @@ void dev_load(struct net *net, const char *name)
rcu_read_lock();
dev = dev_get_by_name_rcu(net, name);
rcu_read_unlock();
+ if (dev)
+ return;
- no_module = !dev;
- if (no_module && capable(CAP_NET_ADMIN))
- no_module = request_module("netdev-%s", name);
- if (no_module && capable(CAP_SYS_MODULE)) {
- if (!request_module("%s", name))
- pr_warn("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n",
- name);
- }
+ if (capable(CAP_NET_ADMIN) && !request_module("netdev-%s", name))
+ return;
+
+ if (capable(CAP_SYS_MODULE) && !request_module("%s", name))
+ pr_warn("Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s instead.\n",
+ name);
}
EXPORT_SYMBOL(dev_load);
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] Next branch: authgss: authgss.c: Fix warnings for uninitizlized variable expire
From: Boaz Harrosh @ 2014-09-02 13:59 UTC (permalink / raw)
To: Bruce Fields
Cc: Trond Myklebust, Shakil A Khan, Linux NFS Mailing List,
Linux Kernel mailing list,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Peter Zijlstra,
Paul McKenney, William Andros Adamson, Jeffrey Layton,
David S. Miller
In-Reply-To: <20140902132140.GA31793-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
On 09/02/2014 04:21 PM, Bruce Fields wrote:
>
> You'd rather avoid sprinkling that all over, though. If nothing else it
> increases the chances you'll suppress a legimate warning some day.
>
But this is exactly why it was created.
If you do the "= 0" then it is gone forever. If you have missed a legitimate
needed assignment, it will be missed as well.
But if you do the uninitialized_var() dance then there is a make option that turns
it off and every once in a while people do a make with it to see if it still
holds.
The diff between foo = 0; and uninitialized_var(foo) is that the programmer is
communicating to his friends that:
"I have encountered a bogus compiler, this is falsely initialized"
As opposed to =0 the compiler bug is covered up and forgotten
> And unless I'm missing something this one really does look like an
> unambiguous compiler bug.
>
Right! so that is how you specify this in code at Linux: uninitialized_var(foo);
Putting =0 is way way worse, because it will never be revised and specially
not automatically with a make switch.
And leaving the warning on is even worse because two three of these and people
start to ignore warnings.
> --b.
>
uninitialized_var was made to be a friend not an enemy, in the face of real
ugliness it is the best we can do. And that is what it should communicate to
everyone. Why has it become everyone's favorite blasphemy I do not know.
Cheers
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] Next branch: authgss: authgss.c: Fix warnings for uninitizlized variable expire
From: Bruce Fields @ 2014-09-02 14:17 UTC (permalink / raw)
To: Boaz Harrosh
Cc: Trond Myklebust, Shakil A Khan, Linux NFS Mailing List,
Linux Kernel mailing list,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Peter Zijlstra,
Paul McKenney, William Andros Adamson, Jeffrey Layton,
David S. Miller
In-Reply-To: <5405CD51.9020601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Tue, Sep 02, 2014 at 04:59:45PM +0300, Boaz Harrosh wrote:
> uninitialized_var was made to be a friend not an enemy, in the face of real
> ugliness it is the best we can do. And that is what it should communicate to
> everyone. Why has it become everyone's favorite blasphemy I do not know.
Not personally claiming it should never be used, just that this
particular case is kind of extreme, since unless I'm missing a real
compilication it's basically just:
if (ctx)
assign to expire
...
if (ctx)
use expire
A compiler wouldn't have to be that smart to actually prove to itself
that expire is initialized at the last step, and that it's not only
failing to do that but actually flagging it as possibly unitialized is
weird.
--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Order of interfaces in output of ip link
From: Ovidiu Mara @ 2014-09-02 14:27 UTC (permalink / raw)
To: netdev
Hi everyone,
The ip command shows the interfaces on this machine in an unnatural order (eth0 followed by eth2 then eth1).
For example:
ip -o link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default \ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether 2c:59:e5:9a:4c:a4 brd ff:ff:ff:ff:ff:ff
3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:d8 brd ff:ff:ff:ff:ff:ff
4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000\ link/ether 2c:59:e5:9a:4c:a5 brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:d9 brd ff:ff:ff:ff:ff:ff
6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:da brd ff:ff:ff:ff:ff:ff
7: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:db brd ff:ff:ff:ff:ff:ff
8: eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether a0:36:9f:26:b3:10 brd ff:ff:ff:ff:ff:ff
9: eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether a0:36:9f:26:b3:12 brd ff:ff:ff:ff:ff:ff
eth0 and eth1 are two ports on the same network card, so I would expect them to be shown together, as they are numbered. According to the documentation I found here ( http://www.policyrouting.org/iproute2.doc.html#ss9.1.1 ): "The number followed by a colon is the interface index or ifindex. This number uniquely identifies the interface. If you look at the output from cat /proc/net/dev you will see that the network devices are listed in the same order as the numbering you see here."
However in /proc/net/dev they are shown in the natural order:
cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
eth0: 1000705102 6535806 0 8946 0 0 0 2861813 5252988 39289 0 0 0 0 0 0
eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth2: 104506836 257406 0 0 0 0 0 0 648 8 0 0 0 0 0 0
eth3: 104506430 257405 0 0 0 0 0 0 648 8 0 0 0 0 0 0
eth4: 104506430 257405 0 0 0 0 0 0 648 8 0 0 0 0 0 0
eth5: 104505618 257403 0 0 0 0 0 0 648 8 0 0 0 0 0 0
eth6: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
eth7: 396628856508 364243051 0 0 0 0 0 0 398063721522 365214422 0 0 0 0 0 0
lo: 178 2 0 0 0 0 0 0 178 2 0 0 0 0 0 0
I'm using iproute2-3.11.0.
Could you please tell me if there is any workaround for this?
Thanks,
Ovidiu
PS Please CC me in replies.
^ permalink raw reply
* [net-next PATCH 0/3] qdisc bulk dequeuing and utilizing delayed tailptr updates
From: Jesper Dangaard Brouer @ 2014-09-02 14:35 UTC (permalink / raw)
To: Jesper Dangaard Brouer, David S. Miller, netdev
Cc: Florian Westphal, Hannes Frederic Sowa, Daniel Borkmann
This patchset uses DaveM's recent API changes to dev_hard_start_xmit(),
from the qdisc layer, to implement dequeue bulking.
Open questions:
- For now set bulk limit to 8 packets, don't want to stress the driver
avail ring_buffer space.
- We are not doing proper accounting for weight_p/quota in __qdisc_run(). Do we care?
- Is the (!skb->next) check in dequeue necessary?
- Do we need some checks in dev_requeue_skb() as we could be requeuing a SKB list?
- Should we rename dequeue_skb() to dequeue_skb_list() ?
Based on top of:
commit 364a9e93243d ("sock: deduplicate errqueue dequeue")
---
Jesper Dangaard Brouer (3):
qdisc: sysctl to adjust bulk dequeue limit
qdisc: bulk dequeue support for qdiscs with TCQ_F_ONETXQUEUE
qdisc: adjustments for API allowing skb list xmits
include/net/sch_generic.h | 2 ++
net/core/sysctl_net_core.c | 9 +++++++++
net/sched/sch_generic.c | 33 ++++++++++++++++++++++++++++-----
3 files changed, 39 insertions(+), 5 deletions(-)
--
^ permalink raw reply
* [net-next PATCH 1/3] qdisc: adjustments for API allowing skb list xmits
From: Jesper Dangaard Brouer @ 2014-09-02 14:35 UTC (permalink / raw)
To: Jesper Dangaard Brouer, David S. Miller, netdev
Cc: Florian Westphal, Hannes Frederic Sowa, Daniel Borkmann
In-Reply-To: <20140902143254.1918.8419.stgit@dragon>
Minor adjustments for merge commit 53fda7f7f9e (Merge branch 'xmit_list')
that allows us to work with a list of SKBs.
Update code doc to function sch_direct_xmit().
In handle_dev_cpu_collision() use kfree_skb_list() in error handling.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
net/sched/sch_generic.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index a8bf9f9..5b261e9 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -93,7 +93,7 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
* detect it by checking xmit owner and drop the packet when
* deadloop is detected. Return OK to try the next skb.
*/
- kfree_skb(skb);
+ kfree_skb_list(skb);
net_warn_ratelimited("Dead loop on netdevice %s, fix it urgently!\n",
dev_queue->dev->name);
ret = qdisc_qlen(q);
@@ -110,9 +110,9 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
}
/*
- * Transmit one skb, and handle the return status as required. Holding the
- * __QDISC___STATE_RUNNING bit guarantees that only one CPU can execute this
- * function.
+ * Transmit possibly several skbs, and handle the return status as
+ * required. Holding the __QDISC___STATE_RUNNING bit guarantees that
+ * only one CPU can execute this function.
*
* Returns to the caller:
* 0 - queue is empty or throttled.
^ permalink raw reply related
* [net-next PATCH 2/3] qdisc: bulk dequeue support for qdiscs with TCQ_F_ONETXQUEUE
From: Jesper Dangaard Brouer @ 2014-09-02 14:35 UTC (permalink / raw)
To: Jesper Dangaard Brouer, David S. Miller, netdev
Cc: Florian Westphal, Hannes Frederic Sowa, Daniel Borkmann
In-Reply-To: <20140902143254.1918.8419.stgit@dragon>
Based on DaveM's recent API work on dev_hard_start_xmit(), that allows
sending/processing an entire skb list.
This patch implements qdisc bulk dequeue, by allowing multiple packets
to be dequeued in dequeue_skb().
One restriction of the new API is that every SKB must belong to the
same TXQ. This patch takes the easy way out, by restricting bulk
dequeue to qdisc's with the TCQ_F_ONETXQUEUE flag, that specifies the
qdisc only have attached a single TXQ.
Testing if this have the desired effect is the challenging part.
Generating enough packets for a backlog queue to form at the qdisc is
a challenge (because overhead else-where is a limiting factor
e.g. I've measured the pure skb_alloc/free cycle to cost 80ns).
After trying many qdisc setups, I figured out that, the easiest way to
make a backlog form is to fully load the system, all CPUs. And I can
even demonstrate this with the default MQ disc.
This is a 12 core CPU (without HT) running trafgen on all 12 cores,
via qdisc-path using sendto():
* trafgen --cpp --dev $DEV --conf udp_example02_const.trafgen --qdisc-path -t0 --cpus 12
Measuring TX pps:
* Baseline : 12,815,925 pps
* This patch: 14,892,001 pps
This is crazy fast. This measurement is actually "too-high" as
10Gbit/s wirespeed is 14,880,952 (11049 pps too fast).
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
net/sched/sch_generic.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 5b261e9..30814ef 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -56,6 +56,9 @@ static inline int dev_requeue_skb(struct sk_buff *skb, struct Qdisc *q)
return 0;
}
+/* Note that dequeue_skb can possibly return a SKB list (via skb->next).
+ * A requeued skb (via q->gso_skb) can also be a SKB list.
+ */
static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
{
struct sk_buff *skb = q->gso_skb;
@@ -70,10 +73,28 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
} else
skb = NULL;
} else {
- if (!(q->flags & TCQ_F_ONETXQUEUE) || !netif_xmit_frozen_or_stopped(txq)) {
+ if (!(q->flags & TCQ_F_ONETXQUEUE)
+ || !netif_xmit_frozen_or_stopped(txq)) {
skb = q->dequeue(q);
if (skb)
skb = validate_xmit_skb(skb, qdisc_dev(q));
+ /* bulk dequeue */
+ if (skb && !skb->next && (q->flags & TCQ_F_ONETXQUEUE)) {
+ struct sk_buff *new, *head = skb;
+ int limit = 7;
+
+ do {
+ new = q->dequeue(q);
+ if (new)
+ new = validate_xmit_skb(
+ new, qdisc_dev(q));
+ if (new) {
+ skb->next = new;
+ skb = new;
+ }
+ } while (new && --limit);
+ skb = head;
+ }
}
}
^ permalink raw reply related
* [net-next PATCH 3/3] qdisc: sysctl to adjust bulk dequeue limit
From: Jesper Dangaard Brouer @ 2014-09-02 14:36 UTC (permalink / raw)
To: Jesper Dangaard Brouer, David S. Miller, netdev
Cc: Florian Westphal, Hannes Frederic Sowa, Daniel Borkmann
In-Reply-To: <20140902143254.1918.8419.stgit@dragon>
Allow userspace to adjust how many packet the qdisc is allowed to
bulk dequeue.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
Question should we allow this to be adjusted?
include/net/sch_generic.h | 2 ++
net/core/sysctl_net_core.c | 9 +++++++++
net/sched/sch_generic.c | 4 +++-
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a3cfb8e..b0ac7b5 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -14,6 +14,8 @@ struct qdisc_walker;
struct tcf_walker;
struct module;
+extern int qdisc_bulk_dequeue_limit;
+
struct qdisc_rate_table {
struct tc_ratespec rate;
u32 data[256];
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index cf9cd13..5505841 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -361,6 +361,15 @@ static struct ctl_table net_core_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
+ {
+ .procname = "qdisc_bulk_dequeue_limit",
+ .data = &qdisc_bulk_dequeue_limit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .extra1 = &zero,
+ .extra2 = &ushort_max,
+ .proc_handler = proc_dointvec_minmax
+ },
{ }
};
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 30814ef..9cb08c0 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -34,6 +34,8 @@
const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
EXPORT_SYMBOL(default_qdisc_ops);
+int qdisc_bulk_dequeue_limit __read_mostly = 7;
+
/* Main transmission queue. */
/* Modifications to data participating in scheduling must be protected with
@@ -81,7 +83,7 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
/* bulk dequeue */
if (skb && !skb->next && (q->flags & TCQ_F_ONETXQUEUE)) {
struct sk_buff *new, *head = skb;
- int limit = 7;
+ int limit = qdisc_bulk_dequeue_limit;
do {
new = q->dequeue(q);
^ permalink raw reply related
* [PATCH net] amd-xgbe: Fix initialization of the wrong spin lock
From: Tom Lendacky @ 2014-09-02 14:40 UTC (permalink / raw)
To: netdev; +Cc: davem
During allocation and initialization of the network driver structures,
the wrong pointer is used to initialize a spin lock. Fix the spin lock
initialization by using the proper pointer.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 8aa6a93..bdf9cfa 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -172,7 +172,7 @@ static struct xgbe_channel *xgbe_alloc_rings(struct xgbe_prv_data *pdata)
}
if (i < pdata->rx_ring_count) {
- spin_lock_init(&tx_ring->lock);
+ spin_lock_init(&rx_ring->lock);
channel->rx_ring = rx_ring++;
}
^ permalink raw reply related
* Re: Order of interfaces in output of ip link
From: Vadim Kochan @ 2014-09-02 15:04 UTC (permalink / raw)
To: Ovidiu Mara; +Cc: netdev
In-Reply-To: <19313218.dxlnVqzEMb@hp>
Hi,
Seems ip tool gets interfaces list via rtnetlink from index hash list
but /proc/net/dev gets them from dev name hash list,
hence the different order.
Regards,
On Tue, Sep 2, 2014 at 5:27 PM, Ovidiu Mara <ovidiu.mara@epfl.ch> wrote:
> Hi everyone,
>
> The ip command shows the interfaces on this machine in an unnatural order (eth0 followed by eth2 then eth1).
>
> For example:
>
> ip -o link
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default \ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether 2c:59:e5:9a:4c:a4 brd ff:ff:ff:ff:ff:ff
> 3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:d8 brd ff:ff:ff:ff:ff:ff
> 4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000\ link/ether 2c:59:e5:9a:4c:a5 brd ff:ff:ff:ff:ff:ff
> 5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:d9 brd ff:ff:ff:ff:ff:ff
> 6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:da brd ff:ff:ff:ff:ff:ff
> 7: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether ac:16:2d:98:9e:db brd ff:ff:ff:ff:ff:ff
> 8: eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ link/ether a0:36:9f:26:b3:10 brd ff:ff:ff:ff:ff:ff
> 9: eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\ link/ether a0:36:9f:26:b3:12 brd ff:ff:ff:ff:ff:ff
>
> eth0 and eth1 are two ports on the same network card, so I would expect them to be shown together, as they are numbered. According to the documentation I found here ( http://www.policyrouting.org/iproute2.doc.html#ss9.1.1 ): "The number followed by a colon is the interface index or ifindex. This number uniquely identifies the interface. If you look at the output from cat /proc/net/dev you will see that the network devices are listed in the same order as the numbering you see here."
>
> However in /proc/net/dev they are shown in the natural order:
>
> cat /proc/net/dev
> Inter-| Receive | Transmit
> face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
> eth0: 1000705102 6535806 0 8946 0 0 0 2861813 5252988 39289 0 0 0 0 0 0
> eth1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> eth2: 104506836 257406 0 0 0 0 0 0 648 8 0 0 0 0 0 0
> eth3: 104506430 257405 0 0 0 0 0 0 648 8 0 0 0 0 0 0
> eth4: 104506430 257405 0 0 0 0 0 0 648 8 0 0 0 0 0 0
> eth5: 104505618 257403 0 0 0 0 0 0 648 8 0 0 0 0 0 0
> eth6: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> eth7: 396628856508 364243051 0 0 0 0 0 0 398063721522 365214422 0 0 0 0 0 0
> lo: 178 2 0 0 0 0 0 0 178 2 0 0 0 0 0 0
>
> I'm using iproute2-3.11.0.
>
> Could you please tell me if there is any workaround for this?
>
> Thanks,
> Ovidiu
>
> PS Please CC me in replies.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] sock: consistent errqueue errors and signals
From: Willem de Bruijn @ 2014-09-02 15:20 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Network Development, David Miller
In-Reply-To: <1409606744.21965.37.camel@localhost>
> From my experience in IPv6 code, we only do sk->sk_err updates directly
> in protocol error handling code. In case of UDP IPv6 errors for example
> we now notify sk_error_report two times with this patch (before the
> patch we did sk_data_ready (this is what you changed) and
> sk_error_report).
If the event is that an error is ready, is this not correct? The
wake up key should be POLLERR in both cases. In implementation
of sock_def_error_report and sock_def_readable, the difference
otherwise seems slim. I haven't checked all sk_data_ready and
sk_error_report implementations, though, so may have missed
differences for specific protocols. If this is not as obviously a strict
improvement as I thought, I'll just drop it.
> I really wonder if setting sk->sk_err in this function is the right
> thing to do.
I agree, in that it is hard to verify that this does not overwrite
an existing error. This patch only makes the behavior
consistent between enqueue and dequeue, but perhaps a
better way to achieve that is to change the dequeue side:
remove the assignment to sk->sk_err there. If so, then all
locations that currently check the state of sk->sk_err should
be changed to also check the qlen of the error queue and
if non-zero return the embedded error of the first skb. I'll
take a look whether that is feasible without adding locks
or atomics in the common path.
> It also depends on socket state bits (e.g. np->recverr) if
> the update happens. So we still cannot get rid of the protocol dependent
> sk->sk_err updates.
>
> It looks like we have to check all error handling functions in the
> protocols. Maybe timestamp code needs to adapt?
Does the above sound okay, or did you mean something else?
>
> Thanks,
> Hannes
>
>
^ permalink raw reply
* Re: [net-next PATCH 2/3] qdisc: bulk dequeue support for qdiscs with TCQ_F_ONETXQUEUE
From: Eric Dumazet @ 2014-09-02 15:22 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: David S. Miller, netdev, Florian Westphal, Hannes Frederic Sowa,
Daniel Borkmann
In-Reply-To: <20140902143538.1918.82870.stgit@dragon>
On Tue, 2014-09-02 at 16:35 +0200, Jesper Dangaard Brouer wrote:
> This is crazy fast. This measurement is actually "too-high" as
> 10Gbit/s wirespeed is 14,880,952 (11049 pps too fast).
>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---
This looks buggy, you forgot about GSO.
(You did the test only for first dequeued packet, not the followings)
Make sure you test your patch with something else than pktgen.
Also, our idea was to use a byte count limit (aka BQL)
If we dequeue 8 64KB packets, this patch adds head of line blocking,
which we fought hard.
^ permalink raw reply
* Re: [net-next PATCH 3/3] qdisc: sysctl to adjust bulk dequeue limit
From: Jesper Dangaard Brouer @ 2014-09-02 15:23 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: David S. Miller, netdev, Florian Westphal, Hannes Frederic Sowa,
Daniel Borkmann
In-Reply-To: <20140902143553.1918.73632.stgit@dragon>
On Tue, 02 Sep 2014 16:36:09 +0200
Jesper Dangaard Brouer <brouer@redhat.com> wrote:
> Allow userspace to adjust how many packet the qdisc is allowed to
> bulk dequeue.
>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
>
> ---
> Question should we allow this to be adjusted?
>
> include/net/sch_generic.h | 2 ++
> net/core/sysctl_net_core.c | 9 +++++++++
> net/sched/sch_generic.c | 4 +++-
> 3 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index a3cfb8e..b0ac7b5 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -14,6 +14,8 @@ struct qdisc_walker;
> struct tcf_walker;
> struct module;
>
> +extern int qdisc_bulk_dequeue_limit;
> +
> struct qdisc_rate_table {
> struct tc_ratespec rate;
> u32 data[256];
> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> index cf9cd13..5505841 100644
> --- a/net/core/sysctl_net_core.c
> +++ b/net/core/sysctl_net_core.c
> @@ -361,6 +361,15 @@ static struct ctl_table net_core_table[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec
> },
> + {
> + .procname = "qdisc_bulk_dequeue_limit",
> + .data = &qdisc_bulk_dequeue_limit,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .extra1 = &zero,
> + .extra2 = &ushort_max,
> + .proc_handler = proc_dointvec_minmax
> + },
> { }
> };
>
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index 30814ef..9cb08c0 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -34,6 +34,8 @@
> const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
> EXPORT_SYMBOL(default_qdisc_ops);
>
> +int qdisc_bulk_dequeue_limit __read_mostly = 7;
> +
> /* Main transmission queue. */
>
> /* Modifications to data participating in scheduling must be protected with
> @@ -81,7 +83,7 @@ static inline struct sk_buff *dequeue_skb(struct Qdisc *q)
> /* bulk dequeue */
> if (skb && !skb->next && (q->flags & TCQ_F_ONETXQUEUE)) {
Will update the patch with:
- if (skb && !skb->next && (q->flags & TCQ_F_ONETXQUEUE)) {
+ if (qdisc_bulk_dequeue_limit && skb &&
+ !skb->next && (q->flags & TCQ_F_ONETXQUEUE)) {
To allow qdisc_bulk_dequeue_limit==0 to actually disable bulking.
> struct sk_buff *new, *head = skb;
> - int limit = 7;
> + int limit = qdisc_bulk_dequeue_limit;
>
> do {
> new = q->dequeue(q);
>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ 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