Skip to content

Commit

Permalink
Merge branch 'bnx2x-next'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Feb 17, 2016
2 parents 4952cd3 + e56270f commit 64f63d5
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 76 deletions.
19 changes: 15 additions & 4 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,7 @@ enum sp_rtnl_flag {
BNX2X_SP_RTNL_HYPERVISOR_VLAN,
BNX2X_SP_RTNL_TX_STOP,
BNX2X_SP_RTNL_GET_DRV_VERSION,
BNX2X_SP_RTNL_ADD_VXLAN_PORT,
BNX2X_SP_RTNL_DEL_VXLAN_PORT,
BNX2X_SP_RTNL_CHANGE_UDP_PORT,
};

enum bnx2x_iov_flag {
Expand Down Expand Up @@ -1327,6 +1326,17 @@ struct bnx2x_vlan_entry {
bool hw;
};

enum bnx2x_udp_port_type {
BNX2X_UDP_PORT_VXLAN,
BNX2X_UDP_PORT_GENEVE,
BNX2X_UDP_PORT_MAX,
};

struct bnx2x_udp_tunnel {
u16 dst_port;
u8 count;
};

struct bnx2x {
/* Fields used in the tx and intr/napi performance paths
* are grouped together in the beginning of the structure
Expand Down Expand Up @@ -1830,9 +1840,10 @@ struct bnx2x {
struct list_head vlan_reg;
u16 vlan_cnt;
u16 vlan_credit;
u16 vxlan_dst_port;
u8 vxlan_dst_port_count;
bool accept_any_vlan;

/* Vxlan/Geneve related information */
struct bnx2x_udp_tunnel udp_tunnel_ports[BNX2X_UDP_PORT_MAX];
};

/* Tx queues may be less or equal to Rx queues */
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -5086,4 +5086,3 @@ void bnx2x_schedule_sp_rtnl(struct bnx2x *bp, enum sp_rtnl_flag flag,
flag);
schedule_delayed_work(&bp->sp_rtnl_task, 0);
}
EXPORT_SYMBOL(bnx2x_schedule_sp_rtnl);
11 changes: 9 additions & 2 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
struct bnx2x_func_state_params func_params = {NULL};
struct bnx2x_func_start_params *start_params =
&func_params.params.start;
u16 port;

/* Prepare parameters for function state transitions */
__set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags);
Expand Down Expand Up @@ -959,8 +960,14 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
start_params->network_cos_mode = STATIC_COS;
else /* CHIP_IS_E1X */
start_params->network_cos_mode = FW_WRR;

start_params->vxlan_dst_port = bp->vxlan_dst_port;
if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count) {
port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].dst_port;
start_params->vxlan_dst_port = port;
}
if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].count) {
port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].dst_port;
start_params->geneve_dst_port = port;
}

start_params->inner_rss = 1;

Expand Down
57 changes: 43 additions & 14 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
u32 error) {
u8 index;
u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
u8 iscsi_pri_found = 0, fcoe_pri_found = 0;

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

bp->dcbx_port_params.app.enabled = true;

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

if (app->default_pri < MAX_PFC_PRIORITIES)
ttp[LLFC_TRAFFIC_TYPE_NW] = app->default_pri;

for (index = 0 ; index < DCBX_MAX_APP_PROTOCOL; index++) {
struct dcbx_app_priority_entry *entry =
app->app_pri_tbl;
enum traffic_type type = MAX_TRAFFIC_TYPE;

if (GET_FLAGS(entry[index].appBitfield,
DCBX_APP_SF_ETH_TYPE) &&
ETH_TYPE_FCOE == entry[index].app_id)
bnx2x_dcbx_get_ap_priority(bp,
entry[index].pri_bitmap,
LLFC_TRAFFIC_TYPE_FCOE);
DCBX_APP_SF_DEFAULT) &&
GET_FLAGS(entry[index].appBitfield,
DCBX_APP_SF_ETH_TYPE)) {
type = LLFC_TRAFFIC_TYPE_NW;
} else if (GET_FLAGS(entry[index].appBitfield,
DCBX_APP_SF_PORT) &&
TCP_PORT_ISCSI == entry[index].app_id) {
type = LLFC_TRAFFIC_TYPE_ISCSI;
iscsi_pri_found = 1;
} else if (GET_FLAGS(entry[index].appBitfield,
DCBX_APP_SF_ETH_TYPE) &&
ETH_TYPE_FCOE == entry[index].app_id) {
type = LLFC_TRAFFIC_TYPE_FCOE;
fcoe_pri_found = 1;
}

if (GET_FLAGS(entry[index].appBitfield,
DCBX_APP_SF_PORT) &&
TCP_PORT_ISCSI == entry[index].app_id)
bnx2x_dcbx_get_ap_priority(bp,
entry[index].pri_bitmap,
LLFC_TRAFFIC_TYPE_ISCSI);
if (type == MAX_TRAFFIC_TYPE)
continue;

bnx2x_dcbx_get_ap_priority(bp,
entry[index].pri_bitmap,
type);
}

/* If we have received a non-zero default application
* priority, then use that for applications which are
* not configured with any priority.
*/
if (ttp[LLFC_TRAFFIC_TYPE_NW] != 0) {
if (!iscsi_pri_found) {
ttp[LLFC_TRAFFIC_TYPE_ISCSI] =
ttp[LLFC_TRAFFIC_TYPE_NW];
DP(BNX2X_MSG_DCB,
"ISCSI is using default priority.\n");
}
if (!fcoe_pri_found) {
ttp[LLFC_TRAFFIC_TYPE_FCOE] =
ttp[LLFC_TRAFFIC_TYPE_NW];
DP(BNX2X_MSG_DCB,
"FCoE is using default priority.\n");
}
}
} else {
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,11 @@ static void bnx2x_get_regs(struct net_device *dev,
memcpy(p, &dump_hdr, sizeof(struct dump_header));
p += dump_hdr.header_size + 1;

/* This isn't really an error, but since attention handling is going
* to print the GRC timeouts using this macro, we use the same.
*/
BNX2X_ERR("Generating register dump. Might trigger harmless GRC timeouts\n");

/* Actually read the registers */
__bnx2x_get_regs(bp, p);

Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1831,10 +1831,13 @@ struct dcbx_app_priority_entry {
#elif defined(__LITTLE_ENDIAN)
u8 appBitfield;
#define DCBX_APP_ENTRY_VALID 0x01
#define DCBX_APP_ENTRY_SF_MASK 0x30
#define DCBX_APP_ENTRY_SF_MASK 0xF0
#define DCBX_APP_ENTRY_SF_SHIFT 4
#define DCBX_APP_ENTRY_VALID 0x01
#define DCBX_APP_SF_ETH_TYPE 0x10
#define DCBX_APP_SF_PORT 0x20
#define DCBX_APP_SF_UDP 0x40
#define DCBX_APP_SF_DEFAULT 0x80
u8 pri_bitmap;
u16 app_id;
#endif
Expand Down
Loading

0 comments on commit 64f63d5

Please sign in to comment.