* Re: [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames
From: Eric Dumazet @ 2014-09-19 23:37 UTC (permalink / raw)
To: Prashant Sreedharan
Cc: Vladislav Yasevich, netdev, Vladislav Yasevich, Michael Chan
In-Reply-To: <1411168475.6401.37.camel@prashant>
On Fri, 2014-09-19 at 16:14 -0700, Prashant Sreedharan wrote:
> The NIC will not receive frames of size > mtu + ETH_HLEN + VLAN_HLEN it
> will update the oversize_frame count and drop it. The check is to make
> sure the additional 4 bytes is due to a valid vlan header.
I see, thanks for the explanation ;)
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Herbert Xu @ 2014-09-19 23:31 UTC (permalink / raw)
To: David Miller; +Cc: nicolas.dichtel, netdev
In-Reply-To: <20140919.160351.1490731758266834534.davem@davemloft.net>
On Fri, Sep 19, 2014 at 04:03:51PM -0400, David Miller wrote:
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Wed, 17 Sep 2014 10:08:08 +0200
>
> > Since commit 412ca1550cbe ("macvlan: Move broadcasts into a work queue"), the
> > driver uses tx_queue_len of the master device as the limit of packets enqueuing.
> > Problem is that virtual drivers have this value set to 0, thus all broadcast
> > packets were rejected.
> > Because tx_queue_len was arbitrarily chosen, I replace it with a static limit
> > of 1000 (also arbitrarily chosen).
> >
> > CC: Herbert Xu <herbert@gondor.apana.org.au>
> > Reported-by: Thibaut Collet <thibaut.collet@6wind.com>
> > Suggested-by: Thibaut Collet <thibaut.collet@6wind.com>
> > Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
> > Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
> Herbert please review.
While it would be nice to maintain the ability to chnge this
parameter, I'm fine with this patch as it stands since it fixes
a real regression.
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames
From: Prashant Sreedharan @ 2014-09-19 23:14 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Vladislav Yasevich, netdev, Vladislav Yasevich, Michael Chan
In-Reply-To: <1411167552.26859.58.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, 2014-09-19 at 15:59 -0700, Eric Dumazet wrote:
> On Fri, 2014-09-19 at 18:23 -0400, Vladislav Yasevich wrote:
> > When receiving a vlan-tagged frame that still contains
> > a vlan header, the length of the packet will be greater
> > then MTU+ETH_HLEN since it will account of the extra
> > vlan header. TG3 checks this for the case for 802.1Q,
> > but not for 802.1ad. As a result, full sized 802.1ad
> > frames get dropped by the card.
> >
> > Add a check for 802.1ad protocol when receiving full
> > sized frames.
> >
> > Suggested-by: Prashant Sreedharan <prashant@broadcom.com>
> > CC: Prashant Sreedharan <prashant@broadcom.com>
> > CC: Michael Chan <mchan@broadcom.com>
> > Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> > ---
> > drivers/net/ethernet/broadcom/tg3.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index 0a0938d..4f674f9 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
> > skb->protocol = eth_type_trans(skb, tp->dev);
> >
> > if (len > (tp->dev->mtu + ETH_HLEN) &&
> > - skb->protocol != htons(ETH_P_8021Q)) {
> > + skb->protocol != htons(ETH_P_8021Q) &&
> > + skb->protocol != htons(ETH_P_8021AD)) {
> > dev_kfree_skb_any(skb);
> > goto drop_it_no_recycle;
> > }
>
> Really I do not understand what is the value of this check.
>
> If NIC is dumb enough to send oversized frames, what prevents these
> frames being VLAN ones, and this test wont avoid the crash anyway ?
>
The NIC will not receive frames of size > mtu + ETH_HLEN + VLAN_HLEN it
will update the oversize_frame count and drop it. The check is to make
sure the additional 4 bytes is due to a valid vlan header.
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Eric Dumazet @ 2014-09-19 23:09 UTC (permalink / raw)
To: Cong Wang; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <CAHA+R7MxiP9gZe2daJunXOKNa6sQd9JZ_4_ko6ipYGtshVP0bg@mail.gmail.com>
On Fri, 2014-09-19 at 15:57 -0700, Cong Wang wrote:
> On Fri, Sep 19, 2014 at 3:44 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >
> > Therefore, suggesting user to 'fix tx_queue_len' is totally wrong.
>
> How about HTB? You said:
>
> "Only when you want to have say HTB on the bonding, you might need to
> change tx_queue_len"
Again, what is your point ?
How is it relevant to this particular bug report ?
Don't you think people using HTB on a virtual device do not already know
its better to either :
- Not use the default pfifo on htb classes
- Increase device queue len on the device.
Its been like that since a decade. No changes are needed in bond driver.
^ permalink raw reply
* Re: [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames
From: Eric Dumazet @ 2014-09-19 22:59 UTC (permalink / raw)
To: Vladislav Yasevich
Cc: netdev, Vladislav Yasevich, Prashant Sreedharan, Michael Chan
In-Reply-To: <1411165389-21276-3-git-send-email-vyasevic@redhat.com>
On Fri, 2014-09-19 at 18:23 -0400, Vladislav Yasevich wrote:
> When receiving a vlan-tagged frame that still contains
> a vlan header, the length of the packet will be greater
> then MTU+ETH_HLEN since it will account of the extra
> vlan header. TG3 checks this for the case for 802.1Q,
> but not for 802.1ad. As a result, full sized 802.1ad
> frames get dropped by the card.
>
> Add a check for 802.1ad protocol when receiving full
> sized frames.
>
> Suggested-by: Prashant Sreedharan <prashant@broadcom.com>
> CC: Prashant Sreedharan <prashant@broadcom.com>
> CC: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> ---
> drivers/net/ethernet/broadcom/tg3.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 0a0938d..4f674f9 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
> skb->protocol = eth_type_trans(skb, tp->dev);
>
> if (len > (tp->dev->mtu + ETH_HLEN) &&
> - skb->protocol != htons(ETH_P_8021Q)) {
> + skb->protocol != htons(ETH_P_8021Q) &&
> + skb->protocol != htons(ETH_P_8021AD)) {
> dev_kfree_skb_any(skb);
> goto drop_it_no_recycle;
> }
Really I do not understand what is the value of this check.
If NIC is dumb enough to send oversized frames, what prevents these
frames being VLAN ones, and this test wont avoid the crash anyway ?
^ permalink raw reply
* RE: [PATCH] scsi: fix SCSI_BNX2X_FCOE dependencies and build errors
From: Anish Bhatt @ 2014-09-19 22:59 UTC (permalink / raw)
To: Randy Dunlap, netdev@vger.kernel.org, David Miller; +Cc: LKML, James Bottomley
In-Reply-To: <541CB055.6000504@infradead.org>
Leaves only 1 warning still reproduceable :
(LIBFCOE && TCM_QLA2XXX) selects LIBFC which has unmet direct dependencies (SCSI_LOWLEVEL && SCSI && SCSI_FC_ATTRS),
so maybe that needs a fix too ? All the other fcoe/scsi menu entries behave
as expected.
Tested-by: Anish Bhatt <anish@chelsio.com>
________________________________________
From: Randy Dunlap [rdunlap@infradead.org]
Sent: Friday, September 19, 2014 3:38 PM
To: netdev@vger.kernel.org; David Miller
Cc: LKML; Anish Bhatt; James Bottomley
Subject: [PATCH] scsi: fix SCSI_BNX2X_FCOE dependencies and build errors
From: Randy Dunlap <rdunlap@infradead.org>
Don't enable NETDEVICES when NET is not enabled. That causes
build warnings and errors.
warning: (SCSI_CXGB3_ISCSI && SCSI_CXGB4_ISCSI && SCSI_BNX2X_FCOE) selects NETDEVICES which has unmet direct dependencies (NET)
warning: (SCSI_CXGB3_ISCSI && SCSI_CXGB4_ISCSI && SCSI_BNX2_ISCSI && SCSI_BNX2X_FCOE) selects ETHERNET which has unmet direct dependencies (NETDEVICES && NET)
warning: (SCSI_BNX2X_FCOE && LIBFCOE && TCM_QLA2XXX) selects LIBFC which has unmet direct dependencies (SCSI_LOWLEVEL && SCSI && SCSI_FC_ATTRS)
../drivers/net/ethernet/cisco/enic/enic_main.c: In function 'enic_rq_indicate_buf':
../drivers/net/ethernet/cisco/enic/enic_main.c:1077:3: error: implicit declaration of function 'skb_mark_napi_id' [-Werror=implicit-function-declaration]
../drivers/net/ethernet/cisco/enic/enic_main.c:1078:3: error: implicit declaration of function 'enic_poll_busy_polling' [-Werror=implicit-function-declaration]
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
drivers/scsi/bnx2fc/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- linux-next-20140918.orig/drivers/scsi/bnx2fc/Kconfig
+++ linux-next-20140918/drivers/scsi/bnx2fc/Kconfig
@@ -1,7 +1,8 @@
config SCSI_BNX2X_FCOE
tristate "QLogic NetXtreme II FCoE support"
- depends on PCI
+ depends on PCI && NET
depends on (IPV6 || IPV6=n)
+ depends on SCSI_FC_ATTRS
select NETDEVICES
select ETHERNET
select NET_VENDOR_BROADCOM
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Cong Wang @ 2014-09-19 22:57 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <1411166670.26859.48.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Sep 19, 2014 at 3:44 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> Therefore, suggesting user to 'fix tx_queue_len' is totally wrong.
How about HTB? You said:
"Only when you want to have say HTB on the bonding, you might need to
change tx_queue_len"
^ permalink raw reply
* Re: [RFC net-next PATCH V3 0/2] qdisc bulk dequeuing and utilizing delayed tailptr updates
From: Eric Dumazet @ 2014-09-19 22:52 UTC (permalink / raw)
To: Cong Wang
Cc: Jesper Dangaard Brouer, netdev, David S. Miller, Tom Herbert,
Hannes Frederic Sowa, Florian Westphal, Daniel Borkmann,
Jamal Hadi Salim, Alexander Duyck, John Fastabend, Dave Taht,
toke
In-Reply-To: <CAHA+R7NHRaLtzBJd_Sc6_aNLMs=iGHTBK8j9Bq0ntCDg-meLZg@mail.gmail.com>
On Fri, 2014-09-19 at 15:39 -0700, Cong Wang wrote:
> Then why commits like this one?
>
> commit 7070ce0a6419a118842298bc967061ad6cea40db
> Author: Alexander Duyck <alexander.h.duyck@intel.com>
> Date: Sat Sep 28 06:00:37 2013 +0000
>
> i40e: Add support for Tx byte queue limits
>
> Implement BQL (byte queue limit) support in i40e.
>
Read again my full mail, don't jump into conclusions in the middle of
it.
>
> >
> > If a device driver do nothing about BQL, byte_queue_limits/limit will be
> > zero by default.
See here ? Its all explained. If a device driver do not implement BQL,
limit will be zero, and bulk dequeue will _automatically_ be disabled.
BQL has no 'cost' if a driver does not use it.
Its basically fields which will never be updated.
(cf in struct netdev_queue :
struct dql dql;
)
>
> Also note that for some virtual device, BQL may make no sense at all,
> at least veth doesn't even use a TX queue (I know it has tx-0 mostly for
> qdisc). Perhaps all NETIF_F_LLTX ones?
Lets focus on the normal cases, where virtual devices do not have any
qdisc.
We are talking here of _qdisc_ bulk dequeue, right ?
^ permalink raw reply
* [PATCH iproute2] ip link: Shortify printing the usage of link type
From: Vadim Kochan @ 2014-09-19 22:43 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
Allow to print particular link type usage by:
ip link help [TYPE]
Currently to print usage for some link type it is needed
to use the following way:
ip link { add | del | set } type TYPE help
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
ip/ip_common.h | 2 ++
ip/iplink.c | 24 ++++++++++++++++++++++--
ip/iplink_bond.c | 16 ++++++++++++++--
ip/iplink_can.c | 16 ++++++++++++++--
ip/iplink_hsr.c | 16 ++++++++++++++--
ip/iplink_ipoib.c | 15 +++++++++++++--
ip/iplink_macvlan.c | 16 ++++++++++++++--
ip/iplink_macvtap.c | 14 +++++++++++++-
ip/iplink_vlan.c | 16 ++++++++++++++--
ip/iplink_vxlan.c | 32 ++++++++++++++++++++++----------
ip/link_gre.c | 33 +++++++++++++++++++++++----------
ip/link_gre6.c | 45 +++++++++++++++++++++++++++++----------------
ip/link_ip6tnl.c | 42 +++++++++++++++++++++++++++---------------
ip/link_iptnl.c | 39 ++++++++++++++++++++++++++-------------
ip/link_veth.c | 14 +++++++++++++-
ip/link_vti.c | 28 ++++++++++++++++++++--------
16 files changed, 280 insertions(+), 88 deletions(-)
diff --git a/ip/ip_common.h b/ip/ip_common.h
index e56d1ac..8351463 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -76,6 +76,8 @@ struct link_util
struct rtattr *[]);
void (*print_xstats)(struct link_util *, FILE *,
struct rtattr *);
+ void (*print_help)(struct link_util *, int, char **,
+ FILE *);
bool slave;
};
diff --git a/ip/iplink.c b/ip/iplink.c
index ea06871..c9f0d9b 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -85,6 +85,7 @@ void iplink_usage(void)
fprintf(stderr, " ip link show [ DEVICE | group GROUP ] [up]\n");
if (iplink_have_newlink()) {
+ fprintf(stderr, " ip link help [ TYPE ]\n");
fprintf(stderr, "\n");
fprintf(stderr, "TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap |\n");
fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan |\n");
@@ -1111,6 +1112,23 @@ static int do_set(int argc, char **argv)
}
#endif /* IPLINK_IOCTL_COMPAT */
+static void do_help(int argc, char **argv)
+{
+ struct link_util *lu = NULL;
+
+ if (argc <= 0) {
+ usage();
+ return ;
+ }
+
+ lu = get_link_kind(*argv);
+
+ if (lu && lu->print_help)
+ lu->print_help(lu, argc-1, argv+1, stdout);
+ else
+ usage();
+}
+
int do_iplink(int argc, char **argv)
{
if (argc > 0) {
@@ -1140,8 +1158,10 @@ int do_iplink(int argc, char **argv)
matches(*argv, "lst") == 0 ||
matches(*argv, "list") == 0)
return ipaddr_list_link(argc-1, argv+1);
- if (matches(*argv, "help") == 0)
- usage();
+ if (matches(*argv, "help") == 0) {
+ do_help(argc-1, argv+1);
+ return 0;
+ }
} else
return ipaddr_list_link(0, NULL);
diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c
index b5c511e..da0a23f 100644
--- a/ip/iplink_bond.c
+++ b/ip/iplink_bond.c
@@ -112,9 +112,9 @@ static int get_index(const char **tbl, char *name)
return -1;
}
-static void explain(void)
+static void print_explain(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage: ... bond [ mode BONDMODE ] [ active_slave SLAVE_DEV ]\n"
" [ clear_active_slave ] [ miimon MIIMON ]\n"
" [ updelay UPDELAY ] [ downdelay DOWNDELAY ]\n"
@@ -147,6 +147,11 @@ static void explain(void)
);
}
+static void explain(void)
+{
+ print_explain(stderr);
+}
+
static int bond_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
@@ -527,9 +532,16 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
}
}
+static void bond_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util bond_link_util = {
.id = "bond",
.maxattr = IFLA_BOND_MAX,
.parse_opt = bond_parse_opt,
.print_opt = bond_print_opt,
+ .print_help = bond_print_help,
};
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index 3bef82a..5b92426 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -19,9 +19,9 @@
#include "utils.h"
#include "ip_common.h"
-static void usage(void)
+static void print_usage(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage: ip link set DEVICE type can\n"
"\t[ bitrate BITRATE [ sample-point SAMPLE-POINT] ] | \n"
"\t[ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1\n "
@@ -52,6 +52,11 @@ static void usage(void)
);
}
+static void usage(void)
+{
+ print_usage(stderr);
+}
+
static int get_float(float *val, const char *arg)
{
float res;
@@ -344,10 +349,17 @@ static void can_print_xstats(struct link_util *lu,
}
}
+static void can_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util can_link_util = {
.id = "can",
.maxattr = IFLA_CAN_MAX,
.parse_opt = can_parse_opt,
.print_opt = can_print_opt,
.print_xstats = can_print_xstats,
+ .print_help = can_print_help,
};
diff --git a/ip/iplink_hsr.c b/ip/iplink_hsr.c
index 136da35..65fbec8 100644
--- a/ip/iplink_hsr.c
+++ b/ip/iplink_hsr.c
@@ -21,9 +21,9 @@
#include "utils.h"
#include "ip_common.h"
-static void usage(void)
+static void print_usage(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage:\tip link add name NAME type hsr slave1 SLAVE1-IF slave2 SLAVE2-IF\n"
"\t[ supervision ADDR-BYTE ]\n"
"\n"
@@ -36,6 +36,11 @@ static void usage(void)
" frames (default = 0)\n");
}
+static void usage(void)
+{
+ print_usage(stderr);
+}
+
static int hsr_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
@@ -121,9 +126,16 @@ static void hsr_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
b1, sizeof(b1)));
}
+static void hsr_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util hsr_link_util = {
.id = "hsr",
.maxattr = IFLA_VLAN_MAX,
.parse_opt = hsr_parse_opt,
.print_opt = hsr_print_opt,
+ .print_help = hsr_print_help,
};
diff --git a/ip/iplink_ipoib.c b/ip/iplink_ipoib.c
index 5c1c68c..6087cbe 100644
--- a/ip/iplink_ipoib.c
+++ b/ip/iplink_ipoib.c
@@ -19,9 +19,9 @@
#include "utils.h"
#include "ip_common.h"
-static void explain(void)
+static void print_explain(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage: ... ipoib [pkey PKEY] [mode {datagram | connected}]"
"[umcast {0|1}]\n"
"\n"
@@ -29,6 +29,10 @@ static void explain(void)
);
}
+static void explain(void)
+{
+ print_explain(stderr);
+}
static int mode_arg(void)
{
@@ -106,9 +110,16 @@ static void ipoib_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "umcast %.4x ", rta_getattr_u16(tb[IFLA_IPOIB_UMCAST]));
}
+static void ipoib_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util ipoib_link_util = {
.id = "ipoib",
.maxattr = IFLA_IPOIB_MAX,
.parse_opt = ipoib_parse_opt,
.print_opt = ipoib_print_opt,
+ .print_help = ipoib_print_help,
};
diff --git a/ip/iplink_macvlan.c b/ip/iplink_macvlan.c
index ec51106..826b659 100644
--- a/ip/iplink_macvlan.c
+++ b/ip/iplink_macvlan.c
@@ -20,13 +20,18 @@
#include "utils.h"
#include "ip_common.h"
-static void explain(void)
+static void print_explain(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage: ... macvlan mode { private | vepa | bridge | passthru }\n"
);
}
+static void explain(void)
+{
+ print_explain(stderr);
+}
+
static int mode_arg(void)
{
fprintf(stderr, "Error: argument of \"mode\" must be \"private\", "
@@ -88,9 +93,16 @@ static void macvlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]
: "unknown");
}
+static void macvlan_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util macvlan_link_util = {
.id = "macvlan",
.maxattr = IFLA_MACVLAN_MAX,
.parse_opt = macvlan_parse_opt,
.print_opt = macvlan_print_opt,
+ .print_help = macvlan_print_help,
};
diff --git a/ip/iplink_macvtap.c b/ip/iplink_macvtap.c
index bea9f0c..9c2cd74 100644
--- a/ip/iplink_macvtap.c
+++ b/ip/iplink_macvtap.c
@@ -17,13 +17,18 @@
#include "utils.h"
#include "ip_common.h"
-static void explain(void)
+static void print_explain(FILE *f)
{
fprintf(stderr,
"Usage: ... macvtap mode { private | vepa | bridge | passthru }\n"
);
}
+static void explain(void)
+{
+ print_explain(stderr);
+}
+
static int mode_arg(const char *arg)
{
fprintf(stderr, "Error: argument of \"mode\" must be \"private\", "
@@ -85,9 +90,16 @@ static void macvtap_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]
: "unknown");
}
+static void macvtap_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util macvtap_link_util = {
.id = "macvtap",
.maxattr = IFLA_MACVLAN_MAX,
.parse_opt = macvtap_parse_opt,
.print_opt = macvtap_print_opt,
+ .print_help = macvtap_print_help,
};
diff --git a/ip/iplink_vlan.c b/ip/iplink_vlan.c
index 94b52ae..5bd766f 100644
--- a/ip/iplink_vlan.c
+++ b/ip/iplink_vlan.c
@@ -18,9 +18,9 @@
#include "utils.h"
#include "ip_common.h"
-static void explain(void)
+static void print_explain(FILE *f)
{
- fprintf(stderr,
+ fprintf(f,
"Usage: ... vlan [ protocol VLANPROTO ] id VLANID"
" [ FLAG-LIST ]\n"
" [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]\n"
@@ -35,6 +35,11 @@ static void explain(void)
);
}
+static void explain(void)
+{
+ print_explain(stderr);
+}
+
static int on_off(const char *msg, const char *arg)
{
fprintf(stderr, "Error: argument of \"%s\" must be \"on\" or \"off\", not \"%s\"\n", msg, arg);
@@ -226,9 +231,16 @@ static void vlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
vlan_print_map(f, "egress-qos-map", tb[IFLA_VLAN_EGRESS_QOS]);
}
+static void vlan_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util vlan_link_util = {
.id = "vlan",
.maxattr = IFLA_VLAN_MAX,
.parse_opt = vlan_parse_opt,
.print_opt = vlan_print_opt,
+ .print_help = vlan_print_help,
};
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 53c50ac..67990bb 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -21,18 +21,23 @@
#include "utils.h"
#include "ip_common.h"
+static void print_explain(FILE *f)
+{
+ fprintf(f, "Usage: ... vxlan id VNI [ { group | remote } ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ ttl TTL ] [ tos TOS ] [ dev PHYS_DEV ]\n");
+ fprintf(f, " [ dstport PORT ] [ srcport MIN MAX ]\n");
+ fprintf(f, " [ [no]learning ] [ [no]proxy ] [ [no]rsc ]\n");
+ fprintf(f, " [ [no]l2miss ] [ [no]l3miss ]\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: VNI := 0-16777215\n");
+ fprintf(f, " ADDR := { IP_ADDRESS | any }\n");
+ fprintf(f, " TOS := { NUMBER | inherit }\n");
+ fprintf(f, " TTL := { 1..255 | inherit }\n");
+}
+
static void explain(void)
{
- fprintf(stderr, "Usage: ... vxlan id VNI [ { group | remote } ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ ttl TTL ] [ tos TOS ] [ dev PHYS_DEV ]\n");
- fprintf(stderr, " [ dstport PORT ] [ srcport MIN MAX ]\n");
- fprintf(stderr, " [ [no]learning ] [ [no]proxy ] [ [no]rsc ]\n");
- fprintf(stderr, " [ [no]l2miss ] [ [no]l3miss ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: VNI := 0-16777215\n");
- fprintf(stderr, " ADDR := { IP_ADDRESS | any }\n");
- fprintf(stderr, " TOS := { NUMBER | inherit }\n");
- fprintf(stderr, " TTL := { 1..255 | inherit }\n");
+ print_explain(stderr);
}
static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
@@ -364,9 +369,16 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fprintf(f, "maxaddr %u ", maxaddr);
}
+static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_explain(f);
+}
+
struct link_util vxlan_link_util = {
.id = "vxlan",
.maxattr = IFLA_VXLAN_MAX,
.parse_opt = vxlan_parse_opt,
.print_opt = vxlan_print_opt,
+ .print_help = vxlan_print_help,
};
diff --git a/ip/link_gre.c b/ip/link_gre.c
index fda84d8..83653d0 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -23,19 +23,24 @@
#include "ip_common.h"
#include "tunnel.h"
+static void print_usage(FILE *f)
+{
+ fprintf(f, "Usage: ip link { add | set | change | replace | del } NAME\n");
+ fprintf(f, " type { gre | gretap } [ remote ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n");
+ fprintf(f, " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: NAME := STRING\n");
+ fprintf(f, " ADDR := { IP_ADDRESS | any }\n");
+ fprintf(f, " TOS := { NUMBER | inherit }\n");
+ fprintf(f, " TTL := { 1..255 | inherit }\n");
+ fprintf(f, " KEY := { DOTTED_QUAD | NUMBER }\n");
+}
+
static void usage(void) __attribute__((noreturn));
static void usage(void)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " type { gre | gretap } [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n");
- fprintf(stderr, " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := { IP_ADDRESS | any }\n");
- fprintf(stderr, " TOS := { NUMBER | inherit }\n");
- fprintf(stderr, " TTL := { 1..255 | inherit }\n");
- fprintf(stderr, " KEY := { DOTTED_QUAD | NUMBER }\n");
+ print_usage(stderr);
exit(-1);
}
@@ -354,11 +359,18 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fputs("ocsum ", f);
}
+static void gre_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util gre_link_util = {
.id = "gre",
.maxattr = IFLA_GRE_MAX,
.parse_opt = gre_parse_opt,
.print_opt = gre_print_opt,
+ .print_help = gre_print_help,
};
struct link_util gretap_link_util = {
@@ -366,4 +378,5 @@ struct link_util gretap_link_util = {
.maxattr = IFLA_GRE_MAX,
.parse_opt = gre_parse_opt,
.print_opt = gre_print_opt,
+ .print_help = gre_print_help,
};
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index c7183e2..f18919c 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -30,25 +30,30 @@
#define DEFAULT_TNL_HOP_LIMIT (64)
-static void usage(void) __attribute__((noreturn));
-static void usage(void)
+static void print_usage(FILE *f)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " type { ip6gre | ip6gretap } [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n");
- fprintf(stderr, " [ hoplimit TTL ] [ encaplimit ELIM ]\n");
- fprintf(stderr, " [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n");
- fprintf(stderr, " [ dscp inherit ] [ dev PHYS_DEV ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := IPV6_ADDRESS\n");
- fprintf(stderr, " TTL := { 0..255 } (default=%d)\n",
+ fprintf(f, "Usage: ip link { add | set | change | replace | del } NAME\n");
+ fprintf(f, " type { ip6gre | ip6gretap } [ remote ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n");
+ fprintf(f, " [ hoplimit TTL ] [ encaplimit ELIM ]\n");
+ fprintf(f, " [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n");
+ fprintf(f, " [ dscp inherit ] [ dev PHYS_DEV ]\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: NAME := STRING\n");
+ fprintf(f, " ADDR := IPV6_ADDRESS\n");
+ fprintf(f, " TTL := { 0..255 } (default=%d)\n",
DEFAULT_TNL_HOP_LIMIT);
- fprintf(stderr, " KEY := { DOTTED_QUAD | NUMBER }\n");
- fprintf(stderr, " ELIM := { none | 0..255 }(default=%d)\n",
+ fprintf(f, " KEY := { DOTTED_QUAD | NUMBER }\n");
+ fprintf(f, " ELIM := { none | 0..255 }(default=%d)\n",
IPV6_DEFAULT_TNL_ENCAP_LIMIT);
- fprintf(stderr, " TCLASS := { 0x0..0xff | inherit }\n");
- fprintf(stderr, " FLOWLABEL := { 0x0..0xfffff | inherit }\n");
+ fprintf(f, " TCLASS := { 0x0..0xff | inherit }\n");
+ fprintf(f, " FLOWLABEL := { 0x0..0xfffff | inherit }\n");
+}
+
+static void usage(void) __attribute__((noreturn));
+static void usage(void)
+{
+ print_usage(stderr);
exit(-1);
}
@@ -386,11 +391,18 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
fputs("ocsum ", f);
}
+static void gre_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util ip6gre_link_util = {
.id = "ip6gre",
.maxattr = IFLA_GRE_MAX,
.parse_opt = gre_parse_opt,
.print_opt = gre_print_opt,
+ .print_help = gre_print_help,
};
struct link_util ip6gretap_link_util = {
@@ -398,4 +410,5 @@ struct link_util ip6gretap_link_util = {
.maxattr = IFLA_GRE_MAX,
.parse_opt = gre_parse_opt,
.print_opt = gre_print_opt,
+ .print_help = gre_print_help,
};
diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index 1c7f56c..5ed3d5a 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -29,24 +29,29 @@
#define DEFAULT_TNL_HOP_LIMIT (64)
-static void usage(void) __attribute__((noreturn));
-static void usage(void)
+static void print_usage(FILE *f)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " [ mode { ip6ip6 | ipip6 | any } ]\n");
- fprintf(stderr, " type ip6tnl [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ dev PHYS_DEV ] [ encaplimit ELIM ]\n");
- fprintf(stderr ," [ hoplimit HLIM ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n");
- fprintf(stderr, " [ dscp inherit ] [ fwmark inherit ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := IPV6_ADDRESS\n");
- fprintf(stderr, " ELIM := { none | 0..255 }(default=%d)\n",
+ fprintf(f, "Usage: ip link { add | set | change | replace | del } NAME\n");
+ fprintf(f, " [ mode { ip6ip6 | ipip6 | any } ]\n");
+ fprintf(f, " type ip6tnl [ remote ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ dev PHYS_DEV ] [ encaplimit ELIM ]\n");
+ fprintf(f ," [ hoplimit HLIM ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ]\n");
+ fprintf(f, " [ dscp inherit ] [ fwmark inherit ]\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: NAME := STRING\n");
+ fprintf(f, " ADDR := IPV6_ADDRESS\n");
+ fprintf(f, " ELIM := { none | 0..255 }(default=%d)\n",
IPV6_DEFAULT_TNL_ENCAP_LIMIT);
- fprintf(stderr, " HLIM := 0..255 (default=%d)\n",
+ fprintf(f, " HLIM := 0..255 (default=%d)\n",
DEFAULT_TNL_HOP_LIMIT);
- fprintf(stderr, " TCLASS := { 0x0..0xff | inherit }\n");
- fprintf(stderr, " FLOWLABEL := { 0x0..0xfffff | inherit }\n");
+ fprintf(f, " TCLASS := { 0x0..0xff | inherit }\n");
+ fprintf(f, " FLOWLABEL := { 0x0..0xfffff | inherit }\n");
+}
+
+static void usage(void) __attribute__((noreturn));
+static void usage(void)
+{
+ print_usage(stderr);
exit(-1);
}
@@ -335,9 +340,16 @@ static void ip6tunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb
fprintf(f, "fwmark inherit ");
}
+static void ip6tunnel_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util ip6tnl_link_util = {
.id = "ip6tnl",
.maxattr = IFLA_IPTUN_MAX,
.parse_opt = ip6tunnel_parse_opt,
.print_opt = ip6tunnel_print_opt,
+ .print_help = ip6tunnel_print_help,
};
diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c
index d5324f8..ea13ce9 100644
--- a/ip/link_iptnl.c
+++ b/ip/link_iptnl.c
@@ -23,22 +23,27 @@
#include "ip_common.h"
#include "tunnel.h"
-static void usage(int sit) __attribute__((noreturn));
-static void usage(int sit)
+static void print_usage(FILE *f, int sit)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " type { ipip | sit } [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n");
- fprintf(stderr, " [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n");
+ fprintf(f, "Usage: ip link { add | set | change | replace | del } NAME\n");
+ fprintf(f, " type { ipip | sit } [ remote ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ ttl TTL ] [ tos TOS ] [ [no]pmtudisc ] [ dev PHYS_DEV ]\n");
+ fprintf(f, " [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n");
if (sit) {
- fprintf(stderr, " [ mode { ip6ip | ipip | any } ]\n");
- fprintf(stderr, " [ isatap ]\n");
+ fprintf(f, " [ mode { ip6ip | ipip | any } ]\n");
+ fprintf(f, " [ isatap ]\n");
}
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := { IP_ADDRESS | any }\n");
- fprintf(stderr, " TOS := { NUMBER | inherit }\n");
- fprintf(stderr, " TTL := { 1..255 | inherit }\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: NAME := STRING\n");
+ fprintf(f, " ADDR := { IP_ADDRESS | any }\n");
+ fprintf(f, " TOS := { NUMBER | inherit }\n");
+ fprintf(f, " TTL := { 1..255 | inherit }\n");
+}
+
+static void usage(int sit) __attribute__((noreturn));
+static void usage(int sit)
+{
+ print_usage(stderr, sit);
exit(-1);
}
@@ -347,11 +352,18 @@ static void iptunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[
}
}
+static void iptunnel_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f, strcmp(lu->id, "sit") == 0);
+}
+
struct link_util ipip_link_util = {
.id = "ipip",
.maxattr = IFLA_IPTUN_MAX,
.parse_opt = iptunnel_parse_opt,
.print_opt = iptunnel_print_opt,
+ .print_help = iptunnel_print_help,
};
struct link_util sit_link_util = {
@@ -359,4 +371,5 @@ struct link_util sit_link_util = {
.maxattr = IFLA_IPTUN_MAX,
.parse_opt = iptunnel_parse_opt,
.print_opt = iptunnel_print_opt,
+ .print_help = iptunnel_print_help,
};
diff --git a/ip/link_veth.c b/ip/link_veth.c
index 1196a1b..314216c 100644
--- a/ip/link_veth.c
+++ b/ip/link_veth.c
@@ -17,12 +17,17 @@
#include "utils.h"
#include "ip_common.h"
-static void usage(void)
+static void print_usage(FILE *f)
{
printf("Usage: ip link <options> type veth [peer <options>]\n"
"To get <options> type 'ip link add help'\n");
}
+static void usage(void)
+{
+ print_usage(stderr);
+}
+
static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *hdr)
{
@@ -79,7 +84,14 @@ static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
return argc - 1 - err;
}
+static void veth_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util veth_link_util = {
.id = "veth",
.parse_opt = veth_parse_opt,
+ .print_help = veth_print_help,
};
diff --git a/ip/link_vti.c b/ip/link_vti.c
index 6274c83..59ac4c4 100644
--- a/ip/link_vti.c
+++ b/ip/link_vti.c
@@ -24,17 +24,22 @@
#include "tunnel.h"
+static void print_usage(FILE *f)
+{
+ fprintf(f, "Usage: ip link { add | set | change | replace | del } NAME\n");
+ fprintf(f, " type { vti } [ remote ADDR ] [ local ADDR ]\n");
+ fprintf(f, " [ [i|o]key KEY ]\n");
+ fprintf(f, " [ dev PHYS_DEV ]\n");
+ fprintf(f, "\n");
+ fprintf(f, "Where: NAME := STRING\n");
+ fprintf(f, " ADDR := { IP_ADDRESS }\n");
+ fprintf(f, " KEY := { DOTTED_QUAD | NUMBER }\n");
+}
+
static void usage(void) __attribute__((noreturn));
static void usage(void)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " type { vti } [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ [i|o]key KEY ]\n");
- fprintf(stderr, " [ dev PHYS_DEV ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := { IP_ADDRESS }\n");
- fprintf(stderr, " KEY := { DOTTED_QUAD | NUMBER }\n");
+ print_usage(stderr);
exit(-1);
}
@@ -240,9 +245,16 @@ static void vti_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
}
}
+static void vti_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util vti_link_util = {
.id = "vti",
.maxattr = IFLA_VTI_MAX,
.parse_opt = vti_parse_opt,
.print_opt = vti_print_opt,
+ .print_help = vti_print_help,
};
--
2.1.0
^ permalink raw reply related
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Eric Dumazet @ 2014-09-19 22:44 UTC (permalink / raw)
To: Cong Wang; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <CAHA+R7M-HKbCmX3kEPLGrNjh+qF-OnL+V8C2biFBz24_7VOsxw@mail.gmail.com>
On Fri, 2014-09-19 at 15:14 -0700, Cong Wang wrote:
> Conflicts with what you claimed by "I disagree." :)
Whats wrong with using macvlan on top of bonding device where
tx_queue_len needs to be 0, because we do not want a qdisc on it ?
Therefore, suggesting user to 'fix tx_queue_len' is totally wrong.
Fix macvlan driver, and do not try to 'fix user scripts'
Thats very simple.
^ permalink raw reply
* Re: [RFC net-next PATCH V3 0/2] qdisc bulk dequeuing and utilizing delayed tailptr updates
From: Cong Wang @ 2014-09-19 22:39 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jesper Dangaard Brouer, netdev, David S. Miller, Tom Herbert,
Hannes Frederic Sowa, Florian Westphal, Daniel Borkmann,
Jamal Hadi Salim, Alexander Duyck, John Fastabend, Dave Taht,
toke
In-Reply-To: <1411163126.26859.40.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Sep 19, 2014 at 2:45 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2014-09-19 at 23:31 +0200, Jesper Dangaard Brouer wrote:
>
>> How can I test if the dev supports BQL?
>
>
> CONFIG_BQL should be enough.
Then why commits like this one?
commit 7070ce0a6419a118842298bc967061ad6cea40db
Author: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Sat Sep 28 06:00:37 2013 +0000
i40e: Add support for Tx byte queue limits
Implement BQL (byte queue limit) support in i40e.
>
> If a device driver do nothing about BQL, byte_queue_limits/limit will be
> zero by default.
Also note that for some virtual device, BQL may make no sense at all,
at least veth doesn't even use a TX queue (I know it has tx-0 mostly for
qdisc). Perhaps all NETIF_F_LLTX ones?
^ permalink raw reply
* [PATCH] scsi: fix SCSI_BNX2X_FCOE dependencies and build errors
From: Randy Dunlap @ 2014-09-19 22:38 UTC (permalink / raw)
To: netdev@vger.kernel.org, David Miller; +Cc: LKML, Anish Bhatt, James Bottomley
From: Randy Dunlap <rdunlap@infradead.org>
Don't enable NETDEVICES when NET is not enabled. That causes
build warnings and errors.
warning: (SCSI_CXGB3_ISCSI && SCSI_CXGB4_ISCSI && SCSI_BNX2X_FCOE) selects NETDEVICES which has unmet direct dependencies (NET)
warning: (SCSI_CXGB3_ISCSI && SCSI_CXGB4_ISCSI && SCSI_BNX2_ISCSI && SCSI_BNX2X_FCOE) selects ETHERNET which has unmet direct dependencies (NETDEVICES && NET)
warning: (SCSI_BNX2X_FCOE && LIBFCOE && TCM_QLA2XXX) selects LIBFC which has unmet direct dependencies (SCSI_LOWLEVEL && SCSI && SCSI_FC_ATTRS)
../drivers/net/ethernet/cisco/enic/enic_main.c: In function 'enic_rq_indicate_buf':
../drivers/net/ethernet/cisco/enic/enic_main.c:1077:3: error: implicit declaration of function 'skb_mark_napi_id' [-Werror=implicit-function-declaration]
../drivers/net/ethernet/cisco/enic/enic_main.c:1078:3: error: implicit declaration of function 'enic_poll_busy_polling' [-Werror=implicit-function-declaration]
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
drivers/scsi/bnx2fc/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- linux-next-20140918.orig/drivers/scsi/bnx2fc/Kconfig
+++ linux-next-20140918/drivers/scsi/bnx2fc/Kconfig
@@ -1,7 +1,8 @@
config SCSI_BNX2X_FCOE
tristate "QLogic NetXtreme II FCoE support"
- depends on PCI
+ depends on PCI && NET
depends on (IPV6 || IPV6=n)
+ depends on SCSI_FC_ATTRS
select NETDEVICES
select ETHERNET
select NET_VENDOR_BROADCOM
^ permalink raw reply
* [PATCH v2 2/2] tg3: Allow for receive of full-size 8021AD frames
From: Vladislav Yasevich @ 2014-09-19 22:23 UTC (permalink / raw)
To: netdev; +Cc: Vladislav Yasevich, Prashant Sreedharan, Michael Chan
In-Reply-To: <1411165389-21276-1-git-send-email-vyasevic@redhat.com>
When receiving a vlan-tagged frame that still contains
a vlan header, the length of the packet will be greater
then MTU+ETH_HLEN since it will account of the extra
vlan header. TG3 checks this for the case for 802.1Q,
but not for 802.1ad. As a result, full sized 802.1ad
frames get dropped by the card.
Add a check for 802.1ad protocol when receiving full
sized frames.
Suggested-by: Prashant Sreedharan <prashant@broadcom.com>
CC: Prashant Sreedharan <prashant@broadcom.com>
CC: Michael Chan <mchan@broadcom.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
drivers/net/ethernet/broadcom/tg3.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 0a0938d..4f674f9 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6918,7 +6918,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
skb->protocol = eth_type_trans(skb, tp->dev);
if (len > (tp->dev->mtu + ETH_HLEN) &&
- skb->protocol != htons(ETH_P_8021Q)) {
+ skb->protocol != htons(ETH_P_8021Q) &&
+ skb->protocol != htons(ETH_P_8021AD)) {
dev_kfree_skb_any(skb);
goto drop_it_no_recycle;
}
--
1.9.3
^ permalink raw reply related
* [PATCH v2 1/2] tg3: Work around HW/FW limitations with vlan encapsulated frames
From: Vladislav Yasevich @ 2014-09-19 22:23 UTC (permalink / raw)
To: netdev; +Cc: Vladislav Yasevich, Prashant Sreedharan, Michael Chan
In-Reply-To: <1411165389-21276-1-git-send-email-vyasevic@redhat.com>
TG3 appears to have an issue performing TSO and checksum offloading
correctly when the frame has been vlan encapsulated (non-accelerated).
In these cases, tcp checksum is not correctly updated.
This patch attempts to work around this issue. After the patch,
802.1ad vlans start working correctly over tg3 devices.
CC: Prashant Sreedharan <prashant@broadcom.com>
CC: Michael Chan <mchan@broadcom.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
v2: - Moved segmentation call sooner
- Preserve checksum txd flag for LSO.
drivers/net/ethernet/broadcom/tg3.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index cb77ae9..b78d043 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7924,6 +7924,13 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb_cow_head(skb, 0))
goto drop;
+ /* HW/FW can not correctly segment packets that have been
+ * vlan encapsulated.
+ */
+ if (skb->protocol == htons(ETH_P_8021Q) ||
+ skb->protocol == htons(ETH_P_8021AD))
+ return tg3_tso_bug(tp, tnapi, txq, skb);
+
iph = ip_hdr(skb);
tcp_opt_len = tcp_optlen(skb);
@@ -7979,6 +7986,16 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
base_flags |= tsflags << 12;
}
}
+ } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
+ /* HW/FW can not correctly checksum packets that have been
+ * vlan encapsulated.
+ */
+ if (skb->protocol == htons(ETH_P_8021Q) ||
+ skb->protocol == htons(ETH_P_8021AD)) {
+ if (skb_checksum_help(skb))
+ goto drop;
+ base_flags &= ~TXD_FLAG_TCPUDP_CSUM;
+ }
}
if (tg3_flag(tp, USE_JUMBO_BDFLAG) &&
--
1.9.3
^ permalink raw reply related
* [PATCH v2 0/2] tg3: Fix handling of non-acceleration vlans
From: Vladislav Yasevich @ 2014-09-19 22:23 UTC (permalink / raw)
To: netdev; +Cc: Vladislav Yasevich, Prashant Sreedharan, Michael Chan
TG3 can't cope with checksum and TSO offloads when vlan headers were
not accelerated. This can be demonstrated with 802.1ad vlans or
by configuring a vlan on top of a bridge and turning off vlan acceleration
on the bridge device.
Instead of disabling all vlan acceleration, this series works around
the issue by having tg3 driver call software segmentation and checksum
generation.
v2: - moved the call to software segment soonner
- Preserve the checksum flags for TSO/LSO case and turn it off
if software checksum was computed.
- Add code to correctly receive full sized 802.1ad frames.
Vladislav Yasevich (2):
tg3: Work around HW/FW limitations with vlan encapsulated frames
tg3: Allow for receive of full-size 8021AD frames
drivers/net/ethernet/broadcom/tg3.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
--
1.9.3
^ permalink raw reply
* Re: [patch net-next v2 8/9] switchdev: introduce Netlink API
From: Jamal Hadi Salim @ 2014-09-19 22:18 UTC (permalink / raw)
To: John Fastabend, Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, edumazet, sfeldma, f.fainelli, roopa, linville,
dev, jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh,
aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye, simon.horman,
alexander.h.duyck
In-Reply-To: <541CAA3C.5080105@intel.com>
On 09/19/14 18:12, John Fastabend wrote:
> On 09/19/2014 10:57 AM, Jamal Hadi Salim wrote:
>> On 09/19/14 11:49, Jiri Pirko wrote:
>>> Fri, Sep 19, 2014 at 05:25:48PM CEST, jhs@mojatatu.com wrote:
>>
>>>> Is this just a temporary test tool? Otherwise i dont see reason
>>>> for its existence (or the API that it feeds on).
>>>
>>> Please read the conversation I had with Pravin and Jesse in v1 thread.
>>> Long story short they like to have the api separated from ovs datapath
>>> so ovs daemon can use it to directly communicate with driver. Also John
>>> Fastabend requested a way to work with driver flows without using ovs ->
>>> that was the original reason I created switchdev genl api.
>>>
>>> Regarding the "sw" tool, yes it is for testing purposes now. ovs daemon
>>> will use directly switchdev genl api.
>>>
>>> I hope I cleared this out.
>>>
>>
>> It is - thanks Jiri.
>>
>> cheers,
>> jamal
>
> Hi Jiri,
>
> I was considering a slightly different approach where the
> device would report via netlink the fields/actions it
> supported rather than creating pre-defined enums for every
> possible key.
>
> I already need to have an API to report fields/matches
> that are being supported why not have the device report
> the headers as header fields (len, offset) and the
> associated parse graph the hardware uses? Vendors should
> have this already to describe/design their real hardware.
>
> As always its better to have code and when I get some
> time I'll try to write it up. Maybe its just a separate
> classifier although I don't actually want two hardware
> flow APIs.
>
> I see you dropped the RFC tag are you proposing we include
> this now?
>
Actually I just realized i missed something very basic that
Jiri said. I think i understand the tool being there for testing
but i am assumed the same about the genlink api.
Jiri, are you saying that genlink api is there to
stay?
cheers,
jamal
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Cong Wang @ 2014-09-19 22:14 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <1411164317.26859.45.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Sep 19, 2014 at 3:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2014-09-19 at 14:59 -0700, Cong Wang wrote:
>
>>
>> Then fix these tx_queue_len = 0?
>
> What are you suggesting exactly ?
Quote:
">
>>
>> I am not saying using this tx_queue_len is absolutely correct,
>> I am saying it may be expected to set tx_queue_len by yourself.
>
> I disagree.
>"
So you disagree with setting tx_queue_len manually, then it means
you think every tx_queue_len should have a non-zero value, therefore
those tx_queue_len = 0 should be fixed?
>
> We want them being 0, exactly.
Conflicts with what you claimed by "I disagree." :)
^ permalink raw reply
* Re: [patch net-next v2 8/9] switchdev: introduce Netlink API
From: John Fastabend @ 2014-09-19 22:12 UTC (permalink / raw)
To: Jamal Hadi Salim, Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, stephen, jeffrey.t.kirsher, vyasevic,
xiyou.wangcong, edumazet, sfeldma, f.fainelli, roopa, linville,
dev, jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a, buytenh,
aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye, simon.horman,
alexander.h.duyck
In-Reply-To: <541C6E6D.9000109@mojatatu.com>
On 09/19/2014 10:57 AM, Jamal Hadi Salim wrote:
> On 09/19/14 11:49, Jiri Pirko wrote:
>> Fri, Sep 19, 2014 at 05:25:48PM CEST, jhs@mojatatu.com wrote:
>
>>> Is this just a temporary test tool? Otherwise i dont see reason
>>> for its existence (or the API that it feeds on).
>>
>> Please read the conversation I had with Pravin and Jesse in v1 thread.
>> Long story short they like to have the api separated from ovs datapath
>> so ovs daemon can use it to directly communicate with driver. Also John
>> Fastabend requested a way to work with driver flows without using ovs ->
>> that was the original reason I created switchdev genl api.
>>
>> Regarding the "sw" tool, yes it is for testing purposes now. ovs daemon
>> will use directly switchdev genl api.
>>
>> I hope I cleared this out.
>>
>
> It is - thanks Jiri.
>
> cheers,
> jamal
Hi Jiri,
I was considering a slightly different approach where the
device would report via netlink the fields/actions it
supported rather than creating pre-defined enums for every
possible key.
I already need to have an API to report fields/matches
that are being supported why not have the device report
the headers as header fields (len, offset) and the
associated parse graph the hardware uses? Vendors should
have this already to describe/design their real hardware.
As always its better to have code and when I get some
time I'll try to write it up. Maybe its just a separate
classifier although I don't actually want two hardware
flow APIs.
I see you dropped the RFC tag are you proposing we include
this now?
.John
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Eric Dumazet @ 2014-09-19 22:05 UTC (permalink / raw)
To: Cong Wang; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <CAHA+R7M=Wp1u1hXD9YE52Ct74KOovEaVjCECV_5EsrAO_rJ7ag@mail.gmail.com>
On Fri, 2014-09-19 at 14:59 -0700, Cong Wang wrote:
>
> Then fix these tx_queue_len = 0?
What are you suggesting exactly ?
We want them being 0, exactly.
This is the standard way many scripts are able to remove a qdisc.
We dont want to break user scripts. Ever.
tc qdisc add dev bond0 root sfq
...
ifconfig bond0 txqueuelen 0
tc qdisc del dev bond0 root
-> No qdisc
^ permalink raw reply
* Re: [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
From: Cong Wang @ 2014-09-19 21:59 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Nicolas Dichtel, David Miller, netdev, Herbert Xu
In-Reply-To: <1411162501.26859.39.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Sep 19, 2014 at 2:35 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2014-09-19 at 14:24 -0700, Cong Wang wrote:
>> On Wed, Sep 17, 2014 at 1:08 AM, Nicolas Dichtel
>> <nicolas.dichtel@6wind.com> wrote:
>> > Since commit 412ca1550cbe ("macvlan: Move broadcasts into a work queue"), the
>> > driver uses tx_queue_len of the master device as the limit of packets enqueuing.
>> > Problem is that virtual drivers have this value set to 0, thus all broadcast
>> > packets were rejected.
>> > Because tx_queue_len was arbitrarily chosen, I replace it with a static limit
>> > of 1000 (also arbitrarily chosen).
>> >
>>
>> Hmm, why not manually set this tx_queue_len to fix it?
>>
>> At least fifo qdisc also uses tx_queue_len, and when you bond
>> you have to set it to non-zero.
>
>
> This is not true. We usually leave virtual devices with tx_queue_len to
> 0, otherwise you get a qdisc on them for nothing...
Yeah, actually it is 1 if tx_queue_len is 0, my memory mistaken.
But many virtual devices like veth call ether_setup() therefore have
tx_queue_len = 1000, not 0. dummy and bonding are 0 though.
>
> Only when you want to have say HTB on the bonding, you might need to
> change tx_queue_len
HTB by default creates a fifo qdisc.... same thing as above.
>
>>
>> I am not saying using this tx_queue_len is absolutely correct,
>> I am saying it may be expected to set tx_queue_len by yourself.
>
> I disagree.
>
Then fix these tx_queue_len = 0?
^ permalink raw reply
* Re: cannot ARP macvlan on top of bonding device
From: Eric Dumazet @ 2014-09-19 21:47 UTC (permalink / raw)
To: Francesco Ruggeri
Cc: Francesco Ruggeri, netdev, David Miller, herbert, nicolas.dichtel
In-Reply-To: <CA+HUmGi16QV2r7BuJYQWBckUG=oCe04JwJQFAyj=LihL=Rj5Kg@mail.gmail.com>
On Fri, 2014-09-19 at 14:35 -0700, Francesco Ruggeri wrote:
>
> After sending my email I noticed that Nicolas Dichtel already
> submitted a similar patch at
> http://marc.info/?l=linux-netdev&m=141094132726614&w=2
Yes, this all sounded familiar ;)
We yet have to address the race condition.
Herbert maybe ?
^ permalink raw reply
* Re: [RFC net-next PATCH V3 0/2] qdisc bulk dequeuing and utilizing delayed tailptr updates
From: Eric Dumazet @ 2014-09-19 21:45 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: netdev, David S. Miller, Tom Herbert, Hannes Frederic Sowa,
Florian Westphal, Daniel Borkmann, Jamal Hadi Salim,
Alexander Duyck, John Fastabend, Dave Taht, toke
In-Reply-To: <20140919233108.5bd43ccc@redhat.com>
On Fri, 2014-09-19 at 23:31 +0200, Jesper Dangaard Brouer wrote:
> How can I test if the dev supports BQL?
CONFIG_BQL should be enough.
If a device driver do nothing about BQL, byte_queue_limits/limit will be
zero by default.
^ permalink raw reply
* Re: [PATCH v13 net-next 07/11] bpf: verifier (add ability to receive verification log)
From: David Miller @ 2014-09-19 21:38 UTC (permalink / raw)
To: ast-uqk4Ao+rVK5Wk0Htik3J/w
Cc: mingo-DgEjT+Ai2ygdnm+yROfE0A,
torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
luto-kltTT9wpgjJwATOyAt5JVQ,
hannes-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r,
chema-hpIqsD4AKlfQT0dZR+AlfA, edumazet-hpIqsD4AKlfQT0dZR+AlfA,
a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw, pablo-Cap9r6Oaw4JrovVCs/uTlw,
hpa-YMNOUZJC4hwAvxtiuMwx3w, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
keescook-F7+t8E8rja9g9hUCZPvPmw, linux-api-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
dborkman-H+wXaHxf7aLQT0dZR+AlfA
In-Reply-To: <CAMEtUux071cELLdoWs21WL0dqgdwj+O=P64aeXSfyUtFW9U69w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
From: Alexei Starovoitov <ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org>
Date: Fri, 19 Sep 2014 14:04:50 -0700
> the 'changes requested' status means that you want me to
> address this forward compatibility now instead of later?
I want you to address this now.
^ permalink raw reply
* Re: [net-next 00/11][pull request] Intel Wired LAN Driver Updates 2014-09-18
From: David Miller @ 2014-09-19 21:36 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <1411043221-7163-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 18 Sep 2014 05:26:50 -0700
> This series contains updates to ixgbe and ixgbevf.
Pulled, thanks Jeff.
^ permalink raw reply
* Re: cannot ARP macvlan on top of bonding device
From: Francesco Ruggeri @ 2014-09-19 21:35 UTC (permalink / raw)
To: Eric Dumazet
Cc: Francesco Ruggeri, netdev, David Miller, herbert, nicolas.dichtel
In-Reply-To: <1411161451.26859.32.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, Sep 19, 2014 at 2:17 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2014-09-19 at 14:00 -0700, Francesco Ruggeri wrote:
>> [Resending with correct date]
>>
>> Ping in the following test fails:
>>
>> # Create veth pair v1 v2
>> ip link add v1 type veth peer name v2
>>
>> # Stack macvlan on top of bonding device on top of v1
>> ip link set v1 up
>> ip link add bond1 type bond
>> ip link set bond1 up
>> ifenslave bond1 v1
>> ip link add link bond1 name mac1 type macvlan mode bridge
>> ip link set mac1 up
>> ifconfig mac1 1.2.3.1/24
>>
>> # Move v2 to namespace dummy2 and ping v1
>> ip netns add dummy2
>> ip link set v2 netns dummy2
>> ip netns exec dummy2 bash
>> ip link set lo up
>> ip link set v2 up
>> ifconfig v2 1.2.3.2/24
>> ping 1.2.3.1 -c 5
>>
>> # Clean up
>> exit
>> ip netns del dummy2
>> ip link del bond
>>
>> It passes on older releases.
>> The problem is that txqueuelen in bond1 is 0, and ARP requests are dropped in macvlan_broadcast_enqueue at:
>>
>> if (skb_queue_len(&port->bc_queue) < skb->dev->tx_queue_len) {
>> __skb_queue_tail(&port->bc_queue, nskb);
>> err = 0;
>> }
>>
>> where
>> port->dev = skb->dev = "bond1"
>> skb_queue_len(&port->bc_queue) = skb->dev->tx_queue_len = 0
>>
>> macvlan_broadcast_enqueue was introduced in 412ca1550 (macvlan: Move broadcasts into a work queue).
>>
>> Why are we using tx_queue_len to limit an rx queue?
>
> You're right, we probably should use netdev_max_backlog instead.
>
> Please send a formal patch ?
>
>
>
After sending my email I noticed that Nicolas Dichtel already
submitted a similar patch at
http://marc.info/?l=linux-netdev&m=141094132726614&w=2
Francesco
^ 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