Commit 04a230b2 authored by Alexander Duyck's avatar Alexander Duyck Committed by Paolo Abeni
Browse files

fbnic: Add logic to repopulate RPC TCAM if BMC enables channel



The BMC itself can decide to abandon a link and move onto another link in
the event of things such as a link flap. As a result the driver may load
with the BMC not present, and then needs to update things to support the
BMC being present while the link is up and the NIC is passing traffic.

To support this we add support to the watchdog to reinitialize the RPC to
support adding the BMC unicast, multicast, and multicast promiscuous
filters while the link is up and the NIC owns the link.

Signed-off-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/175623750101.2246365.8518307324797058580.stgit@ahduyck-xeon-server.home.arpa


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 284a67d5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -653,6 +653,9 @@ static int fbnic_fw_parse_cap_resp(void *opaque, struct fbnic_tlv_msg **results)
	fbd->fw_cap.anti_rollback_version =
		fta_get_uint(results, FBNIC_FW_CAP_RESP_ANTI_ROLLBACK_VERSION);

	/* Always assume we need a BMC reinit */
	fbd->fw_cap.need_bmc_tcam_reinit = true;

	return 0;
}

+3 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ struct fbnic_fw_cap {
	u8	active_slot;
	u8	bmc_mac_addr[4][ETH_ALEN];
	u8	bmc_present		: 1;
	u8	need_bmc_tcam_reinit	: 1;
	u8	all_multi		: 1;
	u8	link_speed;
	u8	link_fec;
+2 −0
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@ static void fbnic_service_task(struct work_struct *work)

	fbnic_health_check(fbd);

	fbnic_bmc_rpc_check(fbd);

	if (netif_carrier_ok(fbd->netdev))
		fbnic_napi_depletion_check(fbd->netdev);

+12 −7
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <net/ipv6.h>

#include "fbnic.h"
#include "fbnic_fw.h"
#include "fbnic_netdev.h"
#include "fbnic_rpc.h"

@@ -131,12 +132,9 @@ void fbnic_bmc_rpc_all_multi_config(struct fbnic_dev *fbd,
		else
			clear_bit(FBNIC_MAC_ADDR_T_ALLMULTI,
				  mac_addr->act_tcam);
	} else if (!test_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam) &&
		   !is_zero_ether_addr(mac_addr->mask.addr8) &&
		   mac_addr->state == FBNIC_TCAM_S_VALID) {
		clear_bit(FBNIC_MAC_ADDR_T_ALLMULTI, mac_addr->act_tcam);
		clear_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam);
		mac_addr->state = FBNIC_TCAM_S_DELETE;
	} else {
		__fbnic_xc_unsync(mac_addr, FBNIC_MAC_ADDR_T_BMC);
		__fbnic_xc_unsync(mac_addr, FBNIC_MAC_ADDR_T_ALLMULTI);
	}

	/* We have to add a special handler for multicast as the
@@ -238,8 +236,15 @@ void fbnic_bmc_rpc_init(struct fbnic_dev *fbd)
		act_tcam->mask.tcam[j] = 0xffff;

	act_tcam->state = FBNIC_TCAM_S_UPDATE;
}

	fbnic_bmc_rpc_all_multi_config(fbd, false);
void fbnic_bmc_rpc_check(struct fbnic_dev *fbd)
{
	if (fbd->fw_cap.need_bmc_tcam_reinit) {
		fbnic_bmc_rpc_init(fbd);
		__fbnic_set_rx_mode(fbd);
		fbd->fw_cap.need_bmc_tcam_reinit = false;
	}
}

#define FBNIC_ACT1_INIT(_l4, _udp, _ip, _v6)		\
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ struct fbnic_net;

void fbnic_bmc_rpc_init(struct fbnic_dev *fbd);
void fbnic_bmc_rpc_all_multi_config(struct fbnic_dev *fbd, bool enable_host);
void fbnic_bmc_rpc_check(struct fbnic_dev *fbd);

void fbnic_reset_indir_tbl(struct fbnic_net *fbn);
void fbnic_rss_key_fill(u32 *buffer);