aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-04-12 21:36:57 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-12 21:36:57 -0400
commite60a9de49c3744aa44128eaaed3aca965911ca2e (patch)
treec7b60221e87d0b9c7ce5036d3d7fa1376261dc24 /net/core
parent1ceb0b8ca5be40d32b0fcf57b117cfb595c9bbfa (diff)
parentb641173915ae7b51c79abfde9580c3a381876bb1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-04-11 This series contains updates to iflink, ixgbe and ixgbevf. The entire set of changes come from Vlad Zolotarov to ultimately add the ethtool ops to VF driver to allow querying the RSS indirection table and RSS random key. Currently we support only 82599 and x540 devices. On those devices, VFs share the RSS redirection table and hash key with a PF. Letting the VF query this information may introduce some security risks, therefore this feature will be disabled by default. The new netdev op allows a system administrator to change the default behaviour with "ip link set" command. The relevant iproute2 patch has already been sent and awaits for this series upstream. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/rtnetlink.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7a836152359b..358d52a38533 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -818,7 +818,8 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev,
818 nla_total_size(sizeof(struct ifla_vf_vlan)) + 818 nla_total_size(sizeof(struct ifla_vf_vlan)) +
819 nla_total_size(sizeof(struct ifla_vf_spoofchk)) + 819 nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
820 nla_total_size(sizeof(struct ifla_vf_rate)) + 820 nla_total_size(sizeof(struct ifla_vf_rate)) +
821 nla_total_size(sizeof(struct ifla_vf_link_state))); 821 nla_total_size(sizeof(struct ifla_vf_link_state)) +
822 nla_total_size(sizeof(struct ifla_vf_rss_query_en)));
822 return size; 823 return size;
823 } else 824 } else
824 return 0; 825 return 0;
@@ -1132,14 +1133,16 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
1132 struct ifla_vf_tx_rate vf_tx_rate; 1133 struct ifla_vf_tx_rate vf_tx_rate;
1133 struct ifla_vf_spoofchk vf_spoofchk; 1134 struct ifla_vf_spoofchk vf_spoofchk;
1134 struct ifla_vf_link_state vf_linkstate; 1135 struct ifla_vf_link_state vf_linkstate;
1136 struct ifla_vf_rss_query_en vf_rss_query_en;
1135 1137
1136 /* 1138 /*
1137 * Not all SR-IOV capable drivers support the 1139 * Not all SR-IOV capable drivers support the
1138 * spoofcheck query. Preset to -1 so the user 1140 * spoofcheck and "RSS query enable" query. Preset to
1139 * space tool can detect that the driver didn't 1141 * -1 so the user space tool can detect that the driver
1140 * report anything. 1142 * didn't report anything.
1141 */ 1143 */
1142 ivi.spoofchk = -1; 1144 ivi.spoofchk = -1;
1145 ivi.rss_query_en = -1;
1143 memset(ivi.mac, 0, sizeof(ivi.mac)); 1146 memset(ivi.mac, 0, sizeof(ivi.mac));
1144 /* The default value for VF link state is "auto" 1147 /* The default value for VF link state is "auto"
1145 * IFLA_VF_LINK_STATE_AUTO which equals zero 1148 * IFLA_VF_LINK_STATE_AUTO which equals zero
@@ -1152,7 +1155,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
1152 vf_rate.vf = 1155 vf_rate.vf =
1153 vf_tx_rate.vf = 1156 vf_tx_rate.vf =
1154 vf_spoofchk.vf = 1157 vf_spoofchk.vf =
1155 vf_linkstate.vf = ivi.vf; 1158 vf_linkstate.vf =
1159 vf_rss_query_en.vf = ivi.vf;
1156 1160
1157 memcpy(vf_mac.mac, ivi.mac, sizeof(ivi.mac)); 1161 memcpy(vf_mac.mac, ivi.mac, sizeof(ivi.mac));
1158 vf_vlan.vlan = ivi.vlan; 1162 vf_vlan.vlan = ivi.vlan;
@@ -1162,6 +1166,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
1162 vf_rate.max_tx_rate = ivi.max_tx_rate; 1166 vf_rate.max_tx_rate = ivi.max_tx_rate;
1163 vf_spoofchk.setting = ivi.spoofchk; 1167 vf_spoofchk.setting = ivi.spoofchk;
1164 vf_linkstate.link_state = ivi.linkstate; 1168 vf_linkstate.link_state = ivi.linkstate;
1169 vf_rss_query_en.setting = ivi.rss_query_en;
1165 vf = nla_nest_start(skb, IFLA_VF_INFO); 1170 vf = nla_nest_start(skb, IFLA_VF_INFO);
1166 if (!vf) { 1171 if (!vf) {
1167 nla_nest_cancel(skb, vfinfo); 1172 nla_nest_cancel(skb, vfinfo);
@@ -1176,7 +1181,10 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
1176 nla_put(skb, IFLA_VF_SPOOFCHK, sizeof(vf_spoofchk), 1181 nla_put(skb, IFLA_VF_SPOOFCHK, sizeof(vf_spoofchk),
1177 &vf_spoofchk) || 1182 &vf_spoofchk) ||
1178 nla_put(skb, IFLA_VF_LINK_STATE, sizeof(vf_linkstate), 1183 nla_put(skb, IFLA_VF_LINK_STATE, sizeof(vf_linkstate),
1179 &vf_linkstate)) 1184 &vf_linkstate) ||
1185 nla_put(skb, IFLA_VF_RSS_QUERY_EN,
1186 sizeof(vf_rss_query_en),
1187 &vf_rss_query_en))
1180 goto nla_put_failure; 1188 goto nla_put_failure;
1181 nla_nest_end(skb, vf); 1189 nla_nest_end(skb, vf);
1182 } 1190 }
@@ -1290,6 +1298,7 @@ static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
1290 [IFLA_VF_SPOOFCHK] = { .len = sizeof(struct ifla_vf_spoofchk) }, 1298 [IFLA_VF_SPOOFCHK] = { .len = sizeof(struct ifla_vf_spoofchk) },
1291 [IFLA_VF_RATE] = { .len = sizeof(struct ifla_vf_rate) }, 1299 [IFLA_VF_RATE] = { .len = sizeof(struct ifla_vf_rate) },
1292 [IFLA_VF_LINK_STATE] = { .len = sizeof(struct ifla_vf_link_state) }, 1300 [IFLA_VF_LINK_STATE] = { .len = sizeof(struct ifla_vf_link_state) },
1301 [IFLA_VF_RSS_QUERY_EN] = { .len = sizeof(struct ifla_vf_rss_query_en) },
1293}; 1302};
1294 1303
1295static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = { 1304static const struct nla_policy ifla_port_policy[IFLA_PORT_MAX+1] = {
@@ -1500,6 +1509,17 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr *attr)
1500 ivl->link_state); 1509 ivl->link_state);
1501 break; 1510 break;
1502 } 1511 }
1512 case IFLA_VF_RSS_QUERY_EN: {
1513 struct ifla_vf_rss_query_en *ivrssq_en;
1514
1515 ivrssq_en = nla_data(vf);
1516 err = -EOPNOTSUPP;
1517 if (ops->ndo_set_vf_rss_query_en)
1518 err = ops->ndo_set_vf_rss_query_en(dev,
1519 ivrssq_en->vf,
1520 ivrssq_en->setting);
1521 break;
1522 }
1503 default: 1523 default:
1504 err = -EINVAL; 1524 err = -EINVAL;
1505 break; 1525 break;