Skip to content

Commit c221fe4

Browse files
committed
Merge branch 'qdisc-RED-offload'
Jiri Pirko says: ==================== qdisc RED offload Nogah says: Add an offload support for RED qdisc for mlxsw driver. The first patch adds the ability to offload RED qdisc by using ndo_setup_tc. It gives RED three commands, to offload, change or delete the qdisc, to get the qdisc generic stats and to get it's RED xstats. There is no enforcement on a driver to offload or not offload the qdisc and it is up to the driver to decide. RED qdisc is first being created and only later graft to a parent (unless it is a root qdisc). For that reason the return value of the offload replace command that is called in the init process doesn't reflect actual offload state. The offload state is determined in the dump function so it can be reflected to the user. This function is also responsible for stats update. The patchses 2-3 change the name of TC_SETUP_MQPRIO & TC_SETUP_CBS to match with the new convention of QDISC prefix. The rest of the patchset is driver support for the qdisc. Currently only as root qdisc that is being set on the default traffic class. It supports only the following parameters of RED: min, max, probability and ECN mode. Limit and burst size related params are being ignored at this moment. --- v7->v8 internal: (external RFC->v1) - patch 1/9: - unite the offload and un-offload functions - clean the OFFLOAD flag when the qdisc in not offloaded - patch 2/9: - minor change to avoid a conflict - patch 5/9: - check for bad min/max values - clean the offloaded qdisc after a bad config call ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents aaf151b + 3670756 commit c221fe4

File tree

25 files changed

+690
-21
lines changed

25 files changed

+690
-21
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ static int xgbe_setup_tc(struct net_device *netdev, enum tc_setup_type type,
22062206
struct tc_mqprio_qopt *mqprio = type_data;
22072207
u8 tc;
22082208

2209-
if (type != TC_SETUP_MQPRIO)
2209+
if (type != TC_SETUP_QDISC_MQPRIO)
22102210
return -EOPNOTSUPP;
22112211

22122212
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4289,7 +4289,7 @@ int __bnx2x_setup_tc(struct net_device *dev, enum tc_setup_type type,
42894289
{
42904290
struct tc_mqprio_qopt *mqprio = type_data;
42914291

4292-
if (type != TC_SETUP_MQPRIO)
4292+
if (type != TC_SETUP_QDISC_MQPRIO)
42934293
return -EOPNOTSUPP;
42944294

42954295
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7388,7 +7388,7 @@ static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
73887388
switch (type) {
73897389
case TC_SETUP_BLOCK:
73907390
return bnxt_setup_tc_block(dev, type_data);
7391-
case TC_SETUP_MQPRIO: {
7391+
case TC_SETUP_QDISC_MQPRIO: {
73927392
struct tc_mqprio_qopt *mqprio = type_data;
73937393

73947394
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static int dpaa_setup_tc(struct net_device *net_dev, enum tc_setup_type type,
351351
u8 num_tc;
352352
int i;
353353

354-
if (type != TC_SETUP_MQPRIO)
354+
if (type != TC_SETUP_QDISC_MQPRIO)
355355
return -EOPNOTSUPP;
356356

357357
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ static int hns3_setup_tc(struct net_device *netdev, void *type_data)
12521252
static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type,
12531253
void *type_data)
12541254
{
1255-
if (type != TC_SETUP_MQPRIO)
1255+
if (type != TC_SETUP_QDISC_MQPRIO)
12561256
return -EOPNOTSUPP;
12571257

12581258
return hns3_setup_tc(dev, type_data);

drivers/net/ethernet/intel/fm10k/fm10k_netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ static int __fm10k_setup_tc(struct net_device *dev, enum tc_setup_type type,
13891389
{
13901390
struct tc_mqprio_qopt *mqprio = type_data;
13911391

1392-
if (type != TC_SETUP_MQPRIO)
1392+
if (type != TC_SETUP_QDISC_MQPRIO)
13931393
return -EOPNOTSUPP;
13941394

13951395
mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7550,7 +7550,7 @@ static int __i40e_setup_tc(struct net_device *netdev, enum tc_setup_type type,
75507550
void *type_data)
75517551
{
75527552
switch (type) {
7553-
case TC_SETUP_MQPRIO:
7553+
case TC_SETUP_QDISC_MQPRIO:
75547554
return i40e_setup_tc(netdev, type_data);
75557555
case TC_SETUP_BLOCK:
75567556
return i40e_setup_tc_block(netdev, type_data);

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,
24882488
struct igb_adapter *adapter = netdev_priv(dev);
24892489

24902490
switch (type) {
2491-
case TC_SETUP_CBS:
2491+
case TC_SETUP_QDISC_CBS:
24922492
return igb_offload_cbs(adapter, type_data);
24932493

24942494
default:

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9431,7 +9431,7 @@ static int __ixgbe_setup_tc(struct net_device *dev, enum tc_setup_type type,
94319431
switch (type) {
94329432
case TC_SETUP_BLOCK:
94339433
return ixgbe_setup_tc_block(dev, type_data);
9434-
case TC_SETUP_MQPRIO:
9434+
case TC_SETUP_QDISC_MQPRIO:
94359435
return ixgbe_setup_tc_mqprio(dev, type_data);
94369436
default:
94379437
return -EOPNOTSUPP;

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int __mlx4_en_setup_tc(struct net_device *dev, enum tc_setup_type type,
135135
{
136136
struct tc_mqprio_qopt *mqprio = type_data;
137137

138-
if (type != TC_SETUP_MQPRIO)
138+
if (type != TC_SETUP_QDISC_MQPRIO)
139139
return -EOPNOTSUPP;
140140

141141
if (mqprio->num_tc && mqprio->num_tc != MLX4_EN_NUM_UP_HIGH)

0 commit comments

Comments
 (0)