Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F172488175
D59810.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D59810.diff
View Options
Index: sys/dev/qlnx/qlnxe/ecore_vf.h
===================================================================
--- sys/dev/qlnx/qlnxe/ecore_vf.h
+++ sys/dev/qlnx/qlnxe/ecore_vf.h
@@ -82,6 +82,9 @@
* bar or via the doorbell bar.
*/
bool b_doorbell_bar;
+
+ /* FreeBSD RSS queries require the RSS TLV itself to be accepted. */
+ bool rss_configured;
};
/**
Index: sys/dev/qlnx/qlnxe/ecore_vf.c
===================================================================
--- sys/dev/qlnx/qlnxe/ecore_vf.c
+++ sys/dev/qlnx/qlnxe/ecore_vf.c
@@ -1242,6 +1242,9 @@
p_resp = (struct pfvf_def_resp_tlv *)
ecore_iov_search_list_tlvs(p_hwfn, p_iov->pf2vf_reply,
tlv);
+ if (tlv == CHANNEL_TLV_VPORT_UPDATE_RSS)
+ p_iov->rss_configured = p_resp &&
+ p_resp->hdr.status == PFVF_STATUS_SUCCESS;
if (p_resp && p_resp->hdr.status)
DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
"TLV[%d] type %s Configuration %s\n",
@@ -1270,6 +1273,8 @@
/* clear mailbox and prep header tlv */
ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_UPDATE, sizeof(*req));
+ if (p_params->rss_params)
+ p_iov->rss_configured = false;
/* Prepare extended tlvs */
if (update_rx || update_tx) {
Index: sys/dev/qlnx/qlnxe/qlnx_os.c
===================================================================
--- sys/dev/qlnx/qlnxe/qlnx_os.c
+++ sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -58,6 +58,7 @@
#include "ecore_dbg_fw_funcs.h"
#include "ecore_iov_api.h"
#include "ecore_vf_api.h"
+#include "ecore_vf.h"
#include "qlnx_ioctl.h"
#include "qlnx_def.h"
@@ -2552,6 +2553,77 @@
return (rc);
}
+static int
+qlnx_rss_query_status(qlnx_host_t *ha)
+{
+ int i;
+
+ sx_assert(&ha->hw_lock, SA_XLOCKED);
+ if (ha->state != QLNX_STATE_OPEN ||
+ (if_getdrvflags(ha->ifp) & IFF_DRV_RUNNING) == 0)
+ return (ENXIO);
+ if (IS_VF(&ha->cdev) && ha->rss_params.rss_enable) {
+ for (i = 0; i < ha->cdev.num_hwfns; i++) {
+ struct ecore_vf_iov *iov = ha->cdev.hwfns[i].vf_iov_info;
+
+ if (iov == NULL || !iov->rss_configured)
+ return (ENXIO);
+ }
+ }
+ return (0);
+}
+
+static int
+qlnx_get_rss_key(qlnx_host_t *ha, struct ifrsskey *ifrk)
+{
+ const struct ecore_rss_params *rss = &ha->rss_params;
+ int error, i;
+
+ error = qlnx_rss_query_status(ha);
+ if (error != 0)
+ return (error);
+ ifrk->ifrk_func = rss->rss_enable ? RSS_FUNC_TOEPLITZ : RSS_FUNC_NONE;
+ ifrk->ifrk_keylen = rss->rss_enable ? sizeof(rss->rss_key) : 0;
+ _Static_assert(sizeof(ifrk->ifrk_key) >= sizeof(rss->rss_key),
+ "RSS query buffer too small");
+ bzero(ifrk->ifrk_key, sizeof(ifrk->ifrk_key));
+ /* Undo the word conversion used when preparing the firmware request. */
+ if (rss->rss_enable) {
+ for (i = 0; i < ECORE_RSS_KEY_SIZE; i++)
+ be32enc(ifrk->ifrk_key + i * sizeof(uint32_t),
+ rss->rss_key[i]);
+ }
+ return (0);
+}
+
+static int
+qlnx_get_rss_hash(qlnx_host_t *ha, struct ifrsshash *ifrh)
+{
+ const struct ecore_rss_params *rss = &ha->rss_params;
+ uint8_t caps;
+ int error;
+
+ error = qlnx_rss_query_status(ha);
+ if (error != 0)
+ return (error);
+ ifrh->ifrh_func = rss->rss_enable ? RSS_FUNC_TOEPLITZ : RSS_FUNC_NONE;
+ ifrh->ifrh_types = 0;
+ caps = rss->rss_enable ? rss->rss_caps : 0;
+ if (caps & ECORE_RSS_IPV4)
+ ifrh->ifrh_types |= RSS_TYPE_IPV4;
+ if (caps & ECORE_RSS_IPV4_TCP)
+ ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4;
+ if (caps & ECORE_RSS_IPV4_UDP)
+ ifrh->ifrh_types |= RSS_TYPE_UDP_IPV4;
+ if (caps & ECORE_RSS_IPV6)
+ ifrh->ifrh_types |= RSS_TYPE_IPV6;
+ if (caps & ECORE_RSS_IPV6_TCP)
+ ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6;
+ if (caps & ECORE_RSS_IPV6_UDP)
+ ifrh->ifrh_types |= RSS_TYPE_UDP_IPV6;
+ return (0);
+}
+
static int
qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data)
{
@@ -2563,6 +2635,18 @@
ha = (qlnx_host_t *)if_getsoftc(ifp);
switch (cmd) {
+ case SIOCGIFRSSKEY:
+ QLNX_LOCK(ha);
+ ret = qlnx_get_rss_key(ha, (struct ifrsskey *)data);
+ QLNX_UNLOCK(ha);
+ break;
+
+ case SIOCGIFRSSHASH:
+ QLNX_LOCK(ha);
+ ret = qlnx_get_rss_hash(ha, (struct ifrsshash *)data);
+ QLNX_UNLOCK(ha);
+ break;
+
case SIOCSIFMTU:
QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 19, 7:46 PM (2 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39226153
Default Alt Text
D59810.diff (4 KB)
Attached To
Mode
D59810: qlnx: Report the programmed RSS key and hash types
Attached
Detach File
Event Timeline
Log In to Comment