History

Merge branch 'nfp-fixes-for-v5-19'

Simon Horman says: ==================== nfp: fixes for v5.19 this short series includes two fixes for the NFP driver. 1. Restructure GRE+VLAN flower offload to address a miss match between the NIC firmware and driver implementation which prevented these features from working in combination. 2. Prevent unnecessary warnings regarding rate limiting support.- It is expected that this feature to not _always_ be present but this was not taken into account when the code to check for this feature was added. ====================

Jakub Kicinski committed 4 years ago

Commit cd3ff992 parents b489a6e a0b84333 files · +39 −37Browse files

Unified · Split

3 files
  1. drivers/net/ethernet/netronome/nfp/flower/conntrack.c +16 −16
  2. drivers/net/ethernet/netronome/nfp/flower/match.c +8 −8
  3. drivers/net/ethernet/netronome/nfp/nfp_net_sriov.c +15 −13
drivers/net/ethernet/netronome/nfp/flower/conntrack.c+16−16
@@ -507,6 +507,11 @@ nfp_fl_calc_key_layers_sz(struct nfp_fl_key_ls in_key_ls, uint16_t *map) · 506 unmodified lines
507507 key_size += sizeof(struct nfp_flower_ipv6);
508508 }
509509
510+ if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_QINQ) {
511+ map[FLOW_PAY_QINQ] = key_size;
512+ key_size += sizeof(struct nfp_flower_vlan);
513+ }
514+
510515 if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_GRE) {
511516 map[FLOW_PAY_GRE] = key_size;
512517 if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6)
@@ -515,11 +520,6 @@ nfp_fl_calc_key_layers_sz(struct nfp_fl_key_ls in_key_ls, uint16_t *map) · 2 unmodified lines
515520 key_size += sizeof(struct nfp_flower_ipv4_gre_tun);
516521 }
517522
518− if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_QINQ) {
519− map[FLOW_PAY_QINQ] = key_size;
520− key_size += sizeof(struct nfp_flower_vlan);
521− }
522−
523523 if ((in_key_ls.key_layer & NFP_FLOWER_LAYER_VXLAN) ||
524524 (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_GENEVE)) {
525525 map[FLOW_PAY_UDP_TUN] = key_size;
@@ -758,6 +758,17 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) · 232 unmodified lines
758758 }
759759 }
760760
761+ if (NFP_FLOWER_LAYER2_QINQ & key_layer.key_layer_two) {
762+ offset = key_map[FLOW_PAY_QINQ];
763+ key = kdata + offset;
764+ msk = mdata + offset;
765+ for (i = 0; i < _CT_TYPE_MAX; i++) {
766+ nfp_flower_compile_vlan((struct nfp_flower_vlan *)key,
767+ (struct nfp_flower_vlan *)msk,
768+ rules[i]);
769+ }
770+ }
771+
761772 if (key_layer.key_layer_two & NFP_FLOWER_LAYER2_GRE) {
762773 offset = key_map[FLOW_PAY_GRE];
763774 key = kdata + offset;
@@ -798,17 +809,6 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) · 34 unmodified lines
798809 }
799810 }
800811
801− if (NFP_FLOWER_LAYER2_QINQ & key_layer.key_layer_two) {
802− offset = key_map[FLOW_PAY_QINQ];
803− key = kdata + offset;
804− msk = mdata + offset;
805− for (i = 0; i < _CT_TYPE_MAX; i++) {
806− nfp_flower_compile_vlan((struct nfp_flower_vlan *)key,
807− (struct nfp_flower_vlan *)msk,
808− rules[i]);
809− }
810− }
811−
812812 if (key_layer.key_layer & NFP_FLOWER_LAYER_VXLAN ||
813813 key_layer.key_layer_two & NFP_FLOWER_LAYER2_GENEVE) {
814814 offset = key_map[FLOW_PAY_UDP_TUN];
drivers/net/ethernet/netronome/nfp/flower/match.c+8−8
@@ -625,6 +625,14 @@ int nfp_flower_compile_flow_match(struct nfp_app *app, · 624 unmodified lines
625625 msk += sizeof(struct nfp_flower_ipv6);
626626 }
627627
628+ if (NFP_FLOWER_LAYER2_QINQ & key_ls->key_layer_two) {
629+ nfp_flower_compile_vlan((struct nfp_flower_vlan *)ext,
630+ (struct nfp_flower_vlan *)msk,
631+ rule);
632+ ext += sizeof(struct nfp_flower_vlan);
633+ msk += sizeof(struct nfp_flower_vlan);
634+ }
635+
628636 if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_GRE) {
629637 if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6) {
630638 struct nfp_flower_ipv6_gre_tun *gre_match;
@@ -660,14 +668,6 @@ int nfp_flower_compile_flow_match(struct nfp_app *app, · 29 unmodified lines
660668 }
661669 }
662670
663− if (NFP_FLOWER_LAYER2_QINQ & key_ls->key_layer_two) {
664− nfp_flower_compile_vlan((struct nfp_flower_vlan *)ext,
665− (struct nfp_flower_vlan *)msk,
666− rule);
667− ext += sizeof(struct nfp_flower_vlan);
668− msk += sizeof(struct nfp_flower_vlan);
669− }
670−
671671 if (key_ls->key_layer & NFP_FLOWER_LAYER_VXLAN ||
672672 key_ls->key_layer_two & NFP_FLOWER_LAYER2_GENEVE) {
673673 if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6) {
drivers/net/ethernet/netronome/nfp/nfp_net_sriov.c+15−13
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include "nfp_net_sriov.h"
1616
1717 static int
18−nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg)
18+nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg, bool warn)
1919 {
2020 u16 cap_vf;
2121
@@ -24,12 +24,14 @@ nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg) · 2 unmodified lines
2424
2525 cap_vf = readw(app->pf->vfcfg_tbl2 + NFP_NET_VF_CFG_MB_CAP);
2626 if ((cap_vf & cap) != cap) {
27− nfp_warn(app->pf->cpp, "ndo_set_vf_%s not supported\n", msg);
27+ if (warn)
28+ nfp_warn(app->pf->cpp, "ndo_set_vf_%s not supported\n", msg);
2829 return -EOPNOTSUPP;
2930 }
3031
3132 if (vf < 0 || vf >= app->pf->num_vfs) {
32− nfp_warn(app->pf->cpp, "invalid VF id %d\n", vf);
33+ if (warn)
34+ nfp_warn(app->pf->cpp, "invalid VF id %d\n", vf);
3335 return -EINVAL;
3436 }
3537
@@ -65,7 +67,7 @@ int nfp_app_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) · 29 unmodified lines
6567 unsigned int vf_offset;
6668 int err;
6769
68− err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_MAC, "mac");
70+ err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_MAC, "mac", true);
6971 if (err)
7072 return err;
7173
@@ -101,7 +103,7 @@ int nfp_app_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos, · 29 unmodified lines
101103 u32 vlan_tag;
102104 int err;
103105
104− err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN, "vlan");
106+ err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN, "vlan", true);
105107 if (err)
106108 return err;
107109
@@ -115,7 +117,7 @@ int nfp_app_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos, · 7 unmodified lines
115117 }
116118
117119 /* Check if fw supports or not */
118− err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto");
120+ err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto", true);
119121 if (err)
120122 is_proto_sup = false;
121123
@@ -149,7 +151,7 @@ int nfp_app_set_vf_rate(struct net_device *netdev, int vf, · 27 unmodified lines
149151 u32 vf_offset, ratevalue;
150152 int err;
151153
152− err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate");
154+ err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate", true);
153155 if (err)
154156 return err;
155157
@@ -181,7 +183,7 @@ int nfp_app_set_vf_spoofchk(struct net_device *netdev, int vf, bool enable) · 25 unmodified lines
181183 int err;
182184
183185 err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_SPOOF,
184− "spoofchk");
186+ "spoofchk", true);
185187 if (err)
186188 return err;
187189
@@ -205,7 +207,7 @@ int nfp_app_set_vf_trust(struct net_device *netdev, int vf, bool enable) · 17 unmodified lines
205207 int err;
206208
207209 err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_TRUST,
208− "trust");
210+ "trust", true);
209211 if (err)
210212 return err;
211213
@@ -230,7 +232,7 @@ int nfp_app_set_vf_link_state(struct net_device *netdev, int vf, · 18 unmodified lines
230232 int err;
231233
232234 err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_LINK_STATE,
233− "link_state");
235+ "link_state", true);
234236 if (err)
235237 return err;
236238
@@ -265,7 +267,7 @@ int nfp_app_get_vf_config(struct net_device *netdev, int vf, · 28 unmodified lines
265267 u8 flags;
266268 int err;
267269
268− err = nfp_net_sriov_check(app, vf, 0, "");
270+ err = nfp_net_sriov_check(app, vf, 0, "", true);
269271 if (err)
270272 return err;
271273
@@ -285,13 +287,13 @@ int nfp_app_get_vf_config(struct net_device *netdev, int vf, · 13 unmodified lines
285287
286288 ivi->vlan = FIELD_GET(NFP_NET_VF_CFG_VLAN_VID, vlan_tag);
287289 ivi->qos = FIELD_GET(NFP_NET_VF_CFG_VLAN_QOS, vlan_tag);
288− if (!nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto"))
290+ if (!nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto", false))
289291 ivi->vlan_proto = htons(FIELD_GET(NFP_NET_VF_CFG_VLAN_PROT, vlan_tag));
290292 ivi->spoofchk = FIELD_GET(NFP_NET_VF_CFG_CTRL_SPOOF, flags);
291293 ivi->trusted = FIELD_GET(NFP_NET_VF_CFG_CTRL_TRUST, flags);
292294 ivi->linkstate = FIELD_GET(NFP_NET_VF_CFG_CTRL_LINK_STATE, flags);
293295
294− err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate");
296+ err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate", false);
295297 if (!err) {
296298 rate = readl(app->pf->vfcfg_tbl2 + vf_offset +
297299 NFP_NET_VF_CFG_RATE);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t