Skip to content

Commit 64f63d5

Browse files
committed
Merge branch 'bnx2x-next'
Yuval Mintz says: ==================== bnx2x: driver updates This series contains several changes - the biggest change is the addition of Geneve NDO support [allows device to perform RSS according to inner-headers of encapsulated packet, similar to what it does for vxlan]. It also extends dcbx support, as well as introducing some minor changes. Dave, Please consider applying this series to `net-next'. [Do notice patch #3 fails checkpatch due to consistency with existing HSI] ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4952cd3 + e56270f commit 64f63d5

File tree

7 files changed

+201
-76
lines changed

7 files changed

+201
-76
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,8 +1277,7 @@ enum sp_rtnl_flag {
12771277
BNX2X_SP_RTNL_HYPERVISOR_VLAN,
12781278
BNX2X_SP_RTNL_TX_STOP,
12791279
BNX2X_SP_RTNL_GET_DRV_VERSION,
1280-
BNX2X_SP_RTNL_ADD_VXLAN_PORT,
1281-
BNX2X_SP_RTNL_DEL_VXLAN_PORT,
1280+
BNX2X_SP_RTNL_CHANGE_UDP_PORT,
12821281
};
12831282

12841283
enum bnx2x_iov_flag {
@@ -1327,6 +1326,17 @@ struct bnx2x_vlan_entry {
13271326
bool hw;
13281327
};
13291328

1329+
enum bnx2x_udp_port_type {
1330+
BNX2X_UDP_PORT_VXLAN,
1331+
BNX2X_UDP_PORT_GENEVE,
1332+
BNX2X_UDP_PORT_MAX,
1333+
};
1334+
1335+
struct bnx2x_udp_tunnel {
1336+
u16 dst_port;
1337+
u8 count;
1338+
};
1339+
13301340
struct bnx2x {
13311341
/* Fields used in the tx and intr/napi performance paths
13321342
* are grouped together in the beginning of the structure
@@ -1830,9 +1840,10 @@ struct bnx2x {
18301840
struct list_head vlan_reg;
18311841
u16 vlan_cnt;
18321842
u16 vlan_credit;
1833-
u16 vxlan_dst_port;
1834-
u8 vxlan_dst_port_count;
18351843
bool accept_any_vlan;
1844+
1845+
/* Vxlan/Geneve related information */
1846+
struct bnx2x_udp_tunnel udp_tunnel_ports[BNX2X_UDP_PORT_MAX];
18361847
};
18371848

18381849
/* Tx queues may be less or equal to Rx queues */

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5086,4 +5086,3 @@ void bnx2x_schedule_sp_rtnl(struct bnx2x *bp, enum sp_rtnl_flag flag,
50865086
flag);
50875087
schedule_delayed_work(&bp->sp_rtnl_task, 0);
50885088
}
5089-
EXPORT_SYMBOL(bnx2x_schedule_sp_rtnl);

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
923923
struct bnx2x_func_state_params func_params = {NULL};
924924
struct bnx2x_func_start_params *start_params =
925925
&func_params.params.start;
926+
u16 port;
926927

927928
/* Prepare parameters for function state transitions */
928929
__set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags);
@@ -959,8 +960,14 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
959960
start_params->network_cos_mode = STATIC_COS;
960961
else /* CHIP_IS_E1X */
961962
start_params->network_cos_mode = FW_WRR;
962-
963-
start_params->vxlan_dst_port = bp->vxlan_dst_port;
963+
if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count) {
964+
port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].dst_port;
965+
start_params->vxlan_dst_port = port;
966+
}
967+
if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].count) {
968+
port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].dst_port;
969+
start_params->geneve_dst_port = port;
970+
}
964971

965972
start_params->inner_rss = 1;
966973

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

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
195195
u32 error) {
196196
u8 index;
197197
u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
198+
u8 iscsi_pri_found = 0, fcoe_pri_found = 0;
198199

199200
if (GET_FLAGS(error, DCBX_LOCAL_APP_ERROR))
200201
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_ERROR\n");
@@ -210,29 +211,57 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
210211

211212
bp->dcbx_port_params.app.enabled = true;
212213

214+
/* Use 0 as the default application priority for all. */
213215
for (index = 0 ; index < LLFC_DRIVER_TRAFFIC_TYPE_MAX; index++)
214216
ttp[index] = 0;
215217

216-
if (app->default_pri < MAX_PFC_PRIORITIES)
217-
ttp[LLFC_TRAFFIC_TYPE_NW] = app->default_pri;
218-
219218
for (index = 0 ; index < DCBX_MAX_APP_PROTOCOL; index++) {
220219
struct dcbx_app_priority_entry *entry =
221220
app->app_pri_tbl;
221+
enum traffic_type type = MAX_TRAFFIC_TYPE;
222222

223223
if (GET_FLAGS(entry[index].appBitfield,
224-
DCBX_APP_SF_ETH_TYPE) &&
225-
ETH_TYPE_FCOE == entry[index].app_id)
226-
bnx2x_dcbx_get_ap_priority(bp,
227-
entry[index].pri_bitmap,
228-
LLFC_TRAFFIC_TYPE_FCOE);
224+
DCBX_APP_SF_DEFAULT) &&
225+
GET_FLAGS(entry[index].appBitfield,
226+
DCBX_APP_SF_ETH_TYPE)) {
227+
type = LLFC_TRAFFIC_TYPE_NW;
228+
} else if (GET_FLAGS(entry[index].appBitfield,
229+
DCBX_APP_SF_PORT) &&
230+
TCP_PORT_ISCSI == entry[index].app_id) {
231+
type = LLFC_TRAFFIC_TYPE_ISCSI;
232+
iscsi_pri_found = 1;
233+
} else if (GET_FLAGS(entry[index].appBitfield,
234+
DCBX_APP_SF_ETH_TYPE) &&
235+
ETH_TYPE_FCOE == entry[index].app_id) {
236+
type = LLFC_TRAFFIC_TYPE_FCOE;
237+
fcoe_pri_found = 1;
238+
}
229239

230-
if (GET_FLAGS(entry[index].appBitfield,
231-
DCBX_APP_SF_PORT) &&
232-
TCP_PORT_ISCSI == entry[index].app_id)
233-
bnx2x_dcbx_get_ap_priority(bp,
234-
entry[index].pri_bitmap,
235-
LLFC_TRAFFIC_TYPE_ISCSI);
240+
if (type == MAX_TRAFFIC_TYPE)
241+
continue;
242+
243+
bnx2x_dcbx_get_ap_priority(bp,
244+
entry[index].pri_bitmap,
245+
type);
246+
}
247+
248+
/* If we have received a non-zero default application
249+
* priority, then use that for applications which are
250+
* not configured with any priority.
251+
*/
252+
if (ttp[LLFC_TRAFFIC_TYPE_NW] != 0) {
253+
if (!iscsi_pri_found) {
254+
ttp[LLFC_TRAFFIC_TYPE_ISCSI] =
255+
ttp[LLFC_TRAFFIC_TYPE_NW];
256+
DP(BNX2X_MSG_DCB,
257+
"ISCSI is using default priority.\n");
258+
}
259+
if (!fcoe_pri_found) {
260+
ttp[LLFC_TRAFFIC_TYPE_FCOE] =
261+
ttp[LLFC_TRAFFIC_TYPE_NW];
262+
DP(BNX2X_MSG_DCB,
263+
"FCoE is using default priority.\n");
264+
}
236265
}
237266
} else {
238267
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,11 @@ static void bnx2x_get_regs(struct net_device *dev,
981981
memcpy(p, &dump_hdr, sizeof(struct dump_header));
982982
p += dump_hdr.header_size + 1;
983983

984+
/* This isn't really an error, but since attention handling is going
985+
* to print the GRC timeouts using this macro, we use the same.
986+
*/
987+
BNX2X_ERR("Generating register dump. Might trigger harmless GRC timeouts\n");
988+
984989
/* Actually read the registers */
985990
__bnx2x_get_regs(bp, p);
986991

drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,10 +1831,13 @@ struct dcbx_app_priority_entry {
18311831
#elif defined(__LITTLE_ENDIAN)
18321832
u8 appBitfield;
18331833
#define DCBX_APP_ENTRY_VALID 0x01
1834-
#define DCBX_APP_ENTRY_SF_MASK 0x30
1834+
#define DCBX_APP_ENTRY_SF_MASK 0xF0
18351835
#define DCBX_APP_ENTRY_SF_SHIFT 4
1836+
#define DCBX_APP_ENTRY_VALID 0x01
18361837
#define DCBX_APP_SF_ETH_TYPE 0x10
18371838
#define DCBX_APP_SF_PORT 0x20
1839+
#define DCBX_APP_SF_UDP 0x40
1840+
#define DCBX_APP_SF_DEFAULT 0x80
18381841
u8 pri_bitmap;
18391842
u16 app_id;
18401843
#endif

0 commit comments

Comments
 (0)