Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f63d59 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 4952cd3e e56270f6
Loading
Loading
Loading
Loading
+15 −4
Original line number Original line Diff line number Diff line
@@ -1277,8 +1277,7 @@ enum sp_rtnl_flag {
	BNX2X_SP_RTNL_HYPERVISOR_VLAN,
	BNX2X_SP_RTNL_HYPERVISOR_VLAN,
	BNX2X_SP_RTNL_TX_STOP,
	BNX2X_SP_RTNL_TX_STOP,
	BNX2X_SP_RTNL_GET_DRV_VERSION,
	BNX2X_SP_RTNL_GET_DRV_VERSION,
	BNX2X_SP_RTNL_ADD_VXLAN_PORT,
	BNX2X_SP_RTNL_CHANGE_UDP_PORT,
	BNX2X_SP_RTNL_DEL_VXLAN_PORT,
};
};


enum bnx2x_iov_flag {
enum bnx2x_iov_flag {
@@ -1327,6 +1326,17 @@ struct bnx2x_vlan_entry {
	bool hw;
	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 {
struct bnx2x {
	/* Fields used in the tx and intr/napi performance paths
	/* Fields used in the tx and intr/napi performance paths
	 * are grouped together in the beginning of the structure
	 * are grouped together in the beginning of the structure
@@ -1830,9 +1840,10 @@ struct bnx2x {
	struct list_head vlan_reg;
	struct list_head vlan_reg;
	u16 vlan_cnt;
	u16 vlan_cnt;
	u16 vlan_credit;
	u16 vlan_credit;
	u16 vxlan_dst_port;
	u8 vxlan_dst_port_count;
	bool accept_any_vlan;
	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 */
/* Tx queues may be less or equal to Rx queues */
+0 −1
Original line number Original line Diff line number Diff line
@@ -5086,4 +5086,3 @@ void bnx2x_schedule_sp_rtnl(struct bnx2x *bp, enum sp_rtnl_flag flag,
	   flag);
	   flag);
	schedule_delayed_work(&bp->sp_rtnl_task, 0);
	schedule_delayed_work(&bp->sp_rtnl_task, 0);
}
}
EXPORT_SYMBOL(bnx2x_schedule_sp_rtnl);
+9 −2
Original line number Original line Diff line number Diff line
@@ -923,6 +923,7 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
	struct bnx2x_func_state_params func_params = {NULL};
	struct bnx2x_func_state_params func_params = {NULL};
	struct bnx2x_func_start_params *start_params =
	struct bnx2x_func_start_params *start_params =
		&func_params.params.start;
		&func_params.params.start;
	u16 port;


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

	if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count) {
	start_params->vxlan_dst_port = bp->vxlan_dst_port;
		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;
	start_params->inner_rss = 1;


+43 −14
Original line number Original line Diff line number Diff line
@@ -195,6 +195,7 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
				   u32 error) {
				   u32 error) {
	u8 index;
	u8 index;
	u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
	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))
	if (GET_FLAGS(error, DCBX_LOCAL_APP_ERROR))
		DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_ERROR\n");
		DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_ERROR\n");
@@ -210,29 +211,57 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,


		bp->dcbx_port_params.app.enabled = true;
		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++)
		for (index = 0 ; index < LLFC_DRIVER_TRAFFIC_TYPE_MAX; index++)
			ttp[index] = 0;
			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++) {
		for (index = 0 ; index < DCBX_MAX_APP_PROTOCOL; index++) {
			struct dcbx_app_priority_entry *entry =
			struct dcbx_app_priority_entry *entry =
							app->app_pri_tbl;
							app->app_pri_tbl;
			enum traffic_type type = MAX_TRAFFIC_TYPE;


			if (GET_FLAGS(entry[index].appBitfield,
			if (GET_FLAGS(entry[index].appBitfield,
				      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) &&
					     DCBX_APP_SF_ETH_TYPE) &&
			   ETH_TYPE_FCOE == entry[index].app_id)
				   ETH_TYPE_FCOE == entry[index].app_id) {
				bnx2x_dcbx_get_ap_priority(bp,
				type = LLFC_TRAFFIC_TYPE_FCOE;
						entry[index].pri_bitmap,
				fcoe_pri_found = 1;
						LLFC_TRAFFIC_TYPE_FCOE);
			}

			if (type == MAX_TRAFFIC_TYPE)
				continue;


			if (GET_FLAGS(entry[index].appBitfield,
				     DCBX_APP_SF_PORT) &&
			   TCP_PORT_ISCSI == entry[index].app_id)
			bnx2x_dcbx_get_ap_priority(bp,
			bnx2x_dcbx_get_ap_priority(bp,
						   entry[index].pri_bitmap,
						   entry[index].pri_bitmap,
						LLFC_TRAFFIC_TYPE_ISCSI);
						   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 {
	} else {
		DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");
		DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");
+5 −0
Original line number Original line Diff line number Diff line
@@ -981,6 +981,11 @@ static void bnx2x_get_regs(struct net_device *dev,
	memcpy(p, &dump_hdr, sizeof(struct dump_header));
	memcpy(p, &dump_hdr, sizeof(struct dump_header));
	p += dump_hdr.header_size + 1;
	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 */
	/* Actually read the registers */
	__bnx2x_get_regs(bp, p);
	__bnx2x_get_regs(bp, p);


Loading